Struct pkcs5::pbes2::Parameters [−][src]
pub struct Parameters<'a> { pub kdf: Kdf<'a>, pub encryption: EncryptionScheme<'a>, }
Password-Based Encryption Scheme 2 parameters as defined in RFC 8018 Appendix A.4.
PBES2-params ::= SEQUENCE {
keyDerivationFunc AlgorithmIdentifier {{PBES2-KDFs}},
encryptionScheme AlgorithmIdentifier {{PBES2-Encs}} }
Fields
kdf: Kdf<'a>
Key derivation function
encryption: EncryptionScheme<'a>
Encryption scheme
Implementations
impl<'a> Parameters<'a>
[src]
impl<'a> Parameters<'a>
[src]pub fn pbkdf2_sha256_aes128cbc(
pbkdf2_iterations: u16,
pbkdf2_salt: &'a [u8],
aes_iv: &'a [u8; 16]
) -> Result<Self, CryptoError>
[src]
pbkdf2_iterations: u16,
pbkdf2_salt: &'a [u8],
aes_iv: &'a [u8; 16]
) -> Result<Self, CryptoError>
Initialize PBES2 parameters using PBKDF2-SHA256 as the password-based key derivation algorithm and AES-128-CBC as the symmetric cipher.
pub fn pbkdf2_sha256_aes256cbc(
pbkdf2_iterations: u16,
pbkdf2_salt: &'a [u8],
aes_iv: &'a [u8; 16]
) -> Result<Self, CryptoError>
[src]
pbkdf2_iterations: u16,
pbkdf2_salt: &'a [u8],
aes_iv: &'a [u8; 16]
) -> Result<Self, CryptoError>
Initialize PBES2 parameters using PBKDF2-SHA256 as the password-based key derivation algorithm and AES-128-CBC as the symmetric cipher.
pub fn decrypt(
&self,
password: impl AsRef<[u8]>,
ciphertext: &[u8]
) -> Result<Vec<u8>, CryptoError>
[src]
&self,
password: impl AsRef<[u8]>,
ciphertext: &[u8]
) -> Result<Vec<u8>, CryptoError>
alloc
and pbes2
only.Attempt to decrypt the given ciphertext, allocating and returning a byte vector containing the plaintext.
pub fn decrypt_in_place<'b>(
&self,
password: impl AsRef<[u8]>,
buffer: &'b mut [u8]
) -> Result<&'b [u8], CryptoError>
[src]
&self,
password: impl AsRef<[u8]>,
buffer: &'b mut [u8]
) -> Result<&'b [u8], CryptoError>
pbes2
only.Attempt to decrypt the given ciphertext in-place using a key derived from the provided password and this scheme’s parameters.
Returns an error if the algorithm specified in this scheme’s parameters is unsupported, or if the ciphertext is malformed (e.g. not a multiple of a block mode’s padding)
pub fn encrypt(
&self,
password: impl AsRef<[u8]>,
plaintext: &[u8]
) -> Result<Vec<u8>, CryptoError>
[src]
&self,
password: impl AsRef<[u8]>,
plaintext: &[u8]
) -> Result<Vec<u8>, CryptoError>
alloc
and pbes2
only.Encrypt the given plaintext, allocating and returning a vector containing the ciphertext.
pub fn encrypt_in_place<'b>(
&self,
password: impl AsRef<[u8]>,
buffer: &'b mut [u8],
pos: usize
) -> Result<&'b [u8], CryptoError>
[src]
&self,
password: impl AsRef<[u8]>,
buffer: &'b mut [u8],
pos: usize
) -> Result<&'b [u8], CryptoError>
pbes2
only.Encrypt the given plaintext in-place using a key derived from the provided password and this scheme’s parameters, writing the ciphertext into the same buffer.
Trait Implementations
impl<'a> Clone for Parameters<'a>
[src]
impl<'a> Clone for Parameters<'a>
[src]fn clone(&self) -> Parameters<'a>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Eq for Parameters<'a>
[src]
impl<'a> Eq for Parameters<'a>
[src]impl<'a> From<Parameters<'a>> for EncryptionScheme<'a>
[src]
impl<'a> From<Parameters<'a>> for EncryptionScheme<'a>
[src]fn from(params: Parameters<'a>) -> EncryptionScheme<'a>
[src]
impl<'a> Message<'a> for Parameters<'a>
[src]
impl<'a> Message<'a> for Parameters<'a>
[src]impl<'a> PartialEq<Parameters<'a>> for Parameters<'a>
[src]
impl<'a> PartialEq<Parameters<'a>> for Parameters<'a>
[src]fn eq(&self, other: &Parameters<'a>) -> bool
[src]
fn ne(&self, other: &Parameters<'a>) -> bool
[src]
impl<'a> StructuralEq for Parameters<'a>
[src]
impl<'a> StructuralEq for Parameters<'a>
[src]impl<'a> StructuralPartialEq for Parameters<'a>
[src]
impl<'a> StructuralPartialEq for Parameters<'a>
[src]Auto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> Choice<'a> for T where
T: Decodable<'a> + Encodable + Tagged,
[src]
impl<'a, T> Choice<'a> for T where
T: Decodable<'a> + Encodable + Tagged,
[src]pub fn can_decode(tag: Tag) -> bool
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
The resulting type after obtaining ownership.