pub struct PaddedBlockEncryptingKey { /* private fields */ }Expand description
A cipher encryption key that performs block padding.
Implementations§
Source§impl PaddedBlockEncryptingKey
impl PaddedBlockEncryptingKey
Sourcepub fn cbc_pkcs7(key: UnboundCipherKey) -> Result<Self, Unspecified>
pub fn cbc_pkcs7(key: UnboundCipherKey) -> Result<Self, Unspecified>
Constructs a new PaddedBlockEncryptingKey cipher with chaining block cipher (CBC) mode.
Plaintext data is padded following the PKCS#7 scheme.
§Errors
Unspecified: Returned if there is an error constructing aPaddedBlockEncryptingKey.
Sourcepub fn ecb_pkcs7(key: UnboundCipherKey) -> Result<Self, Unspecified>
pub fn ecb_pkcs7(key: UnboundCipherKey) -> Result<Self, Unspecified>
Constructs a new PaddedBlockEncryptingKey cipher with electronic code book (ECB) mode.
Plaintext data is padded following the PKCS#7 scheme.
§☠️ ️️️DANGER ☠️
Offered for computability purposes only. This is an extremely dangerous mode, and very likely not what you want to use.
§Errors
Unspecified: Returned if there is an error constructing aPaddedBlockEncryptingKey.
Sourcepub fn mode(&self) -> OperatingMode
pub fn mode(&self) -> OperatingMode
Returns the cipher operating mode.
Sourcepub fn encrypt<InOut>(
&self,
in_out: &mut InOut,
) -> Result<DecryptionContext, Unspecified>
pub fn encrypt<InOut>( &self, in_out: &mut InOut, ) -> Result<DecryptionContext, Unspecified>
Pads and encrypts data provided in in_out in-place.
Returns a references to the encrypted data.
§Errors
Unspecified: Returned if encryption fails.
Sourcepub fn less_safe_encrypt<InOut>(
&self,
in_out: &mut InOut,
context: EncryptionContext,
) -> Result<DecryptionContext, Unspecified>
pub fn less_safe_encrypt<InOut>( &self, in_out: &mut InOut, context: EncryptionContext, ) -> Result<DecryptionContext, Unspecified>
Pads and encrypts data provided in in_out in-place.
Returns a references to the encryted data.
§Errors
Unspecified: Returned if encryption fails.