AWS SDK for C++  1.9.161
AWS SDK for C++
Public Member Functions | Protected Member Functions | List of all members
Aws::Utils::Crypto::AES_GCM_Cipher_OpenSSL Class Reference

#include <CryptoImpl.h>

+ Inheritance diagram for Aws::Utils::Crypto::AES_GCM_Cipher_OpenSSL:

Public Member Functions

 AES_GCM_Cipher_OpenSSL (const CryptoBuffer &key)
 
 AES_GCM_Cipher_OpenSSL (const CryptoBuffer &key, const CryptoBuffer *aad)
 
 AES_GCM_Cipher_OpenSSL (CryptoBuffer &&key, CryptoBuffer &&initializationVector, CryptoBuffer &&tag=CryptoBuffer(0), CryptoBuffer &&aad=CryptoBuffer(0))
 
 AES_GCM_Cipher_OpenSSL (const CryptoBuffer &key, const CryptoBuffer &initializationVector, const CryptoBuffer &tag=CryptoBuffer(0), const CryptoBuffer &aad=CryptoBuffer(0))
 
 AES_GCM_Cipher_OpenSSL (const AES_GCM_Cipher_OpenSSL &other)=delete
 
AES_GCM_Cipher_OpenSSLoperator= (const AES_GCM_Cipher_OpenSSL &other)=delete
 
 AES_GCM_Cipher_OpenSSL (AES_GCM_Cipher_OpenSSL &&toMove)=default
 
CryptoBuffer FinalizeEncryption () override
 
void Reset () override
 
- Public Member Functions inherited from Aws::Utils::Crypto::OpenSSLCipher
 OpenSSLCipher (const CryptoBuffer &key, size_t ivSize, bool ctrMode=false)
 
 OpenSSLCipher (CryptoBuffer &&key, CryptoBuffer &&initializationVector, CryptoBuffer &&tag=CryptoBuffer(0))
 
 OpenSSLCipher (const CryptoBuffer &key, const CryptoBuffer &initializationVector, const CryptoBuffer &tag=CryptoBuffer(0))
 
 OpenSSLCipher (const OpenSSLCipher &other)=delete
 
OpenSSLCipheroperator= (const OpenSSLCipher &other)=delete
 
 OpenSSLCipher (OpenSSLCipher &&toMove)
 
OpenSSLCipheroperator= (OpenSSLCipher &&toMove)=default
 
virtual ~OpenSSLCipher ()
 
CryptoBuffer EncryptBuffer (const CryptoBuffer &unEncryptedData) override
 
CryptoBuffer DecryptBuffer (const CryptoBuffer &encryptedData) override
 
CryptoBuffer FinalizeDecryption () override
 
- Public Member Functions inherited from Aws::Utils::Crypto::SymmetricCipher
 SymmetricCipher (const CryptoBuffer &key, size_t ivSize, bool ivGenerationInCtrMode=false)
 
 SymmetricCipher (const CryptoBuffer &key, const CryptoBuffer &initializationVector, const CryptoBuffer &tag=CryptoBuffer(0))
 
 SymmetricCipher (CryptoBuffer &&key, CryptoBuffer &&initializationVector, CryptoBuffer &&tag=CryptoBuffer(0))
 
 SymmetricCipher (const SymmetricCipher &other)=delete
 
SymmetricCipheroperator= (const SymmetricCipher &other)=delete
 
 SymmetricCipher (SymmetricCipher &&toMove)
 
SymmetricCipheroperator= (SymmetricCipher &&toMove)
 
virtual ~SymmetricCipher ()=default
 
virtual operator bool () const
 
const CryptoBufferGetIV () const
 
const CryptoBufferGetTag () const
 
bool Fail () const
 
bool Good () const
 

Protected Member Functions

size_t GetBlockSizeBytes () const override
 
size_t GetKeyLengthBits () const override
 
size_t GetTagLengthBytes () const
 
- Protected Member Functions inherited from Aws::Utils::Crypto::OpenSSLCipher
bool CheckKeyAndIVLength (size_t expectedKeyLength, size_t expectedIVLength)
 
- Protected Member Functions inherited from Aws::Utils::Crypto::SymmetricCipher
 SymmetricCipher ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Aws::Utils::Crypto::SymmetricCipher
static CryptoBuffer GenerateIV (size_t ivLengthBytes, bool ctrMode=false)
 
static CryptoBuffer GenerateKey (size_t keyLengthBytes=SYMMETRIC_KEY_LENGTH)
 
- Protected Attributes inherited from Aws::Utils::Crypto::OpenSSLCipher
EVP_CIPHER_CTX * m_encryptor_ctx
 
