AWS SDK for C++

AWS SDK for C++ Version 1.11.440

Loading...
Searching...
No Matches
CryptoModuleFactory.h
1
5#pragma once
6
7#include <aws/core/Aws.h>
8#include <aws/core/auth/AWSCredentialsProvider.h>
9#include <aws/core/utils/crypto/EncryptionMaterials.h>
10#include <aws/s3-encryption/s3Encryption_EXPORTS.h>
11#include <aws/s3-encryption/CryptoConfiguration.h>
12
13namespace Aws
14{
15 namespace S3Encryption
16 {
17 namespace Modules
18 {
19 class CryptoModule;
20 /*
21 * This class is an abstract class for the crypto module factories.
22 */
23 class AWS_S3ENCRYPTION_API CryptoModuleAbstractFactory
24 {
25 public:
26 virtual ~CryptoModuleAbstractFactory() = default;
27
28 /*
29 * Override this method to create a specific crypto module.
30 */
31 virtual std::shared_ptr<CryptoModule> CreateModule(const std::shared_ptr<Aws::Utils::Crypto::EncryptionMaterials>& encryptionMaterials, const CryptoConfiguration& cryptoConfig) = 0;
32
33 /*
34 * Returns the crypto mode each sub class handles.
35 */
36 virtual CryptoMode HandlesMode() const = 0;
37 };
38
39 /*
40 * This class will be responsible for the functionality for fetching a crypto module using the map of crypto
41 * module factories. It will take parameters, crypto configuration, encryption materials, and credentials provider in
42 * or to create an appropriate crypto module.
43 */
44 class AWS_S3ENCRYPTION_API CryptoModuleFactory
45 {
46 public:
47 /*
48 * Default Constructor. Populates map with Crypto Modules Factories and their CryptoModes.
49 */
51
52 /*
53 * Determines which module to use and returns a specific factory for that module.
54 */
55 std::shared_ptr<CryptoModule> FetchCryptoModule(const std::shared_ptr<Aws::Utils::Crypto::EncryptionMaterials>& encryptionMaterials, const CryptoConfiguration& cryptoConfig) const;
56
57 private:
59 };
60
61 /*
62 * This class is responsible for creating or returning an existing encryption only crypto module.
63 * This module will be created with the encryption materials, crypto configuration, and AWS credentials
64 * provider.
65 */
66 class AWS_S3ENCRYPTION_API CryptoModuleFactoryEO : public CryptoModuleAbstractFactory
67 {
68 public:
69 /*
70 * Default Constructor.
71 */
73
74 /*
75 * Creates a encryption only crypto module or returns an existing one using
76 * the encryption materials, crypto configuration, and AWS credentials provider.
77 */
78 std::shared_ptr<CryptoModule> CreateModule(const std::shared_ptr<Aws::Utils::Crypto::EncryptionMaterials>& encryptionMaterials, const CryptoConfiguration& cryptoConfig) override;
79
80 CryptoMode HandlesMode() const override;
81 };
82
83 /*
84 * This class is responsible for creating or returning an existing authenticated encryption crypto module.
85 * This module will be created with the encryption materials, crypto configuration, and AWS credentials
86 * provider.
87 */
88 class AWS_S3ENCRYPTION_API CryptoModuleFactoryAE : public CryptoModuleAbstractFactory
89 {
90 public:
91 /*
92 * Default Constructor.
93 */
95
96 /*
97 * Creates a authenticated encryption crypto module or returns an existing one using
98 * the encryption materials, crypto configuration, and AWS credentials provider.
99 */
100 std::shared_ptr<CryptoModule> CreateModule(const std::shared_ptr<Aws::Utils::Crypto::EncryptionMaterials>& encryptionMaterials, const CryptoConfiguration& cryptoConfig) override;
101
102 CryptoMode HandlesMode() const override;
103 };
104
105 /*
106 * This class is responsible for creating or returning an existing strict authenticated encryption crypto module.
107 * This module will be created with the encryption materials, crypto configuration, and AWS credentials
108 * provider.
109 */
111 {
112 public:
113 /*
114 * Default Constructor.
115 */
117
118 /*
119 * Creates a strict authenticated encryption crypto module or returns an existing one using
120 * the encryption materials, crypto configuration, and AWS credentials provider.
121 */
122 std::shared_ptr<CryptoModule> CreateModule(const std::shared_ptr<Aws::Utils::Crypto::EncryptionMaterials>& encryptionMaterials, const CryptoConfiguration& cryptoConfig) override;
123
124 CryptoMode HandlesMode() const override;
125 };
126 }
127 }
128}
virtual std::shared_ptr< CryptoModule > CreateModule(const std::shared_ptr< Aws::Utils::Crypto::EncryptionMaterials > &encryptionMaterials, const CryptoConfiguration &cryptoConfig)=0
std::shared_ptr< CryptoModule > CreateModule(const std::shared_ptr< Aws::Utils::Crypto::EncryptionMaterials > &encryptionMaterials, const CryptoConfiguration &cryptoConfig) override
std::shared_ptr< CryptoModule > CreateModule(const std::shared_ptr< Aws::Utils::Crypto::EncryptionMaterials > &encryptionMaterials, const CryptoConfiguration &cryptoConfig) override
std::shared_ptr< CryptoModule > FetchCryptoModule(const std::shared_ptr< Aws::Utils::Crypto::EncryptionMaterials > &encryptionMaterials, const CryptoConfiguration &cryptoConfig) const
std::shared_ptr< CryptoModule > CreateModule(const std::shared_ptr< Aws::Utils::Crypto::EncryptionMaterials > &encryptionMaterials, const CryptoConfiguration &cryptoConfig) override
std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > > Map