AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
alexaClientSDK::acsdkProperties Namespace Reference

Properties Implementation. More...

Namespaces

 test
 Test cases for Properties Implementation.
 

Classes

struct  Asn1Helper
 Helper for ASN.1 operations. More...
 
struct  DataInfo
 Data structure to produce and parse DER for encrypted property data. More...
 
struct  DataProperty
 Data structure to produce and parse DER for encrypted property data. More...
 
struct  DataPropertyCodec
 ASN.1 Encoder/Decoder for encrypted property value. More...
 
class  DataPropertyCodecState
 Helper state for holding ASN.1 structures of DER codec for encrypted property value. More...
 
class  EncryptedProperties
 Properties adapter with field encryption. More...
 
class  EncryptedPropertiesFactory
 
struct  EncryptionInfo
 Data structure to produce and parse DER for encryption key property data. More...
 
struct  EncryptionKeyPropertyCodec
 ASN.1 Codec API for Encryption Key Property Encoding. More...
 
class  EncryptionKeyPropertyCodecState
 ASN.1 Codec state for encryption key property. More...
 
struct  EncryptionProperty
 Data structure to produce and parse DER for encryption key property data. More...
 
class  ErrorCallbackInterface
 Callback interface to handle errors. More...
 
class  MiscStorageProperties
 Properties for MiscStorageInterface. More...
 
class  MiscStoragePropertiesFactory
 Properties factory for MiscStorageInterface. More...
 
class  MiscStorageUriMapperInterface
 Interface to map properties config URI into component name and table name. More...
 
class  RetryExecutor
 Helper class to execute with retries. More...
 
class  SimpleMiscStorageUriMapper
 Generic URI mapper for MiscStorageInterface adapter. More...
 

Typedefs

typedef struct alexaClientSDK::acsdkProperties::EncryptionInfo ACSDK_ENC_INFO
 Data structure to produce and parse DER for encryption key property data. More...
 
typedef struct alexaClientSDK::acsdkProperties::EncryptionProperty ACSDK_ENC_PROP
 Data structure to produce and parse DER for encryption key property data. More...
 
typedef struct alexaClientSDK::acsdkProperties::DataInfo ACSDK_DATA_INFO
 Data structure to produce and parse DER for encrypted property data. More...
 
typedef struct alexaClientSDK::acsdkProperties::DataProperty ACSDK_DATA_PROP
 Data structure to produce and parse DER for encrypted property data. More...
 
typedef std::pair< StatusCode, bool > StatusCodeWithRetry
 Status code with a retry flag. More...
 

Enumerations

enum  StatusCode {
  StatusCode::SUCCESS = 1, StatusCode::UNKNOWN_ERROR = 2, StatusCode::HSM_ERROR = 3, StatusCode::CRYPTO_ERROR = 4,
  StatusCode::DIGEST_ERROR = 5, StatusCode::INNER_PROPERTIES_ERROR = 6
}
 Possible error causes. More...
 
enum  Action { Action::CONTINUE = 1, Action::FAIL = 2, Action::CLEAR_DATA = 3, Action::RETRY = 4 }
 Error action. More...
 
enum  OperationType { OperationType::Open, OperationType::Get, OperationType::Put, OperationType::Other }
 Tracked operation types for error callbacks. More...
 
enum  RetryableOperationResult { RetryableOperationResult::Success, RetryableOperationResult::Failure, RetryableOperationResult::Cleanup }
 Operation result from a retryable operation. More...
 

Functions

std::shared_ptr< PropertiesFactoryInterfacecreateEncryptedPropertiesFactory (const std::shared_ptr< PropertiesFactoryInterface > &innerFactory, const std::shared_ptr< CryptoFactoryInterface > &cryptoFactory, const std::shared_ptr< KeyStoreInterface > &keyStore) noexcept
 Creates properties factory with encryption support by wrapping a factory without encryption support. More...
 
std::shared_ptr< PropertiesFactoryInterfacecreateEncryptedPropertiesFactory (const std::shared_ptr< MiscStorageInterface > &innerStorage, const std::shared_ptr< MiscStorageUriMapperInterface > &uriMapper, const std::shared_ptr< CryptoFactoryInterface > &cryptoFactory, const std::shared_ptr< KeyStoreInterface > &keyStore) noexcept
 Creates properties factory with encryption support by wrapping a MiscStorageInterface. More...
 
bool setErrorCallback (const std::weak_ptr< ErrorCallbackInterface > &callback, uint32_t maxRetries=DEFAULT_MAX_RETRIES, std::weak_ptr< ErrorCallbackInterface > *previous=nullptr) noexcept
 Sets an error callback. More...
 
std::shared_ptr< PropertiesFactoryInterfacecreatePropertiesFactory (const std::shared_ptr< MiscStorageInterface > &innerStorage, const std::shared_ptr< MiscStorageUriMapperInterface > &nameMapper=SimpleMiscStorageUriMapper::create()) noexcept
 Creates PropertiesFactoryInterface from MiscStorageInterface. More...
 
 DECLARE_ASN1_FUNCTIONS (ACSDK_ENC_INFO)
 
 DECLARE_ASN1_FUNCTIONS (ACSDK_ENC_PROP)
 
 DECLARE_ASN1_FUNCTIONS (ACSDK_DATA_INFO)
 
 DECLARE_ASN1_FUNCTIONS (ACSDK_DATA_PROP)
 
 ASN1_SEQUENCE (ACSDK_ENC_INFO)
 
 IMPLEMENT_ASN1_FUNCTIONS (ACSDK_ENC_INFO)
 
 ASN1_SEQUENCE (ACSDK_ENC_PROP)
 
 IMPLEMENT_ASN1_FUNCTIONS (ACSDK_ENC_PROP)
 
 ASN1_SEQUENCE (ACSDK_DATA_INFO)
 
 IMPLEMENT_ASN1_FUNCTIONS (ACSDK_DATA_INFO)
 
 ASN1_SEQUENCE (ACSDK_DATA_PROP)
 
 IMPLEMENT_ASN1_FUNCTIONS (ACSDK_DATA_PROP)
 
std::shared_ptr< alexaClientSDK::acsdkPropertiesInterfaces::PropertiesFactoryInterfacecreateEncryptedPropertiesFactory (const std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::storage::MiscStorageInterface > &innerStorage, const std::shared_ptr< MiscStorageUriMapperInterface > &uriMapper, const std::shared_ptr< alexaClientSDK::acsdkCryptoInterfaces::CryptoFactoryInterface > &cryptoFactory, const std::shared_ptr< alexaClientSDK::acsdkCryptoInterfaces::KeyStoreInterface > &keyStore) noexcept
 

Variables

static constexpr uint32_t DEFAULT_MAX_RETRIES = 16u
 Default number of retries when using error callback interface. More...
 
static constexpr uint32_t UNLIMITED_RETRIES = UINT32_MAX
 Unlimited number of retries when using error callback interface. More...
 
constexpr int64_t ACSDK_DATA_KEY_VER_V1 = 1
 
constexpr int64_t ACSDK_DATA_VER_V1 = 1
 
constexpr int64_t ACSDK_CIP_ALG_AES_256_GCM = 1
 
constexpr int64_t ACSDK_DIG_ALG_SHA_256 = 1
 
static const std::string TAG {"SimpleMiscStorageUriMapper"}
 

Detailed Description

Properties Implementation.

Typedef Documentation

◆ StatusCodeWithRetry

Status code with a retry flag.

A combination of a status code with retry flag. Retry executor uses status code to propagate to error callback, and retry flag to determine if operation is actually retyable.

See also
RetryExecutor
RetryableOperationResult

Enumeration Type Documentation

◆ OperationType

Tracked operation types for error callbacks.

Enumerator
Open 

Failed call to open properties container.

Get 

Failed call to get property.

Put 

Failed call to put property.

Other 

Failed call to other operation.

◆ RetryableOperationResult

Operation result from a retryable operation.

Retryable operation completes with one of three outcomes: success, failure, or retryable failure. If result is retryable failure, the executor may restart the operation or fail it.

See also
RetryExecutor
StatusCodeWithRetry
Enumerator
Success 

Operation completed with success.

Failure 

Operation has failed.

Cleanup 

Operation has failed and cleanup is requested.

Function Documentation

◆ ASN1_SEQUENCE() [1/4]

