diff --git a/src/backup/crypt_config.rs b/src/backup/crypt_config.rs index 92601f61..9efc9cf8 100644 --- a/src/backup/crypt_config.rs +++ b/src/backup/crypt_config.rs @@ -63,6 +63,17 @@ impl Display for Fingerprint { } } +impl std::str::FromStr for Fingerprint { + type Err = Error; + + fn from_str(s: &str) -> Result { + let mut tmp = s.to_string(); + tmp.retain(|c| c != ':'); + let bytes = proxmox::tools::hex_to_digest(&tmp)?; + Ok(Fingerprint::new(bytes)) + } +} + /// Encryption Configuration with secret key /// /// This structure stores the secret key and provides helpers for