summaryrefslogtreecommitdiffstats
path: root/openpgp/src/fingerprint.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/fingerprint.rs')
-rw-r--r--openpgp/src/fingerprint.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/openpgp/src/fingerprint.rs b/openpgp/src/fingerprint.rs
index 9c4a57cf..a12ec118 100644
--- a/openpgp/src/fingerprint.rs
+++ b/openpgp/src/fingerprint.rs
@@ -18,6 +18,14 @@ impl fmt::Debug for Fingerprint {
}
}
+impl std::str::FromStr for Fingerprint {
+ type Err = failure::Error;
+
+ fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
+ Self::from_hex(s)
+ }
+}
+
impl Fingerprint {
/// Reads a binary fingerprint.
pub fn from_bytes(raw: &[u8]) -> Fingerprint {