alexaClientSDK::acsdkProperties::ASN1_SEQUENCE ( ACSDK_DATA_INFO  )

◆ ASN1_SEQUENCE() [2/4]

alexaClientSDK::acsdkProperties::ASN1_SEQUENCE ( ACSDK_DATA_PROP  )

◆ ASN1_SEQUENCE() [3/4]

alexaClientSDK::acsdkProperties::ASN1_SEQUENCE ( ACSDK_ENC_INFO  )

◆ ASN1_SEQUENCE() [4/4]

alexaClientSDK::acsdkProperties::ASN1_SEQUENCE ( ACSDK_ENC_PROP  )

◆ createEncryptedPropertiesFactory() [1/2]

std::shared_ptr<alexaClientSDK::acsdkPropertiesInterfaces::PropertiesFactoryInterface> alexaClientSDK::acsdkProperties::createEncryptedPropertiesFactory ( const std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::storage::MiscStorageInterface > &  innerStorage,
const std::shared_ptr< MiscStorageUriMapperInterface > &  uriMapper,
const std::shared_ptr< alexaClientSDK::acsdkCryptoInterfaces::CryptoFactoryInterface > &  cryptoFactory,
const std::shared_ptr< alexaClientSDK::acsdkCryptoInterfaces::KeyStoreInterface > &  keyStore 
)
noexcept

◆ createEncryptedPropertiesFactory() [2/2]

std::shared_ptr< PropertiesFactoryInterface > alexaClientSDK::acsdkProperties::createEncryptedPropertiesFactory ( const std::shared_ptr< PropertiesFactoryInterface > &  innerFactory,
const std::shared_ptr< CryptoFactoryInterface > &  cryptoFactory,
const std::shared_ptr< KeyStoreInterface > &  keyStore 
)
noexcept

Creates properties factory with encryption support by wrapping a factory without encryption support.

Encrypted properties factory protects all values using AES-256 cipher. The data key is stored as one of the underlying properties with reserved name "$acsdkEncryption$" in encrypted form. Hardware security module is used for storing the main encryption key and wrapping/unwrapping data keys.

When client code accesses PropertiesInterface through encrypted PropertiesFactoryInterface, all existing data is automatically converted into encrypted form.

Parameters
[in]innerFactoryProperties factory without encryption support.
[in]cryptoFactoryCrypto factory reference. This parameter must not be nullptr.
[in]keyStoreKey store factory reference. This parameter must not be nullptr.
Returns
Properties factory reference or nullptr on error.

◆ IMPLEMENT_ASN1_FUNCTIONS() [1/4]

alexaClientSDK::acsdkProperties::IMPLEMENT_ASN1_FUNCTIONS ( ACSDK_DATA_INFO  )

◆ IMPLEMENT_ASN1_FUNCTIONS() [2/4]

alexaClientSDK::acsdkProperties::IMPLEMENT_ASN1_FUNCTIONS ( ACSDK_DATA_PROP  )

◆ IMPLEMENT_ASN1_FUNCTIONS() [3/4]

alexaClientSDK::acsdkProperties::IMPLEMENT_ASN1_FUNCTIONS ( ACSDK_ENC_INFO  )

◆ IMPLEMENT_ASN1_FUNCTIONS() [4/4]

alexaClientSDK::acsdkProperties::IMPLEMENT_ASN1_FUNCTIONS ( ACSDK_ENC_PROP  )

Variable Documentation

◆ DEFAULT_MAX_RETRIES

constexpr uint32_t alexaClientSDK::acsdkProperties::DEFAULT_MAX_RETRIES = 16u
staticconstexpr

Default number of retries when using error callback interface.

Number of retries limits number of error handling attempts when implementation encounters a recoverable error. If retry callback requests more than the given number of retries, the operation is considered as failed.

See also
setErrorCallback()

◆ TAG

const std::string alexaClientSDK::acsdkProperties::TAG {"SimpleMiscStorageUriMapper"}
static

◆ UNLIMITED_RETRIES

constexpr uint32_t alexaClientSDK::acsdkProperties::UNLIMITED_RETRIES = UINT32_MAX
staticconstexpr

Unlimited number of retries when using error callback interface.

If this value is used when setting error callback, the implementation will never give up on retries unless callback tell to do so.

See also
setErrorCallback()

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