AWS SDK for C++

AWS SDK for C++ Version 1.11.440

Loading...
Searching...
No Matches
DataHandler.h
1
5#pragma once
6#include <aws/core/Aws.h>
7#include <aws/core/utils/crypto/ContentCryptoMaterial.h>
8#include <aws/s3-encryption/s3Encryption_EXPORTS.h>
9#include <aws/s3/model/GetObjectResult.h>
10#include <aws/s3/model/PutObjectRequest.h>
11#include <aws/s3/model/HeadObjectResult.h>
12
13namespace Aws
14{
15 namespace S3Encryption
16 {
17 static const char* const MetadataHandler_Tag = "MetadataHandler";
18 static const char* const DEPRECATED_CONTENT_KEY_HEADER = "x-amz-key";
19 static const char* const CONTENT_KEY_HEADER = "x-amz-key-v2";
20 static const char* const IV_HEADER = "x-amz-iv";
21 static const char* const MATERIALS_DESCRIPTION_HEADER = "x-amz-matdesc";
22 static const char* const CONTENT_CRYPTO_SCHEME_HEADER = "x-amz-cek-alg";
23 static const char* const CRYPTO_TAG_LENGTH_HEADER = "x-amz-tag-len";
24 static const char* const KEY_WRAP_ALGORITHM = "x-amz-wrap-alg";
25 static const char* const INSTRUCTION_FILE_HEADER = "x-amz-crypto-instr-file";
26 static const size_t AES_GCM_IV_BYTES = 12;
27 static const size_t AES_GCM_KEY_BYTES = 32;
28 static const size_t AES_GCM_TAG_BYTES = 16;
29 static const size_t AES_KEY_WRAP_ENCRYPTED_CEK_BYTES = 40;
30
31 namespace Handlers
32 {
33 /*
34 Data handler class will be responsible for reading and writing metadata and instruction files to and from S3 object using a Put object
35 request or a Get object result.
36 */
37 class AWS_S3ENCRYPTION_API DataHandler
38 {
39 public:
40 /*
41 Override this function to write content crypto material data to S3 object request.
42 */
43 virtual void PopulateRequest(Aws::S3::Model::PutObjectRequest& request, const Aws::Utils::Crypto::ContentCryptoMaterial& contentCryptoMaterial) = 0;
44
45 /*
46 Override this function to read data from an S3 object and return a Content Crypto Material object.
47 */
49
50 /*
51 Function to json serialize a map containing pairs of strings.
52 */
54
55 /*
56 Function to deserialize a string to map.
57 */
59
60 protected:
61 /*
62 * Function to read meta data and return a content crypto material object.
63 */
65 };
66 }
67 }
68}
virtual void PopulateRequest(Aws::S3::Model::PutObjectRequest &request, const Aws::Utils::Crypto::ContentCryptoMaterial &contentCryptoMaterial)=0
virtual Aws::Utils::Crypto::ContentCryptoMaterial ReadContentCryptoMaterial(Aws::S3::Model::GetObjectResult &result)=0
const Aws::String SerializeMap(const Aws::Map< Aws::String, Aws::String > &currentMap)
Aws::Utils::Crypto::ContentCryptoMaterial ReadMetadata(const Aws::Map< Aws::String, Aws::String > &metadata)
const Aws::Map< Aws::String, Aws::String > DeserializeMap(const Aws::String &jsonString)
static const size_t AES_GCM_IV_BYTES
Definition DataHandler.h:26
static const char *const CRYPTO_TAG_LENGTH_HEADER
Definition DataHandler.h:23
static const size_t AES_GCM_KEY_BYTES
Definition DataHandler.h:27
static const char *const IV_HEADER
Definition DataHandler.h:20
static const size_t AES_GCM_TAG_BYTES
Definition DataHandler.h:28
static const char *const MetadataHandler_Tag
Definition DataHandler.h:17
static const char *const MATERIALS_DESCRIPTION_HEADER
Definition DataHandler.h:21
static const char *const DEPRECATED_CONTENT_KEY_HEADER
Definition DataHandler.h:18
static const char *const KEY_WRAP_ALGORITHM
Definition DataHandler.h:24
static const char *const INSTRUCTION_FILE_HEADER
Definition DataHandler.h:25
static const char *const CONTENT_CRYPTO_SCHEME_HEADER
Definition DataHandler.h:22
static const size_t AES_KEY_WRAP_ENCRYPTED_CEK_BYTES
Definition DataHandler.h:29
static const char *const CONTENT_KEY_HEADER
Definition DataHandler.h:19
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