AWS SDK for C++  0.12.9
AWS SDK for C++
Factories.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #pragma once
17 
18 #include <aws/core/Core_EXPORTS.h>
19 #include <aws/core/utils/Array.h>
20 #include <memory>
21 
22 namespace Aws
23 {
24  namespace Utils
25  {
26  namespace Crypto
27  {
28  class Hash;
29  class HMAC;
30  class SymmetricCipher;
31  class HashFactory;
32  class HMACFactory;
33  class SymmetricCipherFactory;
34  class SecureRandomBytes;
35  class SecureRandomFactory;
36 
40  AWS_CORE_API void InitCrypto();
50  AWS_CORE_API void SetInitCleanupOpenSSLFlag(bool initCleanupFlag);
51 
55  AWS_CORE_API std::shared_ptr<Hash> CreateMD5Implementation();
59  AWS_CORE_API std::shared_ptr<Hash> CreateSha256Implementation();
63  AWS_CORE_API std::shared_ptr<HMAC> CreateSha256HMACImplementation();
64 
68  AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CBCImplementation(const CryptoBuffer& key);
72  AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CBCImplementation(const CryptoBuffer& key, const CryptoBuffer& iv);
76  AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CBCImplementation(CryptoBuffer&& key, CryptoBuffer&& iv);
77 
82  AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CTRImplementation(const CryptoBuffer& key);
86  AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CTRImplementation(const CryptoBuffer& key, const CryptoBuffer& iv);
90  AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CTRImplementation(CryptoBuffer&& key, CryptoBuffer&& iv);
91 
95  AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(const CryptoBuffer& key);
100  AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(const CryptoBuffer& key, const CryptoBuffer& iv,
101  const CryptoBuffer& tag = CryptoBuffer(0));
106  AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(CryptoBuffer&& key, CryptoBuffer&& iv,
107  CryptoBuffer&& tag = CryptoBuffer(0));
108 
112  AWS_CORE_API std::shared_ptr<SecureRandomBytes> CreateSecureRandomBytesImplementation();
113 
117  AWS_CORE_API void SetMD5Factory(const std::shared_ptr<HashFactory>& factory);
121  AWS_CORE_API void SetSha256Factory(const std::shared_ptr<HashFactory>& factory);
125  AWS_CORE_API void SetSha256HMACFactory(const std::shared_ptr<HMACFactory>& factory);
129  AWS_CORE_API void SetAES_CBCFactory(const std::shared_ptr<SymmetricCipherFactory>& factory);
133  AWS_CORE_API void SetAES_CTRFactory(const std::shared_ptr<SymmetricCipherFactory>& factory);
137  AWS_CORE_API void SetAES_GCMFactory(const std::shared_ptr<SymmetricCipherFactory>& factory);
141  AWS_CORE_API void SetSecureRandomFactory(const std::shared_ptr<SecureRandomFactory>& factory);
142 
143  } // namespace Crypto
144  } // namespace Utils
145 } // namespace Aws
146 
AWS_CORE_API void CleanupCrypto()
AWS_CORE_API void SetSecureRandomFactory(const std::shared_ptr< SecureRandomFactory > &factory)
AWS_CORE_API std::shared_ptr< HMAC > CreateSha256HMACImplementation()
AWS_CORE_API void SetSha256Factory(const std::shared_ptr< HashFactory > &factory)
AWS_CORE_API std::shared_ptr< SymmetricCipher > CreateAES_CBCImplementation(const CryptoBuffer &key)
AWS_CORE_API std::shared_ptr< Hash > CreateMD5Implementation()
AWS_CORE_API void SetSha256HMACFactory(const std::shared_ptr< HMACFactory > &factory)
AWS_CORE_API void SetAES_CTRFactory(const std::shared_ptr< SymmetricCipherFactory > &factory)
AWS_CORE_API void SetInitCleanupOpenSSLFlag(bool initCleanupFlag)
AWS_CORE_API std::shared_ptr< Hash > CreateSha256Implementation()
AWS_CORE_API std::shared_ptr< SymmetricCipher > CreateAES_GCMImplementation(const CryptoBuffer &key)
AWS_CORE_API std::shared_ptr< SecureRandomBytes > CreateSecureRandomBytesImplementation()
AWS_CORE_API void SetAES_GCMFactory(const std::shared_ptr< SymmetricCipherFactory > &factory)
AWS_CORE_API void SetAES_CBCFactory(const std::shared_ptr< SymmetricCipherFactory > &factory)
AWS_CORE_API void SetMD5Factory(const std::shared_ptr< HashFactory > &factory)
#define AWS_CORE_API
Definition: Core_EXPORTS.h:30
AWS_CORE_API std::shared_ptr< SymmetricCipher > CreateAES_CTRImplementation(const CryptoBuffer &key)
AWS_CORE_API void InitCrypto()
JSON (JavaScript Object Notation).