diff options
-rw-r--r-- | openpgp/src/serialize/mod.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/openpgp/src/serialize/mod.rs b/openpgp/src/serialize/mod.rs index f2dc5409..0b7887b2 100644 --- a/openpgp/src/serialize/mod.rs +++ b/openpgp/src/serialize/mod.rs @@ -283,6 +283,19 @@ impl Serialize for KeyID { } } +impl Serialize for Fingerprint { + fn serialize<W: io::Write>(&self, o: &mut W) -> Result<()> { + o.write_all(self.as_slice())?; + Ok(()) + } + + fn to_vec(&self) -> Result<Vec<u8>> { + let mut o = Vec::with_capacity(20); + self.serialize(&mut o)?; + Ok(o) + } +} + impl Serialize for crypto::mpis::MPI { fn serialize<W: io::Write>(&self, w: &mut W) -> Result<()> { write_be_u16(w, self.bits as u16)?; |