7#include <aws/s3-encryption/s3Encryption_EXPORTS.h>
8#include <aws/core/utils/crypto/ContentCryptoMaterial.h>
9#include <aws/core/utils/crypto/Cipher.h>
10#include <aws/core/utils/crypto/EncryptionMaterials.h>
11#include <aws/s3-encryption/CryptoConfiguration.h>
12#include <aws/s3-encryption/handlers/DataHandler.h>
13#include <aws/s3-encryption/handlers/InstructionFileHandler.h>
14#include <aws/s3-encryption/handlers/MetadataHandler.h>
15#include <aws/core/auth/AWSCredentialsProvider.h>
16#include <aws/s3/S3Client.h>
17#include <aws/s3-encryption/S3EncryptionClient.h>
18#include <aws/s3/model/PutObjectRequest.h>
19#include <aws/s3/model/PutObjectResult.h>
20#include <aws/s3/model/GetObjectResult.h>
21#include <aws/s3/model/GetObjectRequest.h>
22#include <aws/s3/model/HeadObjectRequest.h>
26 namespace S3Encryption
114 std::shared_ptr<Aws::Utils::Crypto::SymmetricCipher>
m_cipher;
134 void PopulateCryptoContentMaterial()
override;
139 void InitEncryptionCipher()
override;
154 virtual bool DecryptionConditionCheck(
const Aws::String& requestRange)
override;
178 void PopulateCryptoContentMaterial()
override;
183 void InitEncryptionCipher()
override;
198 virtual bool DecryptionConditionCheck(
const Aws::String& requestRange)
override;
222 void PopulateCryptoContentMaterial()
override;
227 void InitEncryptionCipher()
override;
242 virtual bool DecryptionConditionCheck(
const Aws::String& requestRange)
override;
262 operator bool()
const override;
291 std::shared_ptr<Aws::Utils::Crypto::SymmetricCipher> m_cipher;
AES_GCM_AppendedTag(const Aws::Utils::CryptoBuffer &key)
Aws::Utils::CryptoBuffer DecryptBuffer(const Aws::Utils::CryptoBuffer &unEncryptedData) override
Aws::Utils::CryptoBuffer FinalizeEncryption() override
Aws::Utils::CryptoBuffer EncryptBuffer(const Aws::Utils::CryptoBuffer &unEncryptedData) override
Aws::Utils::CryptoBuffer FinalizeDecryption() override
CryptoModuleAE(const std::shared_ptr< Aws::Utils::Crypto::EncryptionMaterials > &encryptionMaterials, const CryptoConfiguration &cryptoConfig)
CryptoModuleEO(const std::shared_ptr< Aws::Utils::Crypto::EncryptionMaterials > &encryptionMaterials, const CryptoConfiguration &cryptoConfig)
virtual Aws::Utils::CryptoBuffer GetTag(const Aws::S3::Model::GetObjectRequest &request, const std::function< Aws::S3::Model::GetObjectOutcome(const Aws::S3::Model::GetObjectRequest &) > &getObjectFunction)=0
virtual void PopulateCryptoContentMaterial()=0
S3EncryptionPutObjectOutcome PutObjectSecurely(const Aws::S3::Model::PutObjectRequest &request, const PutObjectFunction &putObjectFunction, const Aws::Map< Aws::String, Aws::String > &contextMap={})
virtual bool DecryptionConditionCheck(const Aws::String &requestRange)=0
S3EncryptionGetObjectOutcome GetObjectSecurely(const Aws::S3::Model::GetObjectRequest &request, const Aws::S3::Model::HeadObjectResult &headObjectResult, const Aws::Utils::Crypto::ContentCryptoMaterial &contentCryptoMaterial, const GetObjectFunction &getObjectFunction)
virtual void InitDecryptionCipher(int64_t rangeStart=0, int64_t rangeEnd=0, const Aws::Utils::CryptoBuffer &tag=Aws::Utils::CryptoBuffer())=0
virtual ~CryptoModule()=default
std::shared_ptr< Aws::Utils::Crypto::EncryptionMaterials > m_encryptionMaterials
virtual void SetContentLength(Aws::S3::Model::PutObjectRequest &request)=0
CryptoModule(const std::shared_ptr< Aws::Utils::Crypto::EncryptionMaterials > &encryptionMaterials, const CryptoConfiguration &cryptoConfig)
static std::pair< int64_t, int64_t > ParseGetObjectRequestRange(const Aws::String &range, int64_t contentLength)
CryptoConfiguration m_cryptoConfig
virtual std::pair< int64_t, int64_t > AdjustRange(Aws::S3::Model::GetObjectRequest &getObjectRequest, const Aws::S3::Model::HeadObjectResult &headObjectResult)=0
std::shared_ptr< Aws::Utils::Crypto::SymmetricCipher > m_cipher
virtual void InitEncryptionCipher()=0
Aws::Utils::Crypto::ContentCryptoMaterial m_contentCryptoMaterial
CryptoModuleStrictAE(const std::shared_ptr< Aws::Utils::Crypto::EncryptionMaterials > &encryptionMaterials, const CryptoConfiguration &cryptoConfig)
Aws::Utils::Outcome< GetObjectResult, S3Error > GetObjectOutcome
Aws::Utils::Outcome< PutObjectResult, S3Error > PutObjectOutcome
std::function< Aws::S3::Model::PutObjectOutcome(const Aws::S3::Model::PutObjectRequest &)> PutObjectFunction
std::function< Aws::S3::Model::GetObjectOutcome(const Aws::S3::Model::GetObjectRequest &)> GetObjectFunction
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