pub struct Password { /* private fields */ }
Expand description
A type to represent the Password
that PBKDF2 hashes and uses for key derivation.
Exceptions:
An exception will be thrown if:
slice
is empty.
Security:
- Avoid using
unprotected_as_bytes()
whenever possible, as it breaks all protections that the type implements.
Implementations§
source§impl Password
impl Password
sourcepub fn from_slice(slice: &[u8]) -> Result<Password, UnknownCryptoError>
pub fn from_slice(slice: &[u8]) -> Result<Password, UnknownCryptoError>
Make an object from a given byte slice.
sourcepub fn unprotected_as_bytes(&self) -> &[u8] ⓘ
pub fn unprotected_as_bytes(&self) -> &[u8] ⓘ
Return the object as byte slice. Warning: Should not be used unless strictly needed. This breaks protections that the type implements.
sourcepub fn get_length(&self) -> usize
pub fn get_length(&self) -> usize
Return the length of the object.