Skip to main content

PasswordBasedKdf

Trait PasswordBasedKdf 

Source
pub trait PasswordBasedKdf:
    Identified
    + Send
    + Sync {
    // Required method
    fn derive_from_password(
        &self,
        password: &[u8],
        salt: &[u8],
        length: usize,
    ) -> Result<Vec<u8>>;
}
Expand description

基于口令的密钥派生(典型为 PBKDF2):从人类可读口令得到固定长度密钥。

Required Methods§

Source

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

salt:随机盐(建议每用户 / 每密钥唯一)。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§