pub struct KdfDerivedKeyMaterial(pub(super) Pin<Box<GenericArray<u8, U32>>>);Expand description
Holding struct for key material derived from a KDF.
The internal key material should not be used directly for cryptographic operations. Instead it
MUST be converted to the appropriate type such as SymmetricCryptoKey, MasterKey or any other
key type. This can be done by either directly consuming the key material or by stretching it
further using HKDF (HMAC-based Key Derivation Function).
Uses a pinned heap data structure, as noted in Pinned heap data
Tuple Fields§
§0: Pin<Box<GenericArray<u8, U32>>>Implementations§
Source§impl KdfDerivedKeyMaterial
impl KdfDerivedKeyMaterial
Sourcepub(super) fn derive_kdf_key(
secret: &[u8],
salt: &[u8],
kdf: &Kdf,
) -> Result<Self, CryptoError>
pub(super) fn derive_kdf_key( secret: &[u8], salt: &[u8], kdf: &Kdf, ) -> Result<Self, CryptoError>
Derive a key from a secret and salt using the provided KDF.
Trait Implementations§
Source§impl From<KdfDerivedKeyMaterial> for MasterKey
impl From<KdfDerivedKeyMaterial> for MasterKey
Source§fn from(key: KdfDerivedKeyMaterial) -> Self
fn from(key: KdfDerivedKeyMaterial) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for KdfDerivedKeyMaterial
impl RefUnwindSafe for KdfDerivedKeyMaterial
impl Send for KdfDerivedKeyMaterial
impl Sync for KdfDerivedKeyMaterial
impl Unpin for KdfDerivedKeyMaterial
impl UnwindSafe for KdfDerivedKeyMaterial
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read moreSource§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more