#[non_exhaustive]pub enum EncryptionScheme {
Aes128Cbc {
iv: [u8; 16],
},
Aes192Cbc {
iv: [u8; 16],
},
Aes256Cbc {
iv: [u8; 16],
},
Aes128Gcm {
nonce: [u8; 12],
},
Aes256Gcm {
nonce: [u8; 12],
},
}Expand description
Symmetric encryption scheme used by PBES2.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Aes128Cbc
AES-128 in CBC mode
Aes192Cbc
AES-192 in CBC mode
Aes256Cbc
AES-256 in CBC mode
Aes128Gcm
AES-128 in CBC mode
Aes256Gcm
AES-256 in GCM mode
Implementations§
Source§impl EncryptionScheme
impl EncryptionScheme
Sourcepub fn oid(&self) -> ObjectIdentifier
pub fn oid(&self) -> ObjectIdentifier
Get the ObjectIdentifier (a.k.a OID) for this algorithm.
Sourcepub fn to_alg_params_invalid(&self) -> Error
pub fn to_alg_params_invalid(&self) -> Error
Convenience function to turn the OID (see oid)
of this EncryptionScheme into error case
Error::AlgorithmParametersInvalid
Trait Implementations§
Source§impl Clone for EncryptionScheme
impl Clone for EncryptionScheme
impl Copy for EncryptionScheme
Source§impl Debug for EncryptionScheme
impl Debug for EncryptionScheme
Source§impl<'a> Decode<'a> for EncryptionScheme
impl<'a> Decode<'a> for EncryptionScheme
Source§impl Encode for EncryptionScheme
impl Encode for EncryptionScheme
Source§fn encoded_len(&self) -> Result<Length>
fn encoded_len(&self) -> Result<Length>
Compute the length of this TLV object in bytes when encoded as ASN.1 DER. Read more
Source§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Encode this TLV object to the provided byte slice, returning a sub-slice
containing the encoded message. Read more
impl Eq for EncryptionScheme
Source§impl PartialEq for EncryptionScheme
impl PartialEq for EncryptionScheme
impl StructuralPartialEq for EncryptionScheme
Source§impl<'a> TryFrom<&'a EncryptionScheme> for AlgorithmIdentifierRef<'a>
impl<'a> TryFrom<&'a EncryptionScheme> for AlgorithmIdentifierRef<'a>
Source§impl TryFrom<AlgorithmIdentifier<AnyRef<'_>>> for EncryptionScheme
impl TryFrom<AlgorithmIdentifier<AnyRef<'_>>> for EncryptionScheme
Auto Trait Implementations§
impl Freeze for EncryptionScheme
impl RefUnwindSafe for EncryptionScheme
impl Send for EncryptionScheme
impl Sync for EncryptionScheme
impl Unpin for EncryptionScheme
impl UnsafeUnpin for EncryptionScheme
impl UnwindSafe for EncryptionScheme
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more