EVP_CIPHER_CTX * m_decryptor_ctx
 
- Protected Attributes inherited from Aws::Utils::Crypto::SymmetricCipher
CryptoBuffer m_key
 
CryptoBuffer m_initializationVector
 
CryptoBuffer m_tag
 
bool m_failure
 

Detailed Description

OpenSSL implementation for AES in GCM mode

Definition at line 279 of file CryptoImpl.h.

Constructor & Destructor Documentation

◆ AES_GCM_Cipher_OpenSSL() [1/6]

Aws::Utils::Crypto::AES_GCM_Cipher_OpenSSL::AES_GCM_Cipher_OpenSSL ( const CryptoBuffer key)

Create AES in GCM mode off of a 256 bit key. Auto Generates a 12 byte secure random IV.

◆ AES_GCM_Cipher_OpenSSL() [2/6]

Aws::Utils::Crypto::AES_GCM_Cipher_OpenSSL::AES_GCM_Cipher_OpenSSL ( const CryptoBuffer key,
const CryptoBuffer aad 
)

Create AES in GCM mode off of a 256 bit key and AAD. Auto Generates a 12 byte IV in the format

◆ AES_GCM_Cipher_OpenSSL() [3/6]

Aws::Utils::Crypto::AES_GCM_Cipher_OpenSSL::AES_GCM_Cipher_OpenSSL ( CryptoBuffer &&  key,
CryptoBuffer &&  initializationVector,
CryptoBuffer &&  tag = CryptoBuffer(0),
CryptoBuffer &&  aad = CryptoBuffer(0) 
)

Create AES in GCM mode off of a 256 bit key, a 12 byte secure random IV, and an optional 16 byte Tag and additional authentication data (AAD). Note that tag could be acquired from encrypt mode and should only be set for decrypt mode. If you are using this cipher to decrypt an encrypted payload, you must set the tag here.

◆ AES_GCM_Cipher_OpenSSL() [4/6]

Aws::Utils::Crypto::AES_GCM_Cipher_OpenSSL::AES_GCM_Cipher_OpenSSL ( const CryptoBuffer key,
const CryptoBuffer initializationVector,
const CryptoBuffer tag = CryptoBuffer(0),
const CryptoBuffer aad = CryptoBuffer(0) 
)

Create AES in GCM mode off of a 256 bit key, a 12 byte secure random IV, and an optional 16 byte Tag and additional authentication data (AAD). Note that tag could be acquired from encrypt mode and should only be set for decrypt mode. If you are using this cipher to decrypt an encrypted payload, you must set the tag here.

◆ AES_GCM_Cipher_OpenSSL() [5/6]

Aws::Utils::Crypto::AES_GCM_Cipher_OpenSSL::AES_GCM_Cipher_OpenSSL ( const AES_GCM_Cipher_OpenSSL other)
delete

◆ AES_GCM_Cipher_OpenSSL() [6/6]

Aws::Utils::Crypto::AES_GCM_Cipher_OpenSSL::AES_GCM_Cipher_OpenSSL ( AES_GCM_Cipher_OpenSSL &&  toMove)
default

Member Function Documentation

◆ FinalizeEncryption()

CryptoBuffer Aws::Utils::Crypto::AES_GCM_Cipher_OpenSSL::FinalizeEncryption ( )
overridevirtual

Calls base class first, then grabs the tag from the cipher and sets it on m_tag. After calling FinalizeEncryption, be sure to call GetTag() and do something with it or you will not be able to decrypt the payload.

Reimplemented from Aws::Utils::Crypto::OpenSSLCipher.

◆ GetBlockSizeBytes()

size_t Aws::Utils::Crypto::AES_GCM_Cipher_OpenSSL::GetBlockSizeBytes ( ) const
overrideprotectedvirtual

◆ GetKeyLengthBits()

size_t Aws::Utils::Crypto::AES_GCM_Cipher_OpenSSL::GetKeyLengthBits ( ) const
overrideprotectedvirtual

◆ GetTagLengthBytes()

size_t Aws::Utils::Crypto::AES_GCM_Cipher_OpenSSL::GetTagLengthBytes ( ) const
protected

◆ operator=()

AES_GCM_Cipher_OpenSSL& Aws::Utils::Crypto::AES_GCM_Cipher_OpenSSL::operator= ( const AES_GCM_Cipher_OpenSSL other)
delete

◆ Reset()

void Aws::Utils::Crypto::AES_GCM_Cipher_OpenSSL::Reset ( )
overridevirtual

Reimplemented from Aws::Utils::Crypto::OpenSSLCipher.


The documentation for this class was generated from the following file: