pub struct SessionKey(/* private fields */);Implementations§
Source§impl SessionKey
impl SessionKey
Sourcepub fn entity_key<E: EncryptedEntity>(
&self,
entity: &E,
) -> CryptoResult<[u8; 32]>
pub fn entity_key<E: EncryptedEntity>( &self, entity: &E, ) -> CryptoResult<[u8; 32]>
Convenience: derive the per-entity key for a specific row.
Source§impl SessionKey
impl SessionKey
Sourcepub fn new(bytes: [u8; 32]) -> Self
pub fn new(bytes: [u8; 32]) -> Self
Wrap a 32-byte master key. The caller is responsible for sourcing the key material (PIN-derived unwrap, recovery, or OS keychain).
Sourcepub fn derive(&self, namespace: KeyNamespace, id: i64) -> CryptoResult<[u8; 32]>
pub fn derive(&self, namespace: KeyNamespace, id: i64) -> CryptoResult<[u8; 32]>
Derive a per-entity key. Preferred over as_bytes() because it
keeps the master key material encapsulated.
Trait Implementations§
Source§impl Drop for SessionKey
impl Drop for SessionKey
Auto Trait Implementations§
impl Freeze for SessionKey
impl RefUnwindSafe for SessionKey
impl Send for SessionKey
impl Sync for SessionKey
impl Unpin for SessionKey
impl UnsafeUnpin for SessionKey
impl UnwindSafe for SessionKey
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