AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
OpenSslKeyFactory.h
Go to the documentation of this file.
1 /*
2  * Copyright 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 #ifndef ACSDKCRYPTO_PRIVATE_OPENSSLKEYFACTORY_H_
17 #define ACSDKCRYPTO_PRIVATE_OPENSSLKEYFACTORY_H_
18 
19 #include <memory>
20 
22 
23 namespace alexaClientSDK {
24 namespace acsdkCrypto {
25 
28 
35 public:
41  static std::shared_ptr<KeyFactoryInterface> create() noexcept;
42 
45  bool generateKey(AlgorithmType type, Key& key) noexcept override;
46  bool generateIV(AlgorithmType type, IV& iv) noexcept override;
48 private:
50  OpenSslKeyFactory() noexcept;
51 
60  bool generateRandom(std::vector<unsigned char>& data, int size) noexcept;
61 };
62 
63 } // namespace acsdkCrypto
64 } // namespace alexaClientSDK
65 
66 #endif // ACSDKCRYPTO_PRIVATE_OPENSSLKEYFACTORY_H_
KeyFactoryInterface.h
alexaClientSDK::acsdkCrypto::OpenSslKeyFactory::generateKey
bool generateKey(AlgorithmType type, Key &key) noexcept override
Generates a new key.
Definition: OpenSslKeyFactory.cpp:40
alexaClientSDK::acsdkCrypto::OpenSslKeyFactory::generateIV
bool generateIV(AlgorithmType type, IV &iv) noexcept override
Generates a new initialization vector.
Definition: OpenSslKeyFactory.cpp:52
alexaClientSDK::settings::test::key
static const std::string key
The database key to be used by the protocol given the METADATA object.
Definition: SharedAVSSettingProtocolTest.cpp:58
alexaClientSDK
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
alexaClientSDK::acsdkCryptoInterfaces::KeyFactoryInterface::Key
std::vector< unsigned char > Key
Key data. Key is a sequence of bytes, and the size depends on an encryption algorithm.
Definition: KeyFactoryInterface.h:41
alexaClientSDK::acsdkCryptoInterfaces::KeyFactoryInterface
Key factory interface.
Definition: KeyFactoryInterface.h:37
alexaClientSDK::acsdkCrypto::OpenSslKeyFactory
Key factory implementation based on OpenSSL.
Definition: OpenSslKeyFactory.h:34
alexaClientSDK::acsdkCrypto::OpenSslKeyFactory::create
static std::shared_ptr< KeyFactoryInterface > create() noexcept
Factory method.
Definition: OpenSslKeyFactory.cpp:33
alexaClientSDK::acsdkCryptoInterfaces::KeyFactoryInterface::IV
std::vector< unsigned char > IV
Initialization vector type. IV is a sequence of bytes, and the size depends on a encryption algorithm...
Definition: KeyFactoryInterface.h:45
alexaClientSDK::acsdkCryptoInterfaces::AlgorithmType
AlgorithmType
Enumeration of all supported encryption protocols.
Definition: AlgorithmType.h:31

AlexaClientSDK 1.26.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0