pub struct KeyDerivation { /* private fields */ }Expand description
Key derivation
Implementations§
Source§impl KeyDerivation
impl KeyDerivation
pub fn new() -> Self
pub fn initialize(&mut self) -> Result<(), CryptographicError>
Sourcepub fn add_derivation_function(
&mut self,
name: String,
function: DerivationFunction,
)
pub fn add_derivation_function( &mut self, name: String, function: DerivationFunction, )
Register a derivation function under a named key.
Sourcepub fn get_derivation_function(&self, name: &str) -> Option<&DerivationFunction>
pub fn get_derivation_function(&self, name: &str) -> Option<&DerivationFunction>
Look up a derivation function by name.
Sourcepub fn list_derivation_functions(
&self,
) -> impl Iterator<Item = (&String, &DerivationFunction)>
pub fn list_derivation_functions( &self, ) -> impl Iterator<Item = (&String, &DerivationFunction)>
Iterate over all registered derivation function names.
Sourcepub fn derive_hkdf(
&self,
ikm: &[u8],
info: &[u8],
) -> Result<Vec<u8>, CryptographicError>
pub fn derive_hkdf( &self, ikm: &[u8], info: &[u8], ) -> Result<Vec<u8>, CryptographicError>
Derive output_length bytes from input keying material using HKDF-SHA256.
Uses the configured derivation_parameters.salt and output_length. info
is the application-specific context/label that domain-separates derived keys.
Auto Trait Implementations§
impl Freeze for KeyDerivation
impl RefUnwindSafe for KeyDerivation
impl Send for KeyDerivation
impl Sync for KeyDerivation
impl Unpin for KeyDerivation
impl UnsafeUnpin for KeyDerivation
impl UnwindSafe for KeyDerivation
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§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