pub struct KdfCtx { /* private fields */ }Expand description
A key-derivation context (EVP_KDF_CTX*).
!Clone — create a new context for each derive operation.
Implementations§
Source§impl KdfCtx
impl KdfCtx
Sourcepub fn new(alg: &KdfAlg) -> Result<Self, ErrorStack>
pub fn new(alg: &KdfAlg) -> Result<Self, ErrorStack>
Create a new context from an algorithm descriptor.
§Errors
Sourcepub fn derive(
&mut self,
out: &mut [u8],
params: &Params<'_>,
) -> Result<(), ErrorStack>
pub fn derive( &mut self, out: &mut [u8], params: &Params<'_>, ) -> Result<(), ErrorStack>
Derive key material into out.
Parameters are supplied at derive time via the params argument.
§Errors
Sourcepub fn set_params(&mut self, params: &Params<'_>) -> Result<(), ErrorStack>
pub fn set_params(&mut self, params: &Params<'_>) -> Result<(), ErrorStack>
Update parameters on this KDF context without destroying it.
Use this to change algorithm-specific settings (e.g. HKDF mode, salt) on an already-initialised context instead of creating a new one.
§Errors
Returns Err if EVP_KDF_CTX_set_params fails (e.g. unknown key,
type mismatch, or the algorithm does not support the parameter).
Sourcepub fn get_params(&self, params: &mut Params<'_>) -> Result<(), ErrorStack>
pub fn get_params(&self, params: &mut Params<'_>) -> Result<(), ErrorStack>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KdfCtx
impl RefUnwindSafe for KdfCtx
impl !Sync for KdfCtx
impl Unpin for KdfCtx
impl UnwindSafe for KdfCtx
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