diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2018-06-13 12:56:54 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2018-06-14 07:39:45 +0200 |
commit | c479b1a5f8d5d266b6a2d73a8c04a15ebf3300da (patch) | |
tree | 8e4f61a863adb082ea587e60db6a3ed230c13352 /openpgp/src/fingerprint.rs | |
parent | f90aaa103d779e142efbc79d37ae4939ccde876f (diff) |
openpgp: Allow access to the raw fingerprint data.
Diffstat (limited to 'openpgp/src/fingerprint.rs')
-rw-r--r-- | openpgp/src/fingerprint.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/openpgp/src/fingerprint.rs b/openpgp/src/fingerprint.rs index c33d995b..46b24bc3 100644 --- a/openpgp/src/fingerprint.rs +++ b/openpgp/src/fingerprint.rs @@ -46,6 +46,14 @@ impl Fingerprint { Some(Fingerprint::from_bytes(&::from_hex(hex, true)?[..])) } + /// Returns a reference to the raw Fingerprint. + pub fn as_slice(&self) -> &[u8] { + match self { + &Fingerprint::V4(ref fp) => fp, + &Fingerprint::Invalid(ref fp) => fp, + } + } + /// Converts the fingerprint to its standard representation. /// /// Returns the fingerprint suitable for human consumption. |