summaryrefslogtreecommitdiffstats
path: root/openpgp/src/keyid.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/keyid.rs')
-rw-r--r--openpgp/src/keyid.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/openpgp/src/keyid.rs b/openpgp/src/keyid.rs
index 799bf4fd..2e77c962 100644
--- a/openpgp/src/keyid.rs
+++ b/openpgp/src/keyid.rs
@@ -20,6 +20,14 @@ impl fmt::Debug for KeyID {
}
}
+impl std::str::FromStr for KeyID {
+ type Err = failure::Error;
+
+ fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
+ Self::from_hex(s)
+ }
+}
+
impl From<KeyID> for Vec<u8> {
fn from(id: KeyID) -> Self {
let mut r = Vec::with_capacity(8);