pub fn validate_age_prefix(key: &str) -> Result<()>Expand description
Validates that a string has the standard age public key prefix.
Checks that key is non-empty and starts with "age1". This function
is used internally by PublicKey::new.
§Errors
Returns Error::Validation with:
ValidationError::InvalidPublicKeyFormatif the key is empty.ValidationError::InvalidPublicKeyFormatif the key does not start with"age1". The error message includes the first 10 characters of the offending input.
§Examples
use age_setup::validation::validate_age_prefix;
assert!(validate_age_prefix("age1abc").is_ok());
assert!(validate_age_prefix("bad").is_err());
assert!(validate_age_prefix("").is_err());