pub struct DomainKey(/* private fields */);Expand description
A random symmetric key for one domain epoch.
Implementations§
Source§impl DomainKey
impl DomainKey
Sourcepub fn generate() -> Result<Self, SecurityError>
pub fn generate() -> Result<Self, SecurityError>
Generates a key from the operating system’s cryptographic random source.
Sourcepub const fn from_bytes(bytes: [u8; 32]) -> Self
pub const fn from_bytes(bytes: [u8; 32]) -> Self
Imports exact key bytes from a trusted key provider.
Sourcepub fn derive_subkey(
&self,
salt: &[u8],
context: &[u8],
) -> Result<Zeroizing<[u8; 32]>, SecurityError>
pub fn derive_subkey( &self, salt: &[u8], context: &[u8], ) -> Result<Zeroizing<[u8; 32]>, SecurityError>
Derives a domain-separated object key without exposing the epoch key.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DomainKey
impl RefUnwindSafe for DomainKey
impl Send for DomainKey
impl Sync for DomainKey
impl Unpin for DomainKey
impl UnwindSafe for DomainKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more