pub struct Pbkdf2Params<'a> {
pub salt: &'a [u8],
pub iteration_count: u32,
pub key_length: Option<u16>,
pub prf: Pbkdf2Prf,
}Expand description
Password-Based Key Derivation Scheme 2 parameters as defined in RFC 8018 Appendix A.2.
PBKDF2-params ::= SEQUENCE {
salt CHOICE {
specified OCTET STRING,
otherSource AlgorithmIdentifier {{PBKDF2-SaltSources}}
},
iterationCount INTEGER (1..MAX),
keyLength INTEGER (1..MAX) OPTIONAL,
prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT
algid-hmacWithSHA1 }Fields§
§salt: &'a [u8]PBKDF2 salt
iteration_count: u32PBKDF2 iteration count
key_length: Option<u16>PBKDF2 output length
prf: Pbkdf2PrfPseudo-random function to use with PBKDF2
Implementations§
Source§impl<'a> Pbkdf2Params<'a>
impl<'a> Pbkdf2Params<'a>
Sourcepub const MAX_ITERATION_COUNT: u32 = 100_000_000
pub const MAX_ITERATION_COUNT: u32 = 100_000_000
Implementation defined maximum iteration count of 100,000,000.
For especially critical keys, or for very powerful systems or systems where user-perceived performance is not critical, an iteration count of 10,000,000 may be appropriate.
See RFC 8018, §4.2 and RFC 8018, §A.2
Sourcepub fn hmac_with_sha256(iteration_count: u32, salt: &'a [u8]) -> Result<Self>
pub fn hmac_with_sha256(iteration_count: u32, salt: &'a [u8]) -> Result<Self>
Initialize PBKDF2-SHA256 with the given iteration count and salt
Trait Implementations§
Source§impl<'a> Clone for Pbkdf2Params<'a>
impl<'a> Clone for Pbkdf2Params<'a>
Source§fn clone(&self) -> Pbkdf2Params<'a>
fn clone(&self) -> Pbkdf2Params<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for Pbkdf2Params<'a>
impl<'a> Debug for Pbkdf2Params<'a>
Source§impl<'a> DecodeValue<'a> for Pbkdf2Params<'a>
impl<'a> DecodeValue<'a> for Pbkdf2Params<'a>
Source§impl EncodeValue for Pbkdf2Params<'_>
impl EncodeValue for Pbkdf2Params<'_>
Source§impl<'a> From<Pbkdf2Params<'a>> for Kdf<'a>
impl<'a> From<Pbkdf2Params<'a>> for Kdf<'a>
Source§fn from(params: Pbkdf2Params<'a>) -> Self
fn from(params: Pbkdf2Params<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> PartialEq for Pbkdf2Params<'a>
impl<'a> PartialEq for Pbkdf2Params<'a>
Source§impl<'a> TryFrom<AnyRef<'a>> for Pbkdf2Params<'a>
impl<'a> TryFrom<AnyRef<'a>> for Pbkdf2Params<'a>
impl<'a> Copy for Pbkdf2Params<'a>
impl<'a> Eq for Pbkdf2Params<'a>
impl<'a> Sequence<'a> for Pbkdf2Params<'a>
impl<'a> StructuralPartialEq for Pbkdf2Params<'a>
Auto Trait Implementations§
impl<'a> Freeze for Pbkdf2Params<'a>
impl<'a> RefUnwindSafe for Pbkdf2Params<'a>
impl<'a> Send for Pbkdf2Params<'a>
impl<'a> Sync for Pbkdf2Params<'a>
impl<'a> Unpin for Pbkdf2Params<'a>
impl<'a> UnsafeUnpin for Pbkdf2Params<'a>
impl<'a> UnwindSafe for Pbkdf2Params<'a>
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,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
Source§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
Source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this value in bytes when encoded as ASN.1 DER.
Source§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Writer.
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 value to the provided byte slice, returning a sub-slice
containing the encoded message.