7#include <aws/core/Aws.h>
8#include <aws/core/Core_EXPORTS.h>
9#include <aws/core/utils/crypto/CryptoBuf.h>
10#include <aws/core/utils/crypto/ContentCryptoScheme.h>
11#include <aws/core/utils/crypto/KeyWrapAlgorithm.h>
48 return m_contentEncryptionKey;
56 return m_encryptedContentEncryptionKey;
72 return m_encryptionContext;
80 return m_keyCommitment;
96 return m_cryptoTagLength;
104 return m_materialsDescription;
112 return m_materialsDescription.at(key);
120 return m_keyWrapAlgorithm;
128 return m_contentCryptoScheme;
136 m_contentEncryptionKey = contentEncryptionKey;
144 m_encryptedContentEncryptionKey = encryptedContentEncryptionKey;
163 unsigned char iv[12] = {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
173 m_encryptionContext = encryptionContext;
181 m_keyCommitment = keyCommitment;
189 m_messageId = messageId;
197 m_cryptoTagLength = cryptoTagLength;
205 m_materialsDescription[key] = value;
213 m_materialsDescription = materialsDescription;
221 m_keyWrapAlgorithm = keyWrapAlgorithm;
229 m_contentCryptoScheme = contentCryptoScheme;
282 m_finalCEK = finalCEK;
301 if (m_contentCryptoScheme == ContentCryptoScheme::GCM_COMMIT) {
303 static const uint8_t gcmAAD[2] = {0, 0x73};
310 inline bool Ok()
const {
return m_error.empty();}
311 inline bool Fail()
const {
return !m_error.empty();}
328 size_t m_cryptoTagLength;
void SetKeyCommitment(const Aws::Utils::CryptoBuffer &keyCommitment)
void SetMaterialsDescription(const Aws::Map< Aws::String, Aws::String > &materialsDescription)
void AddMaterialsDescription(const Aws::String &key, const Aws::String &value)
void SetFinalCEK(const Aws::Utils::CryptoBuffer &finalCEK)
void SetGCMAAD(const Aws::Utils::CryptoBuffer &aad)
const Aws::Utils::CryptoBuffer & GetEncryptedContentEncryptionKey() const
const Aws::String & GetMaterialsDescription(const Aws::String &key) const
ContentCryptoMaterial(const char *msg)
const Aws::Utils::CryptoBuffer & GetGCMAAD() const
const Aws::Utils::CryptoBuffer & GetIV() const
void SetCekIV(const Aws::Utils::CryptoBuffer &iv)
const Aws::Utils::CryptoBuffer & GetMessageID() const
void SetCEKGCMTag(const Aws::Utils::CryptoBuffer &tag)
const Aws::Utils::CryptoBuffer & GetFinalCEK() const
const Aws::Utils::CryptoBuffer GetAAD() const
const Aws::Utils::CryptoBuffer & GetContentEncryptionKey() const
const Aws::Utils::CryptoBuffer & GetCekIV() const
void SetEncryptedContentEncryptionKey(const Aws::Utils::CryptoBuffer &encryptedContentEncryptionKey)
size_t GetCryptoTagLength() const
void SetContentCryptoScheme(ContentCryptoScheme contentCryptoScheme)
void SetContentEncryptionKey(const Aws::Utils::CryptoBuffer &contentEncryptionKey)
ContentCryptoMaterial(const Aws::Utils::CryptoBuffer &cek, ContentCryptoScheme contentCryptoScheme)
const Aws::Map< Aws::String, Aws::String > & GetMaterialsDescription() const
void SetMessageID(const Aws::Utils::CryptoBuffer &messageId)
const Aws::Map< Aws::String, Aws::String > & GetEncryptionContext() const
const Aws::String & Error() const
KeyWrapAlgorithm GetKeyWrapAlgorithm() const
ContentCryptoMaterial(ContentCryptoScheme contentCryptoScheme)
const Aws::Utils::CryptoBuffer & GetKeyCommitment() const
ContentCryptoScheme GetContentCryptoScheme() const
void SetIV(const Aws::Utils::CryptoBuffer &iv)
void SetCryptoTagLength(size_t cryptoTagLength)
void SetKeyWrapAlgorithm(KeyWrapAlgorithm keyWrapAlgorithm)
void SetEncryptionContext(const Aws::Map< Aws::String, Aws::String > &encryptionContext)
const Aws::Utils::CryptoBuffer & GetCEKGCMTag() const
std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > > Map
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String