diff options
Diffstat (limited to 'openpgp/src/crypto/keygrip.rs')
-rw-r--r-- | openpgp/src/crypto/keygrip.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/openpgp/src/crypto/keygrip.rs b/openpgp/src/crypto/keygrip.rs index 9bf4bf5b..66240b92 100644 --- a/openpgp/src/crypto/keygrip.rs +++ b/openpgp/src/crypto/keygrip.rs @@ -29,6 +29,14 @@ impl fmt::Display for Keygrip { } } +impl std::str::FromStr for Keygrip { + type Err = failure::Error; + + fn from_str(s: &str) -> std::result::Result<Self, Self::Err> { + Self::from_hex(s) + } +} + impl Keygrip { /// Parses a keygrip. pub fn from_hex(hex: &str) -> Result<Self> { |