Kévin Commaille 7f8f89eff7 identifiers: Differentiate signing keys from device keys
Use OwnedCrossSigningKeyId, OwnedDeviceSigningKeyId and
OwnedCrossSigningOrDeviceSigningKeyId instead of OwnedDeviceKeyId
to identify signing keys.
2024-11-08 13:13:15 -05:00

11 lines
276 B
Rust

use crate::Error;
pub fn validate(s: &str) -> Result<(), Error> {
if s.is_empty() {
return Err(Error::Empty);
} else if !s.chars().all(|c| c.is_alphanumeric() || matches!(c, '+' | '/' | '=')) {
return Err(Error::InvalidCharacters);
}
Ok(())
}