 |
AlexaClientSDK
1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Go to the documentation of this file.
16 #ifndef ACSDKPKCS11_PRIVATE_PKCS11KEYSTORE_H_
17 #define ACSDKPKCS11_PRIVATE_PKCS11KEYSTORE_H_
20 #include <unordered_map>
31 namespace acsdkPkcs11 {
54 static std::shared_ptr<KeyStoreInterface>
create(
55 const std::shared_ptr<MetricRecorderInterface>& metricRecorder =
nullptr) noexcept;
61 const std::string& keyAlias,
68 const std::string& keyAlias,
75 Tag& tag) noexcept
override;
77 const std::string& keyAlias,
84 const std::string& keyAlias,
97 PKCS11KeyStore(
const std::shared_ptr<MetricRecorderInterface>& metricRecorder) noexcept;
100 bool init() noexcept;
109 std::shared_ptr<PKCS11Key> loadKey(
const std::string& objectLabel,
AlgorithmType type) noexcept;
136 void submitMetric(
const std::string& activity,
const std::string& eventName, uint64_t count,
bool failure) noexcept;
139 std::shared_ptr<MetricRecorderInterface> m_metricRecorder;
142 std::shared_ptr<PKCS11Functions> m_functions;
145 std::shared_ptr<PKCS11Session> m_session;
148 std::mutex m_keysMutex;
151 std::unordered_map<PKCS11KeyDescriptor, std::shared_ptr<PKCS11Key>> m_keys;
154 std::string m_defaultKeyAlias;
160 #endif // ACSDKPKCS11_PRIVATE_PKCS11KEYSTORE_H_
static std::shared_ptr< KeyStoreInterface > create(const std::shared_ptr< MetricRecorderInterface > &metricRecorder=nullptr) noexcept
Creates key store.
Definition: PKCS11KeyStore.cpp:69
std::vector< unsigned char > KeyChecksum
Data type for key checksum.
Definition: KeyStoreInterface.h:56
bool getDefaultKeyAlias(std::string &keyAlias) noexcept override
Returns default key alias.
Definition: PKCS11KeyStore.cpp:277
std::vector< unsigned char > IV
Data type for initialization vector data.
Definition: KeyStoreInterface.h:53
bool decryptAD(const std::string &keyAlias, AlgorithmType type, const KeyChecksum &checksum, const IV &iv, const DataBlock &aad, const DataBlock &ciphertext, const Tag &tag, DataBlock &plaintext) noexcept override
Decrypts data block using authenticated decryption algorithm.
Definition: PKCS11KeyStore.cpp:214
Key Store Interface.
Definition: KeyStoreInterface.h:47
Class to identify key object in HSM.
Definition: PKCS11KeyDescriptor.h:36
std::vector< unsigned char > DataBlock
Data type for data block (encrypted or unencrypted).
Definition: KeyStoreInterface.h:50
std::vector< unsigned char > Tag
Data type for tag. Tag (known as Message Authentication Code) is used with AEAD mode of operation lik...
Definition: KeyStoreInterface.h:60
Key store implementation for PKCS11.
Definition: PKCS11KeyStore.h:45
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
bool encryptAE(const std::string &keyAlias, AlgorithmType type, const IV &iv, const DataBlock &aad, const DataBlock &plaintext, KeyChecksum &checksum, DataBlock &ciphertext, Tag &tag) noexcept override
Encrypts data block using authenticated encryption algorithm.
Definition: PKCS11KeyStore.cpp:166
bool encrypt(const std::string &keyAlias, AlgorithmType type, const IV &iv, const DataBlock &plaintext, KeyChecksum &checksum, DataBlock &ciphertext) noexcept override
Encrypts data block.
Definition: PKCS11KeyStore.cpp:153
Definition: MetricRecorderInterface.h:28
~PKCS11KeyStore() noexcept override
Definition: PKCS11KeyStore.cpp:126
bool decrypt(const std::string &keyAlias, AlgorithmType type, const KeyChecksum &checksum, const IV &iv, const DataBlock &ciphertext, DataBlock &plaintext) noexcept override
Decrypts data block.
Definition: PKCS11KeyStore.cpp:202
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