pub struct DecryptingKey {
algorithm: &'static Algorithm,
key: SymmetricCipherKey,
mode: OperatingMode,
}Expand description
A cipher decryption key that does not perform block padding.
Fields§
§algorithm: &'static Algorithm§key: SymmetricCipherKey§mode: OperatingModeImplementations§
Source§impl DecryptingKey
impl DecryptingKey
Sourcepub fn ctr(key: UnboundCipherKey) -> Result<DecryptingKey, Unspecified>
pub fn ctr(key: UnboundCipherKey) -> Result<DecryptingKey, Unspecified>
Constructs a cipher decrypting key operating in counter (CTR) mode using the provided key and context.
§Errors
Unspecified: Returned if there is an error during decryption.
Sourcepub fn cfb128(key: UnboundCipherKey) -> Result<Self, Unspecified>
pub fn cfb128(key: UnboundCipherKey) -> Result<Self, Unspecified>
Constructs a cipher decrypting key operating in cipher feedback 128-bit mode (CFB128) using the provided key and context.
§Errors
Unspecified: Returned if there is an error during decryption.
Sourcepub fn cbc(key: UnboundCipherKey) -> Result<DecryptingKey, Unspecified>
pub fn cbc(key: UnboundCipherKey) -> Result<DecryptingKey, Unspecified>
Constructs an DecryptingKey operating in cipher block chaining (CBC) mode using the provided key and context.
§☠️ ️️️DANGER ☠️
Offered for compatibility 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 during decryption.
Sourcepub fn ecb(key: UnboundCipherKey) -> Result<Self, Unspecified>
pub fn ecb(key: UnboundCipherKey) -> Result<Self, Unspecified>
Constructs an DecryptingKey operating in electronic code book (ECB) mode using the provided key.
§☠️ ️️️DANGER ☠️
Offered for compatibility 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 theDecryptingKey.
fn new(key: UnboundCipherKey, mode: OperatingMode) -> Result<Self, Unspecified>
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 the data provided in in_out in-place.
Returns a references to the decrypted data.
If DecryptingKey is operating in OperatingMode::ECB, then in_out.len() must be a multiple
of the block length.
§Errors
Unspecified: Returned if cipher mode requires input to be a multiple of the block length, andin_out.len()is not. Also returned if decryption fails.