pub struct PaddedBlockDecryptingKey { /* private fields */ }
Expand description
A cipher decryption key that performs block padding.
Implementations§
Source§impl PaddedBlockDecryptingKey
impl PaddedBlockDecryptingKey
Sourcepub fn cbc_pkcs7(key: UnboundCipherKey) -> Result<Self, Unspecified>
pub fn cbc_pkcs7(key: UnboundCipherKey) -> Result<Self, Unspecified>
Constructs a new PaddedBlockDecryptingKey
cipher with chaining block cipher (CBC) mode.
Decrypted data is unpadded following the PKCS#7 scheme.
§Errors
Unspecified
: Returned if there is an error constructing thePaddedBlockDecryptingKey
.
Sourcepub fn cbc_iso10126(key: UnboundCipherKey) -> Result<Self, Unspecified>
pub fn cbc_iso10126(key: UnboundCipherKey) -> Result<Self, Unspecified>
Constructs a new PaddedBlockDecryptingKey
cipher with chaining block cipher (CBC) mode.
Decrypted data is unpadded following the ISO 10126 scheme
(compatible with PKCS#7 and ANSI X.923).
Offered for computability purposes only.
§Errors
Unspecified
: Returned if there is an error constructing thePaddedBlockDecryptingKey
.
Sourcepub fn ecb_pkcs7(key: UnboundCipherKey) -> Result<Self, Unspecified>
pub fn ecb_pkcs7(key: UnboundCipherKey) -> Result<Self, Unspecified>
Constructs a new PaddedBlockDecryptingKey
cipher with electronic code book (ECB) mode.
Decrypted data is unpadded 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 thePaddedBlockDecryptingKey
.
Sourcepub fn mode(&self) -> OperatingMode
pub fn mode(&self) -> OperatingMode
Returns the cipher operating mode.
Sourcepub fn decrypt<'in_out>(
&self,
in_out: &'in_out mut [u8],
context: DecryptionContext,
) -> Result<&'in_out mut [u8], Unspecified>
pub fn decrypt<'in_out>( &self, in_out: &'in_out mut [u8], context: DecryptionContext, ) -> Result<&'in_out mut [u8], Unspecified>
Decrypts and unpads data provided in in_out
in-place.
Returns a references to the decrypted data.
§Errors
Unspecified
: Returned if decryption fails.