pub mod core;
pub mod key_derivation;
pub mod keyring;
pub use core::{EncryptionError, ZeroKnowledgeEncryptor};
pub use key_derivation::{derive_domain_key, KeyDerivationError};
pub use keyring::{Keyring, TenantKeyring, MAX_DECRYPT_ONLY_KEYS};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum KeyDomain {
Encryption,
Authentication,
CacheKeys,
}
impl KeyDomain {
pub fn as_str(&self) -> &'static str {
match self {
KeyDomain::Encryption => "encryption",
KeyDomain::Authentication => "authentication",
KeyDomain::CacheKeys => "cache_keys",
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_domain_strings() {
assert_eq!(KeyDomain::Encryption.as_str(), "encryption");
assert_eq!(KeyDomain::Authentication.as_str(), "authentication");
assert_eq!(KeyDomain::CacheKeys.as_str(), "cache_keys");
}
}