Enum pkcs5::EncryptionScheme [−][src]
Supported PKCS#5 password-based encryption schemes.
Variants (Non-exhaustive)
Pbes1(Parameters)
Password-Based Encryption Scheme 1 as defined in RFC 8018 Section 6.1.
Pbes2(Parameters<'a>)
Password-Based Encryption Scheme 2 as defined in RFC 8018 Section 6.2.
Implementations
impl<'a> EncryptionScheme<'a>
[src]
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 ciphertext in-place using a key derived from the provided password and this scheme's parameters.
pub fn oid(&self) -> ObjectIdentifier
[src]
Get the ObjectIdentifier
(a.k.a OID) for this algorithm.
pub fn pbes1(&self) -> Option<&Parameters>
[src]
Get pbes1::Parameters
if it is the selected algorithm.
pub fn pbes2(&self) -> Option<&Parameters<'a>>
[src]
Get pbes2::Parameters
if it is the selected algorithm.
Trait Implementations
impl<'a> Clone for EncryptionScheme<'a>
[src]
fn clone(&self) -> EncryptionScheme<'a>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Debug for EncryptionScheme<'a>
[src]
impl<'a> Encodable for EncryptionScheme<'a>
[src]
fn encoded_len(&self) -> Result<Length>
[src]
fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>
[src]
pub fn encode_to_slice(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
[src]
impl<'a> Eq for EncryptionScheme<'a>
[src]
impl<'a> From<Parameters<'a>> for EncryptionScheme<'a>
[src]
fn from(params: Parameters<'a>) -> EncryptionScheme<'a>
[src]
impl<'a> From<Parameters> for EncryptionScheme<'a>
[src]
fn from(params: Parameters) -> EncryptionScheme<'a>
[src]
impl<'a> PartialEq<EncryptionScheme<'a>> for EncryptionScheme<'a>
[src]
fn eq(&self, other: &EncryptionScheme<'a>) -> bool
[src]
fn ne(&self, other: &EncryptionScheme<'a>) -> bool
[src]
impl<'a> StructuralEq for EncryptionScheme<'a>
[src]
impl<'a> StructuralPartialEq for EncryptionScheme<'a>
[src]
impl<'a> TryFrom<&'a [u8]> for EncryptionScheme<'a>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &'a [u8]) -> Result<EncryptionScheme<'a>>
[src]
impl<'a> TryFrom<AlgorithmIdentifier<'a>> for EncryptionScheme<'a>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(alg: AlgorithmIdentifier<'a>) -> Result<EncryptionScheme<'_>>
[src]
impl<'a> TryFrom<Any<'a>> for EncryptionScheme<'a>
[src]
Auto Trait Implementations
impl<'a> Send for EncryptionScheme<'a>
impl<'a> Sync for EncryptionScheme<'a>
impl<'a> Unpin for EncryptionScheme<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> Decodable<'a> for T where
T: TryFrom<Any<'a>, Error = Error>,
[src]
T: TryFrom<Any<'a>, Error = Error>,
pub fn decode(decoder: &mut Decoder<'a>) -> Result<T, Error>
[src]
pub fn from_bytes(bytes: &'a [u8]) -> Result<Self, Error>
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,