#include <SymmetricCipher.h>
◆ SymmetricCipher() [1/2]
Aws::Crt::Crypto::SymmetricCipher::SymmetricCipher |
( |
const SymmetricCipher & |
| ) |
|
|
delete |
◆ SymmetricCipher() [2/2]
◆ CreateAES_256_CBC_Cipher()
Creates an AES 256 CBC mode cipher using a provided key and iv. Key must be 32 bytes. If key or iv are not provided, they will be generated.
◆ CreateAES_256_CTR_Cipher()
Creates an AES 256 CTR mode cipher using a provided key and iv. If key and iv are not provided, they will be generated.
◆ CreateAES_256_GCM_Cipher()
Creates an AES 256 GCM mode cipher using a provided key, iv, tag, and aad if provided. Key and iv will be generated if not provided. AAD values are not generated. Provide AAD if you need to provide additional auth info.
◆ CreateAES_256_KeyWrap_Cipher()
Creates an AES 256 Keywrap mode cipher using key if provided. If a key is not provided, one will be generated.
◆ Decrypt()
bool Aws::Crt::Crypto::SymmetricCipher::Decrypt |
( |
const ByteCursor & |
toDecrypt, |
|
|
ByteBuf & |
out |
|
) |
| |
|
noexcept |
Decrypts the value in toEncrypt and stores any immediate results in out. Out can be dynamically re-sized if out is a dynamic byte buf. Otherwise, make sure the size of out is at least 1 block larger than the input to allow for padding. Returns true on success. Call LastError() for the reason this call failed.
◆ Encrypt()
bool Aws::Crt::Crypto::SymmetricCipher::Encrypt |
( |
const ByteCursor & |
toEncrypt, |
|
|
ByteBuf & |
out |
|
) |
| |
|
noexcept |
Encrypts the value in toEncrypt and stores any immediate results in out. Out can be dynamically re-sized if out is a dynamic byte buf. Otherwise, make sure the size of out is at least 2 blocks larger than the input to allow for padding.
Returns true on success. Call LastError() for the reason this call failed.
◆ FinalizeDecryption()
bool Aws::Crt::Crypto::SymmetricCipher::FinalizeDecryption |
( |
ByteBuf & |
out | ) |
|
|
noexcept |
Decrypts any remaining data on the cipher and stores the output in out. Out can be dynamically re-sized if out is a dynamic byte buf. Otherwise, make sure the size of out is at least 2 blocks for CBC, CTR, GCM, and Keywrap modes.
Returns true on success. Call LastError() for the reason this call failed.
◆ FinalizeEncryption()
bool Aws::Crt::Crypto::SymmetricCipher::FinalizeEncryption |
( |
ByteBuf & |
out | ) |
|
|
noexcept |
Encrypts any remaining data on the cipher and stores the output in out. Out can be dynamically re-sized if out is a dynamic byte buf. Otherwise, make sure the size of out is at least 2 blocks for CBC, CTR, and GCM modes and 40 bytes for KeyWrap.
Returns true on success. Call LastError() for the reason this call failed.
◆ GetIV()
ByteCursor Aws::Crt::Crypto::SymmetricCipher::GetIV |
( |
| ) |
const |
|
noexcept |
Returns the initialization vector used for this cipher. This IV is not copied from the cipher so do not mutate this data. Copy if you need to pass it around anywhere.
◆ GetKey()
ByteCursor Aws::Crt::Crypto::SymmetricCipher::GetKey |
( |
| ) |
const |
|
noexcept |
Returns the key used for this cipher. This key is not copied from the cipher so do not mutate this data. Copy if you need to pass it around anywhere.
◆ GetState()
Returns current state of the cipher instance. ready to be used, finalized, or in a error state. If the cipher is in a finalized or error state it may not be used anymore
◆ GetTag()
ByteCursor Aws::Crt::Crypto::SymmetricCipher::GetTag |
( |
| ) |
const |
|
noexcept |
Returns the encryption tag generated during encryption operations for this cipher in GCM mode. This tag is not copied from the cipher so do not mutate this data. Copy if you need to pass it around anywhere.
◆ LastError()
int Aws::Crt::Crypto::SymmetricCipher::LastError |
( |
| ) |
const |
|
inlinenoexcept |
Returns the value of the last aws error encountered by operations on this instance.
◆ operator bool()
Aws::Crt::Crypto::SymmetricCipher::operator bool |
( |
| ) |
const |
|
noexcept |
Returns true if the instance is in a valid state, false otherwise.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ Reset()
bool Aws::Crt::Crypto::SymmetricCipher::Reset |
( |
| ) |
|
|
noexcept |
Reset to cipher to new state.
◆ SetTag()
void Aws::Crt::Crypto::SymmetricCipher::SetTag |
( |
ByteCursor |
tag | ) |
const |
|
noexcept |
Sets the tag used during decryption operations for this cipher in GCM mode. No-op outside of GCM mode. In GCM mode, encrypt operation overrides the value of the tag.
The documentation for this class was generated from the following files: