Skip to main content

PasswordBasedKdfManager

Struct PasswordBasedKdfManager 

Source
pub struct PasswordBasedKdfManager { /* private fields */ }
Expand description

口令派生(PBKDF2)门面。

Implementations§

Source§

impl PasswordBasedKdfManager

Source

pub fn new( registry: Registry<Box<dyn PasswordBasedKdf>>, default_identifier: impl Into<String>, ) -> Result<Self>

Source

pub fn derive_from_password( &self, password: &[u8], salt: &[u8], length: usize, ) -> Result<Vec<u8>>

Source

pub fn derive_from_password_with( &self, identifier: &str, password: &[u8], salt: &[u8], length: usize, ) -> Result<Vec<u8>>

Source

pub fn registry(&self) -> &Registry<Box<dyn PasswordBasedKdf>>

Source

pub fn registry_mut(&mut self) -> &mut Registry<Box<dyn PasswordBasedKdf>>

Source

pub fn default_identifier(&self) -> &str

Source

pub fn set_default_identifier( &mut self, identifier: impl Into<String>, ) -> Result<()>

Trait Implementations§

Source§

impl Debug for PasswordBasedKdfManager

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromExt for T

Source§

fn from_<T>(t: T) -> Self
where Self: From<T>,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoExt for T

Source§

fn into_<T>(self) -> T
where Self: Into<T>,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T> TryFromExt for T

Source§

fn try_from_<T>(t: T) -> Result<Self, Self::Error>
where Self: TryFrom<T>,

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TryIntoExt for T

Source§

fn try_into_<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,