We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d6d921 commit 880c225Copy full SHA for 880c225
1 file changed
src/key.rs
@@ -1,6 +1,6 @@
1
use std::time::Duration;
2
3
-use byteorder::{BigEndian, WriteBytesExt};
+use byteorder::{BigEndian, ByteOrder, WriteBytesExt};
4
use digest::Digest;
5
use failure::Error;
6
use md5::Md5;
@@ -306,8 +306,8 @@ impl Key {
306
}
307
308
309
- pub fn id(&self) -> Result<Vec<u8>, Error> {
310
- match self.version {
+ pub fn id(&self) -> Result<u64, Error> {
+ let bytes = match self.version {
311
KeyVersion::V3 => match self.key_material {
312
KeyMaterial::Rsa(ref pubkey, _) => {
313
let n = pubkey.n.to_bytes_be();
@@ -320,7 +320,9 @@ impl Key {
320
let len = f.len();
321
f.split_off(len - 8)
322
}),
323
- }
+ }?;
324
+
325
+ Ok(BigEndian::read_u64(&bytes))
326
327
328
0 commit comments