#[non_exhaustive]
pub enum Kdf<'a> {
Pbkdf2(Pbkdf2Params<'a>),
Scrypt(ScryptParams<'a>),
}
Expand description
Password-based key derivation function.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Pbkdf2(Pbkdf2Params<'a>)
Password-Based Key Derivation Function 2 (PBKDF2).
Scrypt(ScryptParams<'a>)
scrypt sequential memory-hard password hashing function.
Implementations
sourceimpl<'a> Kdf<'a>
impl<'a> Kdf<'a>
sourcepub fn key_length(&self) -> Option<u16>
pub fn key_length(&self) -> Option<u16>
Get derived key length in bytes, if defined.
sourcepub fn oid(&self) -> ObjectIdentifier
pub fn oid(&self) -> ObjectIdentifier
Get the ObjectIdentifier
(a.k.a OID) for this algorithm.
sourcepub fn pbkdf2(&self) -> Option<&Pbkdf2Params<'a>>
pub fn pbkdf2(&self) -> Option<&Pbkdf2Params<'a>>
Get Pbkdf2Params
if it is the selected algorithm.
sourcepub fn scrypt(&self) -> Option<&ScryptParams<'a>>
pub fn scrypt(&self) -> Option<&ScryptParams<'a>>
Get ScryptParams
if it is the selected algorithm.
sourcepub fn to_alg_params_invalid(&self) -> Error
pub fn to_alg_params_invalid(&self) -> Error
Convenience function to turn the OID (see oid
)
of this Kdf
into error case Error::AlgorithmParametersInvalid
Trait Implementations
sourceimpl<'a> From<Pbkdf2Params<'a>> for Kdf<'a>
impl<'a> From<Pbkdf2Params<'a>> for Kdf<'a>
sourcefn from(params: Pbkdf2Params<'a>) -> Self
fn from(params: Pbkdf2Params<'a>) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<ScryptParams<'a>> for Kdf<'a>
impl<'a> From<ScryptParams<'a>> for Kdf<'a>
sourcefn from(params: ScryptParams<'a>) -> Self
fn from(params: ScryptParams<'a>) -> Self
Converts to this type from the input type.
sourceimpl<'a> TryFrom<AlgorithmIdentifier<'a>> for Kdf<'a>
impl<'a> TryFrom<AlgorithmIdentifier<'a>> for Kdf<'a>
impl<'a> Eq for Kdf<'a>
impl<'a> StructuralEq for Kdf<'a>
impl<'a> StructuralPartialEq for Kdf<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for Kdf<'a>
impl<'a> Send for Kdf<'a>
impl<'a> Sync for Kdf<'a>
impl<'a> Unpin for Kdf<'a>
impl<'a> UnwindSafe for Kdf<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'a, T> Choice<'a> for T where
T: Decode<'a> + FixedTag,
impl<'a, T> Choice<'a> for T where
T: Decode<'a> + FixedTag,
sourcefn can_decode(tag: Tag) -> bool
fn can_decode(tag: Tag) -> bool
Is the provided Tag
decodable as a variant of this CHOICE
?
sourceimpl<T> Encode for T where
T: EncodeValue + Tagged,
impl<T> Encode for T where
T: EncodeValue + Tagged,
sourceimpl<'a, M> EncodeValue for M where
M: Sequence<'a>,
impl<'a, M> EncodeValue for M where
M: Sequence<'a>,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more