#[non_exhaustive]pub enum Kdf {
Pbkdf2(Pbkdf2Params),
Scrypt(ScryptParams),
}Expand description
Password-based key derivation function.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Pbkdf2(Pbkdf2Params)
Password-Based Key Derivation Function 2 (PBKDF2).
Scrypt(ScryptParams)
scrypt sequential memory-hard password hashing function.
Implementations§
Source§impl Kdf
impl Kdf
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>
pub fn pbkdf2(&self) -> Option<&Pbkdf2Params>
Get Pbkdf2Params if it is the selected algorithm.
Sourcepub fn scrypt(&self) -> Option<&ScryptParams>
pub fn scrypt(&self) -> Option<&ScryptParams>
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§
Source§impl<'a> DecodeValue<'a> for Kdf
impl<'a> DecodeValue<'a> for Kdf
Source§impl EncodeValue for Kdf
impl EncodeValue for Kdf
impl Eq for Kdf
Source§impl From<Pbkdf2Params> for Kdf
impl From<Pbkdf2Params> for Kdf
Source§fn from(params: Pbkdf2Params) -> Self
fn from(params: Pbkdf2Params) -> Self
Converts to this type from the input type.
Source§impl From<ScryptParams> for Kdf
impl From<ScryptParams> for Kdf
Source§fn from(params: ScryptParams) -> Self
fn from(params: ScryptParams) -> Self
Converts to this type from the input type.
impl Sequence<'_> for Kdf
impl StructuralPartialEq for Kdf
Auto Trait Implementations§
impl Freeze for Kdf
impl RefUnwindSafe for Kdf
impl Send for Kdf
impl Sync for Kdf
impl Unpin for Kdf
impl UnsafeUnpin for Kdf
impl UnwindSafe for Kdf
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag + 'a,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag + 'a,
Source§type Error = <T as DecodeValue<'a>>::Error
type Error = <T as DecodeValue<'a>>::Error
Type returned in the event of a decoding error.
Source§fn decode<R>(reader: &mut R) -> Result<T, <T as DecodeValue<'a>>::Error>where
R: Reader<'a>,
fn decode<R>(reader: &mut R) -> Result<T, <T as DecodeValue<'a>>::Error>where
R: Reader<'a>,
Attempt to decode this TLV message using the provided decoder. Read more
impl<T> DecodeOwned for Twhere
T: for<'a> Decode<'a>,
Source§impl<T> Encode for T
impl<T> Encode for T
Source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this TLV object in bytes when encoded as ASN.1 DER. Read more
Source§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Encode this TLV object to the provided byte slice, returning a sub-slice
containing the encoded message. Read more
Source§impl<T> IsConstructed for T
impl<T> IsConstructed for T
Source§const CONSTRUCTED: bool
const CONSTRUCTED: bool
ASN.1 constructed bit