본문으로 건너뛰기

ara::crypto

개요

Cryptography 기능 클러스터는 암호 프리미티브, 키 저장, X.509 인증서 처리를 제공합니다. 이 페이지는 ara::crypto 네임스페이스의 공개 API — 공통 타입, 크립토 프로바이더와 컨텍스트, 키 슬롯과 크립토 객체, X.509 처리 — 를 헤더 파일 단위로 정리합니다. API 명세 본문은 영어 원문으로 제공됩니다.

라이브러리 · 헤더 · 링크

  • 라이브러리: lib/libpara_crypto.so
  • CMake: find_package(para-crypto)para::crypto
  • 표준 헤더: include/ara/crypto/
  • 백엔드: OpenSSL (etc/crypto/)

1 Header: ara/crypto/common/base_id_types.h

1.1 Non-Member Types

1.1.1 Type Alias: AlgId

Kind:type alias
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:AlgId
Syntax:using AlgId = ara::core::StringView;
Description:Type for holding StringView of algorithm according to standardized format described in the chapter 'Naming Convention'.

1.1.2 Type Alias: AlgIdString

Kind:type alias
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:AlgIdString
Syntax:using AlgIdString = ara::core::String;
Description:Type for holding String of algorithm according to standardized format described in the chapter 'Naming Convention'.

1.1.3 Type Alias: AllowedUsageFlags

Kind:type alias
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:AllowedUsageFlags
Syntax:using AllowedUsageFlags = std::uint32_t;
Description:Type for holding bit-flags of allowed usages of a key.

1.1.4 Enumeration: CryptoObjectType

Kind:enumeration
Header file:#include "ara/crypto/common/base_id_types.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto
Symbol:CryptoObjectType
Underlying type:std::uint8_t
Syntax:enum class CryptoObjectType : std::uint8_t {...};
Values:kSymmetricKey= 1
cryp::SymmetricKey object
kPrivateKey= 2
cryp::PrivateKey object
kPublicKey= 3
cryp::PublicKey object
Description:Enumeration of all types of crypto objects, i.e. types of content that can be stored to a key slot.

1.1.5 Enumeration: CryptoTransform

Kind:enumeration
Header file:#include "ara/crypto/common/base_id_types.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto
Symbol:CryptoTransform
Underlying type:std::uint8_t
Syntax:enum class CryptoTransform : std::uint8_t {...};
Values:kEncrypt= 1
encryption
kDecrypt= 2
decryption
Description:Enumeration of cryptographic transformation directions.

1.1.6 Type Alias: Timestamp

Kind:type alias
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:Timestamp
Syntax:using Timestamp = std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds>;
Description:Type for timestamps.

1.2 Global Variables

1.2.1 kAllowDataDecryption

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowDataDecryption
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowDataDecryption {0x0002};
Description:The key can be used for data decryption.

1.2.2 kAllowDataEncryption

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowDataEncryption
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowDataEncryption {0x0001};
Description:The following constants define 1-bit values representing allowed usages.

The key can be used for data encryption

1.2.3 kAllowDerivedPlaintextExport

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowDerivedPlaintextExport
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowDerivedPlaintextExport {0x4000};
Description:The derived key can be exported in plaintext.

1.2.4 kAllowHashCalculation

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowHashCalculation
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowHashCalculation {0x1000};
Description:The key can be used as input to a HashFunctionCtx.

1.2.5 kAllowKeyAgreement

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowKeyAgreement
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowKeyAgreement {0x0020};
Description:The key can be used as private or public input to key agreement.

1.2.6 kAllowKeyDerivation

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowKeyDerivation
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowKeyDerivation {0x0040};
Description:The key can be used for key derivation.

1.2.7 kAllowKeyUnwrapping

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowKeyUnwrapping
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowKeyUnwrapping {0x0100};
Description:The key can be used as a key encryption key for key unwrapping or key decapsulation.

1.2.8 kAllowKeyWrapping

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowKeyWrapping
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowKeyWrapping {0x0080};
Description:The key can be used as a key encryption key for key wrapping or key encapsulation.

1.2.9 kAllowMac

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowMac
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowMac {0x0004};
Description:The key can be used for MAC generation and verification.

1.2.10 kAllowPersist

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowPersist
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowPersist {0x0200};
Description:The key can persisted.

1.2.11 kAllowPlaintextExport

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowPlaintextExport
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowPlaintextExport {0x2000};
Description:The key can be exported in plaintext.

1.2.12 kAllowRngInit

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowRngInit
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowRngInit {0x0800};
Description:The symmetric key can be used for seeding of a RandomGeneratorCtx.

1.2.13 kAllowSecuredExport

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowSecuredExport
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowSecuredExport {0x0400};
Description:The key can be securely exported (protected export)

1.2.14 kAllowSigGeneration

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowSigGeneration
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowSigGeneration {0x0008};
Description:The key can be used for signature generation.

1.2.15 kAllowSigVerification

Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:namespace ara::crypto
Symbol:kAllowSigVerification
Type:AllowedUsageFlags
Syntax:constexpr AllowedUsageFlags kAllowSigVerification {0x0010};
Description:The key can be used for signature verification.

1.3 Struct: SecureCounter

Kind:struct
Header file:#include "ara/crypto/common/base_id_types.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto
Symbol:SecureCounter
Syntax:struct SecureCounter {...};
Description:128 bit secure counter made up of two uint64_t's representing the most significant and least significant bits

1.3.1 Public Member Variables

1.3.1.1 mLSQW
Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:ara::crypto::SecureCounter
Symbol:mLSQW
Type:std::uint64_t
Syntax:std::uint64_t mLSQW;
Description:least significant 64 bits
1.3.1.2 mMSQW
Kind:variable
Header file:#include "ara/crypto/common/base_id_types.h"
Scope:ara::crypto::SecureCounter
Symbol:mMSQW
Type:std::uint64_t
Syntax:std::uint64_t mMSQW;
Description:most significant 64 bits

2 Header: ara/crypto/common/crypto_error_domain.h

2.1 Non-Member Types

2.1.1 Enumeration: CryptoErrc

Kind:enumeration
Header file:#include "ara/crypto/common/crypto_error_domain.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto
Symbol:CryptoErrc
Underlying type:ara::core::ErrorDomain::CodeType
Syntax:enum class CryptoErrc : ara::core::ErrorDomain::CodeType {...};
Values:kBusyResource= 16777217U
ResourceException: Specified resource is busy!
kNoSuchValue= 2U
kNoSuchElement: The requested element is not present in the object.
kInvalidArgument= 33619968U
InvalidArgumentException: An invalid argument value is provided!
kUnknownIdentifier= 33619969U
InvalidArgumentException: Unknown identifier is provided!
kInsufficientCapacity= 33619970U
InvalidArgumentException: Insufficient capacity of the output buffer!
kInvalidInputSize= 33619971U
InvalidArgumentException: Invalid size of an input buffer!
kIncompatibleArguments= 33619972U
InvalidArgumentException: Provided values of arguments are incompatible!
kOutOfBounds= 67174407U
InvalidArgumentException: Provided value is above the upper boundary!
kAuthTagNotValid= 33619976U
AuthTagNotValidException: Provided authentication-tag cannot be verified!
kUnsupported= 33620224U
UnsupportedException: Unsupported request (due to limitations of the implementation)!
kInvalidUsageOrder= 33685504U
InvalidUsageOrderException: Invalid usage order of the interface!
kUninitializedContext= 33685505U
InvalidUsageOrderException: Context of the interface was not initialized!
kProcessingNotStarted= 33685506U
InvalidUsageOrderException: Data processing was not started yet!
kProcessingNotFinished= 33685507U
InvalidUsageOrderException: Data processing was not finished yet!
kUnsupportedFormat= 50331649U
RuntimeException: Unsupported serialization format for this object type!
kIncompatibleObject= 50397185U
UnexpectedValueException: The provided object is incompatible with requested operation or its configuration!
kEmptyKeySlot= 50397187U
UnexpectedValueException: Specified container is empty!
kUsageViolation= 50462720U
UsageViolationException: Violation of allowed usage for the object!
kEmptyCertificateSlot= 50462721U
--
Description:Defines the error codes for the ara::crypto::CryptoErrorDomain

2.2 Non-Member Functions

2.2.1 Other

2.2.1.1 GetCryptoErrorDomain
Kind:function
Header file:#include "ara/crypto/common/crypto_error_domain.h"
Scope:namespace ara::crypto
Syntax:constexpr const ara::core::ErrorDomain & GetCryptoErrorDomain () noexcept;
Return value:const ara::core::ErrorDomain &the CryptoErrorDomain
Exception Safety:exception safe
Thread Safety:thread-safe
Description:Return a reference to the global CryptoErrorDomain.
2.2.1.2 MakeErrorCode
Kind:function
Header file:#include "ara/crypto/common/crypto_error_domain.h"
Scope:namespace ara::crypto
Syntax:constexpr ara::core::ErrorCode MakeErrorCode (ara::crypto::CryptoErrorDomain::Errc code, ara::core::ErrorDomain::SupportDataType data) noexcept;
Parameters (in):codean error code identifier from the CryptoErrc enumeration
datasupplementary data for the error description
Return value:ara::core::ErrorCodean instance of ErrorCode created according the arguments
Exception Safety:exception safe
Thread Safety:thread-safe
Description:Makes Error Code instances from the Crypto Error Domain. The returned ErrorCode instance always references to CryptoErrorDomain.

2.3 Class: CryptoErrorDomain

Kind:class
Header file:#include "ara/crypto/common/crypto_error_domain.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto
Symbol:CryptoErrorDomain
Base class:ara::core::ErrorDomain
Syntax:class CryptoErrorDomain final : public ara::core::ErrorDomain {...};
Description:Crypto Error Domain class that provides interfaces as defined by ara::core::ErrorDomain such as a name of the Crypto Error Domain or messages for each error code. This class represents an error domain responsible for all errors that may be reported by public APIs in ara::crypto namespace. .

2.3.1 Public Member Types

2.3.1.1 Type Alias: Errc
Kind:type alias
Header file:#include "ara/crypto/common/crypto_error_domain.h"
Scope:ara::crypto::CryptoErrorDomain
Symbol:Errc
Syntax:using Errc = CryptoErrc;
Description:crypto error
2.3.1.2 Type Alias: Exception
Kind:type alias
Header file:#include "ara/crypto/common/crypto_error_domain.h"
Scope:ara::crypto::CryptoErrorDomain
Symbol:Exception
Syntax:using Exception = CryptoException;
Description:Alias for the exception base class.

2.3.2 Public Member Functions

2.3.2.1 Special Member Functions
2.3.2.1.1 Default Constructor
Kind:function
Header file:#include "ara/crypto/common/crypto_error_domain.h"
Scope:ara::crypto::CryptoErrorDomain
Syntax:constexpr CryptoErrorDomain () noexcept;
Exception Safety:exception safe
Thread Safety:thread-safe
Description:Ctor of the CryptoErrorDomain .
2.3.2.2 Member Functions
2.3.2.2.1 Message
Kind:function
Header file:#include "ara/crypto/common/crypto_error_domain.h"
Scope:ara::crypto::CryptoErrorDomain
Syntax:const char * Message (ara::core::ErrorDomain::CodeType errorCode) const noexcept override;
Parameters (in):errorCodean error code identifier from the CryptoErrc enumeration
Return value:const char *message text of error code
Exception Safety:exception safe
Thread Safety:thread-safe
Description:Translate an error code value into a text message.
2.3.2.2.2 Name
Kind:function
Header file:#include "ara/crypto/common/crypto_error_domain.h"
Scope:ara::crypto::CryptoErrorDomain
Syntax:const char * Name () const noexcept override;
Return value:const char *As per ara::crypto::CryptoErrorDomain in SWS_CORE_90023
Exception Safety:exception safe
Thread Safety:thread-safe
Description:Returns the unique name of the error domain.
2.3.2.2.3 ThrowAsException
Kind:function
Header file:#include "ara/crypto/common/crypto_error_domain.h"
Scope:ara::crypto::CryptoErrorDomain
Syntax:[[noreturn]] void ThrowAsException (const ara::core::ErrorCode &errorCode) const override;
Parameters (in):errorCodean error code identifier from the CryptoErrc enumeration
Return value:None
Exception Safety:not exception safe
Thread Safety:thread-safe
Description:throws exception of error code. As per SWS_CORE_10304, this function does not participate in overload resolution when C++ exceptions are disabled in the compiler toolchain.

2.4 Class: CryptoException

Kind:class
Header file:#include "ara/crypto/common/crypto_error_domain.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto
Symbol:CryptoException
Base class:ara::core::Exception
Syntax:class CryptoException : public ara::core::Exception {...};
Description:Exception type thrown for CRYPTO errors.

2.4.1 Public Member Functions

2.4.1.1 Constructors
2.4.1.1.1 CryptoException
Kind:function
Header file:#include "ara/crypto/common/crypto_error_domain.h"
Scope:ara::crypto::CryptoException
Syntax:explicit CryptoException (ara::core::ErrorCode err) noexcept;
Parameters (in):errthe ErrorCode
Exception Safety:exception safe
Thread Safety:thread-safe
Description:Construct a new CryptoException from an ErrorCode.

3 Header: ara/crypto/common/entry_point.h

3.1 Non-Member Functions

3.1.1 Other

3.1.1.1 LoadCryptoProvider
Kind:function
Header file:#include "ara/crypto/common/entry_point.h"
Scope:namespace ara::crypto
Syntax:ara::core::Result< cryp::CryptoProvider::Sptr > LoadCryptoProvider (const ara::core::InstanceSpecifier &iSpecify) noexcept;
Parameters (in):iSpecifyInstanceSpecifier of the RPortPrototype of type CryptoProviderInterface
Return value:ara::core::Result< ara::crypto::cryp::CryptoProvider::Sptr >shared pointer to loaded Crypto Provider
Exception Safety:exception safe
Thread Safety:thread-safe
Violations:ProcessMappingViolationIn case InstanceSpecifier does not point to a PortPrototype typed by a CryptoProviderInterface modeled for the current process.
Errors:This function does not specify any standardized errors.
Description:This factory method shall create or return the existing instance of a specific Crypto Provider.
3.1.1.2 LoadKeySlot
Kind:function
Header file:#include "ara/crypto/common/entry_point.h"
Scope:namespace ara::crypto
Syntax:ara::core::Result< ara::crypto::cryp::KeySlot::Sptr > LoadKeySlot (const ara::core::InstanceSpecifier &iSpecify) noexcept;
Parameters (in):iSpecifyinstance specifier to the RPortPrototype of a CryptoKeySlotInterface or a CryptoKeySlotClientInterface that identifies the key to be loaded
Return value:ara::core::Result< cryp::KeySlot::Sptr >a result containing either the KeySlot or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Violations:ProcessMappingViolationIn case InstanceSpecifier does not point to a PortPrototype typed by a CryptoKeySlotInterface or CryptoKeySlotClientInterface modeled for the current process.
Errors:This function does not specify any standardized errors.
Description:Load a read-only key slot. This factory method shall load the information associated with the specified KeySlot into a KeySlot object.
3.1.1.3 LoadWriteableKeySlot
Kind:function
Header file:#include "ara/crypto/common/entry_point.h"
Scope:namespace ara::crypto
Syntax:ara::core::Result< ara::crypto::cryp::WriteableKeySlot::Sptr > LoadWriteableKeySlot (const ara::core::InstanceSpecifier &iSpecify) noexcept;
Parameters (in):iSpecifyinstance specifier to the RPortPrototype of a CryptoKeySlotInterface that identifies the key to be loaded
Return value:ara::core::Result< cryp::WriteableKeySlot::Sptr >a result containing either the KeySlot or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Violations:ProcessMappingViolationIn case InstanceSpecifier does not point to a PortPrototype typed by a CryptoKeySlotInterface modeled for the current process.
Errors:This function does not specify any standardized errors.
Description:Load a writeable key slot. This factory method shall load the information associated with the specified KeySlot into a WriteableKeySlot object.
3.1.1.4 LoadX509Provider
Kind:function
Header file:#include "ara/crypto/common/entry_point.h"
Scope:namespace ara::crypto
Syntax:ara::core::Result< x509::X509Provider::Sptr > LoadX509Provider () noexcept;
Return value:ara::core::Result< ara::crypto::x509::X509Provider::Sptr >shared pointer to loaded X.509 Provider
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:This factory method shall create or return the existing instance of the singleton X.509 Provider.

4 Header: ara/crypto/common/formatter.h

4.1 Non-Member Functions

4.1.1 Other

4.1.1.1 LoadFormatter
Kind:function
Header file:#include "ara/crypto/common/formatter.h"
Scope:namespace ara::crypto
Syntax:ara::core::Result< Formatter::Sptr > LoadFormatter () noexcept;
Return value:ara::core::Result< ara::crypto::Formatter::Sptr >shared pointer to Formatter
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Factory that creates a Formatter.

4.2 Class: Formatter

Kind:class
Header file:#include "ara/crypto/common/formatter.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto
Symbol:Formatter
Syntax:class Formatter {...};
Description:Formatter object interface.

4.2.1 Public Member Types

4.2.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/common/formatter.h"
Scope:ara::crypto::Formatter
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<Formatter>;
Description:Smart pointer of the interface.

4.2.2 Public Member Functions

4.2.2.1 Special Member Functions
4.2.2.1.1 Copy Constructor
Kind:function
Header file:#include "ara/crypto/common/formatter.h"
Scope:ara::crypto::Formatter
Syntax:Formatter (const Formatter &)=delete;
Description:Copy-Constructor.
4.2.2.1.2 Move Constructor
Kind:function
Header file:#include "ara/crypto/common/formatter.h"
Scope:ara::crypto::Formatter
Syntax:Formatter (Formatter &&)=delete;
Description:Move-Constructor.
4.2.2.1.3 Copy Assignment Operator
Kind:function
Header file:#include "ara/crypto/common/formatter.h"
Scope:ara::crypto::Formatter
Syntax:ara::crypto::Formatter & operator= (const ara::crypto::Formatter &other)=delete;
Description:Copy-assign another Formatter to this instance.
4.2.2.1.4 Move Assignment Operator
Kind:function
Header file:#include "ara/crypto/common/formatter.h"
Scope:ara::crypto::Formatter
Syntax:ara::crypto::Formatter & operator= (ara::crypto::Formatter &&other)=delete;
Description:Move-assign another Formatter to this instance.
4.2.2.1.5 Destructor
Kind:function
Header file:#include "ara/crypto/common/formatter.h"
Scope:ara::crypto::Formatter
Syntax:virtual ~Formatter () noexcept=default;
Exception Safety:exception safe
Description:Destructor.
4.2.2.2 Member Functions
4.2.2.2.1 Convert
Kind:function
Header file:#include "ara/crypto/common/formatter.h"
Scope:ara::crypto::Formatter
Syntax:virtual ara::core::Result< void > Convert (ara::crypto::ReadOnlyMemRegion input, ara::crypto::ReadWriteMemRegion out) const noexcept=0;
Parameters (in):inputan input buffer containing the data in the input format
Parameters (out):outan output buffer that the data will be written to in the output format
Return value:ara::core::Result< void >An empty result or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if serialized does not conform to the specified format
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
Description:Converts the data according to the previous configuration of the Formatter.
4.2.2.2.2 GetExportSize
Kind:function
Header file:#include "ara/crypto/common/formatter.h"
Scope:ara::crypto::Formatter
Syntax:virtual ara::core::Result< std::size_t > GetExportSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >A result containing the size in bytes of the serialized object or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the size in bytes of the object when serialized using the current configuration of the Formatter.
4.2.2.2.3 SetFormatConfiguration
Kind:function
Header file:#include "ara/crypto/common/formatter.h"
Scope:ara::crypto::Formatter
Syntax:virtual ara::core::Result< void > SetFormatConfiguration (ara::crypto::FormatId inputFormat, ara::crypto::FormatId outputFormat, ara::crypto::AlgId algId) noexcept=0;
Parameters (in):inputFormatthe input format
outputFormatthe output format
algIdthe AlgId of the data to be formatted
Return value:ara::core::Result< void >An empty result or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified conversion is not supported
Description:Configure the formatter with the expected input format, output format, and the AlgId of the data to be formatted. The input and output format may be kFormatRawValueOnly, kFormatDerEncoded, or kFormatPemEncoded.

5 Header: ara/crypto/common/mem_region.h

5.1 Non-Member Types

5.1.1 Type Alias: ReadOnlyMemRegion

Kind:type alias
Header file:#include "ara/crypto/common/mem_region.h"
Scope:namespace ara::crypto
Symbol:ReadOnlyMemRegion
Syntax:using ReadOnlyMemRegion = ara::core::Span<const std::uint8_t>;
Description:Read-Only Memory Region (intended for [in] arguments)

5.1.2 Type Alias: ReadWriteMemRegion

Kind:type alias
Header file:#include "ara/crypto/common/mem_region.h"
Scope:namespace ara::crypto
Symbol:ReadWriteMemRegion
Syntax:using ReadWriteMemRegion = ara::core::Span<std::uint8_t>;
Description:Read-Write Memory Region (intended for [out] or [in/out] arguments)

6 Header: ara/crypto/common/serializable.h

6.1 Non-Member Types

6.1.1 Type Alias: FormatId

Kind:type alias
Header file:#include "ara/crypto/common/serializable.h"
Scope:namespace ara::crypto
Symbol:FormatId
Syntax:using FormatId = std::uint32_t;
Description:A container type for the encoding format identifiers.

6.2 Global Variables

6.2.1 kFormatDerEncoded

Kind:variable
Header file:#include "ara/crypto/common/serializable.h"
Scope:namespace ara::crypto
Symbol:kFormatDerEncoded
Type:FormatId
Syntax:constexpr FormatId kFormatDerEncoded {2};
Description:Export DER-encoded value of an object.

6.2.2 kFormatPemEncoded

Kind:variable
Header file:#include "ara/crypto/common/serializable.h"
Scope:namespace ara::crypto
Symbol:kFormatPemEncoded
Type:FormatId
Syntax:constexpr FormatId kFormatPemEncoded {3};
Description:Export PEM-encoded value of an object.

6.2.3 kFormatRawValueOnly

Kind:variable
Header file:#include "ara/crypto/common/serializable.h"
Scope:namespace ara::crypto
Symbol:kFormatRawValueOnly
Type:FormatId
Syntax:constexpr FormatId kFormatRawValueOnly {1};
Description:Export only raw value of an object, i.e., a plain byte array for symmetric keys and ISO/IEC 7816-8 / IEEE P1363 encoding for combined values.

6.2.4 kProprietaryFormat

Kind:variable
Header file:#include "ara/crypto/common/serializable.h"
Scope:namespace ara::crypto
Symbol:kProprietaryFormat
Type:FormatId
Syntax:constexpr FormatId kProprietaryFormat {0};
Description:Proprietary format that is only valid in the context of a CryptoProvider.

6.3 Class: Serializable

Kind:class
Header file:#include "ara/crypto/common/serializable.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto
Symbol:Serializable
Syntax:class Serializable {...};
Description:Serializable object interface.

6.3.1 Public Member Functions

6.3.1.1 Special Member Functions
6.3.1.1.1 Move Constructor
Kind:function
Header file:#include "ara/crypto/common/serializable.h"
Scope:ara::crypto::Serializable
Syntax:Serializable (Serializable &&)=delete;
Description:Move-Constructor.
6.3.1.1.2 Copy Constructor
Kind:function
Header file:#include "ara/crypto/common/serializable.h"
Scope:ara::crypto::Serializable
Syntax:Serializable (const Serializable &)=delete;
Description:Copy-Constructor.
6.3.1.1.3 Copy Assignment Operator
Kind:function
Header file:#include "ara/crypto/common/serializable.h"
Scope:ara::crypto::Serializable
Syntax:ara::crypto::Serializable & operator= (const ara::crypto::Serializable &other)=delete;
Description:Copy-assign another Serializable to this instance.
6.3.1.1.4 Move Assignment Operator
Kind:function
Header file:#include "ara/crypto/common/serializable.h"
Scope:ara::crypto::Serializable
Syntax:ara::crypto::Serializable & operator= (ara::crypto::Serializable &&other)=delete;
Description:Move-assign another Serializable to this instance.
6.3.1.1.5 Destructor
Kind:function
Header file:#include "ara/crypto/common/serializable.h"
Scope:ara::crypto::Serializable
Syntax:virtual ~Serializable () noexcept=default;
Exception Safety:exception safe
Description:Destructor.
6.3.1.2 Member Functions
6.3.1.2.1 ExportPublicly
Kind:function
Header file:#include "ara/crypto/common/serializable.h"
Scope:ara::crypto::Serializable
Syntax:virtual ara::core::Result< std::size_t > ExportPublicly (ara::crypto::ReadWriteMemRegion out, ara::crypto::FormatId format) const noexcept=0;
Parameters (in):formatidentifier of the output format
Parameters (out):outan output buffer that the serialized object will be written to
Return value:ara::core::Result< std::size_t >A result containing the size in bytes of the serialized object or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified format ID is not supported for this object type
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if exporting the object is not supported
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the object to be exported is a key and the allowed usage of the key does not include kAllowPlaintextExport
Description:Serialize object using the provided format.
6.3.1.2.2 GetExportSize
Kind:function
Header file:#include "ara/crypto/common/serializable.h"
Scope:ara::crypto::Serializable
Syntax:virtual ara::core::Result< std::size_t > GetExportSize (ara::crypto::FormatId format) const noexcept=0;
Parameters (in):formatidentifier of the output format
Return value:ara::core::Result< std::size_t >A result containing the size in bytes of the serialized object or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified format ID is not supported for this object type
Description:Get the size in bytes of the object when serialized in the provided format using ExportPublicly()

7 Header: ara/crypto/cryp/auth_cipher_ctx.h

7.1 Class: AuthCipherCtx

Kind:class
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:AuthCipherCtx
Base class:CryptoContext
Syntax:class AuthCipherCtx : public CryptoContext {...};
Description:Authenticated Cipher Context interface.

7.1.1 Public Member Types

7.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<AuthCipherCtx>;
Description:Smart pointer of the interface.

7.1.2 Public Member Functions

7.1.2.1 Member Functions
7.1.2.1.1 Cancel
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< void > Cancel () noexcept=0;
Return value:ara::core::Result< void >an empty result if the ongoing streaming operation was cancelled successfully, or a result containing an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
Description:Cancel the ongoing streaming operation that has been initiated by Start() and has not yet been finished.
7.1.2.1.2 EncryptSingleCallWithOutputIv
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< std::size_t > EncryptSingleCallWithOutputIv (ReadOnlyMemRegion dataIn, ReadWriteMemRegion dataOut, ReadWriteMemRegion tag, ReadWriteMemRegion ivOut, ara::core::Optional< ReadOnlyMemRegion > authenticatedData) noexcept=0;
Parameters (in):dataInan input data buffer containing the plaintext/ciphertext
authenticatedDataoptional additional authenticated data
Parameters (out):dataOutan output data buffer that contains en-/decrypted data
ivOutan output data buffer that the initialization vector (IV) generated by the context will be written to
Parameters (inout):tagfor decryption: an input data buffer that contains the authentication tag. for encryption: an output data buffer that the authentication tag is written to.
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if single shot processing is not supported by the context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context requires setting an IV
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if SetKey has not been successfully called before
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if a KeySlot has been configured, but is currently busy
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the SymmetricKey deployed or contained in the provided KeySlot at the time of invocation of this interface does not include kAllowDataEncrypt for encryption, or kAllowDataDecrypt for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if a KeySlot has been configured, but does not contain a SymmetricKey
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if a KeySlot has been configured, but the SymmetricKey contained is not supported by this context
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of provided input buffer or authentication tag is invalid
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the data or IV output buffer is too small
ara::crypto::CryptoErrc::kAuthTagNotValidrollback_semantics
if the transformDirection is kDecrypt and the processed data cannot be authenticated
Description:Perform encryption and calculate/verify of the authentication tag in a single-call and return an IV generated by the context.
7.1.2.1.3 Finish
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< std::size_t > Finish (ReadOnlyMemRegion in, ReadWriteMemRegion out, ReadWriteMemRegion tag) noexcept=0;
Parameters (in):inan input data buffer that contains a part of the plaintext/ciphertext
Parameters (out):outan output data buffer that the en-/decrypted data is written to
Parameters (inout):tagfor decryption: an input data buffer that contains the authentication tag for encryption: an output data buffer that the authentication tag is written to
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing has not been started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer or the authentication tag is invalid
ara::crypto::CryptoErrc::kAuthTagNotValidrollback_semantics
if the processed data cannot be authenticated during decryption
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context or
Description:Finalize the en-/decryption and calculate/verify the authentication tag without returning an IV.
7.1.2.1.4 FinishEncrypt
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< std::size_t > FinishEncrypt (ReadOnlyMemRegion in, ReadWriteMemRegion out, ReadWriteMemRegion tag, ReadWriteMemRegion ivOut) noexcept=0;
Parameters (in):inan input data buffer that contains a part of the plaintext/ciphertext
Parameters (out):outan output data buffer that the en-/decrypted data is written to
ivOutan output data buffer that contains the IV
Parameters (inout):tagfor decryption: an input data buffer that contains the authentication tag for encryption: an output data buffer that the authentication tag is written to
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing has not been started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer or the authentication tag is invalid
ara::crypto::CryptoErrc::kAuthTagNotValidrollback_semantics
if the processed data cannot be authenticated during decryption
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context or if this context does not use an IV or if the IV has been provided by the application in the Start() function
Description:Finalize the encryption and calculate the authentication tag and return the IV generated by the context.
7.1.2.1.5 GetMaxAssociatedDataSize
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< std::size_t > GetMaxAssociatedDataSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >maximal supported size of associated public data in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this interface is not supported
Description:Get maximum supported size of associated public data.
7.1.2.1.6 GetMaximumChunkSize
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< std::size_t > GetMaximumChunkSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >the maximum buffer size in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this interface is not supported
Description:Get the maximum input buffer size supported for processing in single calls to Update(), Finish(), FinishEncrypt() or ProcessSingleCall() by this context.
7.1.2.1.7 GetMaximumInputIvSize
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< std::size_t > GetMaximumInputIvSize (CryptoTransform transformDirection) const noexcept=0;
Parameters (in):transformDirectionthe transformation direction, i.e., encryption or decryption
Return value:ara::core::Result< std::size_t >size of IV in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this interface is not supported
Description:Get the maximum IV size required to be passed to the context in the functions Start() and ProcessSingleCallWithInputIv() for the given transformDirection.
7.1.2.1.8 GetMinimumChunkSize
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< std::size_t > GetMinimumChunkSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >the minimum buffer size in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this interface is not supported
Description:Get the minimum input buffer size supported for processing in single calls to Update(), Finish(), FinishEncrypt() or ProcessSingleCall() by this context.
7.1.2.1.9 GetMinimumInputIvSize
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< std::size_t > GetMinimumInputIvSize (CryptoTransform transformDirection) const noexcept=0;
Parameters (in):transformDirectionthe transformation direction, i.e., encryption or decryption
Return value:ara::core::Result< std::size_t >size of IV in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this interface is not supported
Description:Get the minimum IV size required to be passed to the context in the functions Start() and ProcessSingleCallWithInputIv() for the given transformDirection.
7.1.2.1.10 GetOutputIvSize
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< std::size_t > GetOutputIvSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >size of IV in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this interface is not supported
Description:Get the output IV size that will be returned by the functions FinishEncrypt() (in case no IV has been provided by the application during the call to Start()), and EncryptSingleCallWithOutputIv().
7.1.2.1.11 GetRequiredOutputBufferSize
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< std::size_t > GetRequiredOutputBufferSize (std::size_t inputSize, bool isFinal) const noexcept;
Parameters (in):inputSizesize of input data
isFinalif true, calculate maximum required output buffer size for Finish(), FinishEncrypt() and ProcessSingleCall() otherwise for Update()
Return value:ara::core::Result< std::size_t >a result containing the required capacity of the output buffer (in bytes) or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key and setting the transformation direction
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this interface is not supported
Description:Calculate the maximum required size of the output buffer depending on the input size in the current state of the context.
7.1.2.1.12 GetTagSize
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< std::size_t > GetTagSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >size of the authentication tag in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this interface is not supported
Description:Get the output tag size.
7.1.2.1.13 ProcessSingleCall
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< std::size_t > ProcessSingleCall (ReadOnlyMemRegion dataIn, ReadWriteMemRegion dataOut, ReadWriteMemRegion tag, CryptoTransform transformDirection, ara::core::Optional< ReadOnlyMemRegion > authenticatedData) noexcept=0;
Parameters (in):dataInan input data buffer containing the plaintext/ciphertext
transformDirectionthe transformation direction, i.e., encryption or decryption
authenticatedDataoptional additional authenticated data
Parameters (out):dataOutan output data buffer that contains en-/decrypted data
Parameters (inout):tagfor decryption: an input data buffer that contains the authentication tag. for encryption: an output data buffer that the authentication tag is written to.
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if single shot processing is not supported by the context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context requires setting or returning an IV
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if SetKey has not been successfully called before
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if a KeySlot has been configured, but is currently busy
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the SymmetricKey deployed or contained in the provided KeySlot at the time of invocation of this interface does not include kAllowDataEncrypt for encryption, or kAllowDataDecrypt for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if a KeySlot has been configured, but does not contain a SymmetricKey
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if a KeySlot has been configured, but the SymmetricKey contained is not supported by this context
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of provided input buffer or authentication tag is invalid
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kAuthTagNotValidrollback_semantics
if the transformDirection is kDecrypt and the processed data cannot be authenticated
Description:Perform en-/decryption and calculate/verify of the authentication tag in a single-call without setting or returning an IV.
7.1.2.1.14 ProcessSingleCallWithInputIv
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< std::size_t > ProcessSingleCallWithInputIv (ReadOnlyMemRegion dataIn, ReadWriteMemRegion dataOut, ReadWriteMemRegion tag, CryptoTransform transformDirection, ReadOnlyMemRegion iv, ara::core::Optional< ReadOnlyMemRegion > authenticatedData) noexcept=0;
Parameters (in):dataInan input data buffer containing the plaintext/ciphertext
transformDirectionthe transformation direction, i.e., encryption or decryption
ivan Initialization Vector (IV) or "nonce" value
authenticatedDataoptional additional authenticated data
Parameters (out):dataOutan output data buffer that contains en-/decrypted data
Parameters (inout):tagfor decryption: an input data buffer that contains the authentication tag. for encryption: an output data buffer that the authentication tag is written to.
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if single shot processing is not supported by the context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context requires setting or returning an IV
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if SetKey has not been successfully called before
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if a KeySlot has been configured, but is currently busy
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the SymmetricKey deployed or contained in the provided KeySlot at the time of invocation of this interface does not include kAllowDataEncrypt for encryption, or kAllowDataDecrypt for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if a KeySlot has been configured, but does not contain a SymmetricKey
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if a KeySlot has been configured, but the SymmetricKey contained is not supported by this context
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of provided input buffer, authentication tag, or IV is invalid
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the data or IV output buffer is too small
ara::crypto::CryptoErrc::kAuthTagNotValidrollback_semantics
if the transformDirection is kDecrypt and the processed data cannot be authenticated
Description:Perform en-/decryption and calculate/verify of the authentication tag in a single-call, providing an IV to be used during en-/decryption.
7.1.2.1.15 SetKey(KeySlot::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlota keyslot containing a symmetric key
Return value:ara::core::Result< void >an empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a SymmetricKey
Description:The interface shall configure the context to use the key stored in the provided KeySlot when the authenticated encrypt or decrypt operation is executed.
7.1.2.1.16 SetKey(SymmetricKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::SymmetricKey::Sptr key) noexcept=0;
Parameters (in):keysymmetric key object used for authenticated en-/decryption
Return value:ara::core::Result< void >an empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a KeySlot
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided SymmetricKey is incompatible with this AuthCipherCtx
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the provided SymmetricKey does not include kAllowDataEncrypt for encryption, or kAllowDataDecrypt for decryption, respectively
Description:The interface shall configure the context to use the provided SymmetricKey.
7.1.2.1.17 Start(CryptoTransform, ReadOnlyMemRegion)
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< void > Start (CryptoTransform transformDirection, ReadOnlyMemRegion iv) noexcept=0;
Parameters (in):transformDirectionthe transformation direction, i.e., encryption or decryption
ivan Initialization Vector (IV) or "nonce" value. The allowed size of the IV can be queried using the functions GetMinimumInputIvSize() and GetMaximumInputIvSize().
Return value:ara::core::Result< void >an empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support setting an IV in the given transformDirection
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if SetKey has not been successfully called before
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the configured KeySlot is currently busy
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the SymmetricKey deployed or contained in the provided KeySlot at the time of invocation of this interface does not include kAllowDataEncrypt for encryption, or kAllowDataDecrypt for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if a KeySlot has been configured, but does not contain a SymmetricKey
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if a KeySlot has been configured, but the SymmetricKey contained is not supported by this context
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of provided IV is not supported
Description:Initialize the context for a new encryption or decryption and set the IV used by the context.
7.1.2.1.18 Start(CryptoTransform)
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< void > Start (CryptoTransform transformDirection) noexcept=0;
Parameters (in):transformDirectionthe transformation direction, i.e., encryption or decryption
Return value:ara::core::Result< void >an empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context requires setting an IV in the given transformDirection
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if SetKey has not been successfully called before
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if a KeySlot has been configured, but is currently busy
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the SymmetricKey deployed or contained in the provided KeySlot at the time of invocation of this interface does not include kAllowDataEncrypt for encryption, or kAllowDataDecrypt for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if a KeySlot has been configured, but does not contain a SymmetricKey
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if a KeySlot has been configured, but the SymmetricKey contained is not supported by this context
Description:Initialize the context for a new encryption or decryption. An IV is either not required for this context in this transformation direction, or set by the context itself.
7.1.2.1.19 UpdateAuthenticatedData
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< void > UpdateAuthenticatedData (ReadOnlyMemRegion authenticatedData) noexcept=0;
Parameters (in):authenticatedDataa part of the additional authenticated data
Return value:ara::core::Result< void >an empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if the processing was not initiated by a call of the Start() method
ara::crypto::CryptoErrc::kInvalidUsageOrderrollback_semantics
if UpdateConfidentialData has already been called
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer is invalid
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context
Description:Update the tag calculation by a new chunk of additional authenticated data.
7.1.2.1.20 UpdateConfidentialData
Kind:function
Header file:#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scope:ara::crypto::cryp::AuthCipherCtx
Syntax:virtual ara::core::Result< std::size_t > UpdateConfidentialData (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;
Parameters (in):inan input data buffer containing a part of the ciphertext or plaintext
Parameters (out):outan output data buffer that the encrypted or decrypted data is written too
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer is invalid
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context
Description:Encrypt or decrypt confidential data. When used for decryption, the plaintext is returned without verifying its authenticity. An application must not use the data before verifying its authenticity using Finish().

8 Header: ara/crypto/cryp/crypto_context.h

8.1 Class: CryptoContext

Kind:class
Header file:#include "ara/crypto/cryp/crypto_context.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:CryptoContext
Syntax:class CryptoContext {...};
Description:A common interface of a mutable cryptographic context, i.e. that is not binded to a single crypto object.

8.1.1 Public Member Functions

8.1.1.1 Special Member Functions
8.1.1.1.1 Copy Constructor
Kind:function
Header file:#include "ara/crypto/cryp/crypto_context.h"
Scope:ara::crypto::cryp::CryptoContext
Syntax:CryptoContext (const CryptoContext &)=delete;
Description:Copy-Constructor.
8.1.1.1.2 Move Constructor
Kind:function
Header file:#include "ara/crypto/cryp/crypto_context.h"
Scope:ara::crypto::cryp::CryptoContext
Syntax:CryptoContext (CryptoContext &&)=delete;
Description:Move-Constructor.
8.1.1.1.3 Copy Assignment Operator
Kind:function
Header file:#include "ara/crypto/cryp/crypto_context.h"
Scope:ara::crypto::cryp::CryptoContext
Syntax:ara::crypto::cryp::CryptoContext & operator= (const ara::crypto::cryp::CryptoContext &other)=delete;
Description:Copy-assign another CryptoContext to this instance.
8.1.1.1.4 Move Assignment Operator
Kind:function
Header file:#include "ara/crypto/cryp/crypto_context.h"
Scope:ara::crypto::cryp::CryptoContext
Syntax:ara::crypto::cryp::CryptoContext & operator= (ara::crypto::cryp::CryptoContext &&other)=delete;
Description:Move-assign another CryptoContext to this instance.
8.1.1.1.5 Destructor
Kind:function
Header file:#include "ara/crypto/cryp/crypto_context.h"
Scope:ara::crypto::cryp::CryptoContext
Syntax:virtual ~CryptoContext () noexcept=default;
Exception Safety:exception safe
Description:Destructor.
8.1.1.2 Member Functions
8.1.1.2.1 GetAlgId
Kind:function
Header file:#include "ara/crypto/cryp/crypto_context.h"
Scope:ara::crypto::cryp::CryptoContext
Syntax:virtual ara::core::Result< ara::crypto::AlgIdString > GetAlgId () const noexcept=0;
Return value:ara::core::Result< ara::crypto::AlgIdString >the AlgId of the context or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:The interface shall return the AlgId of the context.

9 Header: ara/crypto/cryp/crypto_provider.h

9.1 Class: CryptoProvider

Kind:class
Port Interfaces:CryptoProviderInterface
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:CryptoProvider
Syntax:class CryptoProvider {...};
Description:CryptoProviderInterface representing one implementation of a set of cryptographic primitives with a key storage.

9.1.1 Public Member Types

9.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<CryptoProvider>;
Description:Shared pointer of the CryptoProvider.

9.1.2 Public Member Functions

9.1.2.1 Special Member Functions
9.1.2.1.1 Move Constructor
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:CryptoProvider (CryptoProvider &&)=delete;
Description:Move-Constructor.
9.1.2.1.2 Copy Constructor
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:CryptoProvider (const CryptoProvider &)=delete;
Description:Copy-Constructor.
9.1.2.1.3 Move Assignment Operator
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:ara::crypto::cryp::CryptoProvider & operator= (ara::crypto::cryp::CryptoProvider &&other)=delete;
Description:Move-assign another CryptoProvider to this instance.
9.1.2.1.4 Copy Assignment Operator
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:ara::crypto::cryp::CryptoProvider & operator= (const ara::crypto::cryp::CryptoProvider &other)=delete;
Description:Copy-assign another CryptoProvider to this instance.
9.1.2.1.5 Destructor
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ~CryptoProvider () noexcept=default;
Exception Safety:exception safe
Description:Destructor.
9.1.2.2 Member Functions
9.1.2.2.1 CreateAuthCipherCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::AuthCipherCtx::Sptr > CreateAuthCipherCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of the target crypto algorithm
Return value:ara::core::Result< AuthCipherCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if algId argument specifies a crypto algorithm different from symmetric authenticated stream cipher
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId argument has an unsupported value
Description:Create a symmetric authenticated cipher context.
9.1.2.2.2 CreateDecryptorPrivateCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::DecryptorPrivateCtx::Sptr > CreateDecryptorPrivateCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of the target asymmetric encryption/decryption algorithm
Return value:ara::core::Result< DecryptorPrivateCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if AlgId argument has an unsupported value
Description:Create a decryption private key context.
9.1.2.2.3 CreateEncryptorPublicCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::EncryptorPublicCtx::Sptr > CreateEncryptorPublicCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of the target asymmetric encryption/decryption algorithm
Return value:ara::core::Result< EncryptorPublicCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if AlgId argument has an unsupported value
Description:Create an encryption public key context.
9.1.2.2.4 CreateHashFunctionCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::HashFunctionCtx::Sptr > CreateHashFunctionCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of the target crypto algorithm
Return value:ara::core::Result< HashFunctionCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if algId argument specifies a crypto algorithm different from hash function
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId argument has an unsupported value
Description:Create a hash function context.
9.1.2.2.5 CreateKeyAgreementPrivateCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::KeyAgreementPrivateCtx::Sptr > CreateKeyAgreementPrivateCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of the target key-agreement crypto algorithm
Return value:ara::core::Result< KeyAgreementPrivateCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if algId argument specifies a crypto algorithm different from key-agreement
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId argument has an unsupported value
Description:Create a key-agreement private key context.
9.1.2.2.6 CreateKeyDecapsulatorPrivateCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::KeyDecapsulatorPrivateCtx::Sptr > CreateKeyDecapsulatorPrivateCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of the target KEM crypto algorithm
Return value:ara::core::Result< KeyDecapsulatorPrivateCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if algId argument specifies a crypto algorithm different from asymmetric KEM
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId argument has an unsupported value
Description:Create a key-decapsulator private context of a Key Encapsulation Mechanism (KEM).
9.1.2.2.7 CreateKeyDerivationFunctionCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::KeyDerivationFunctionCtx::Sptr > CreateKeyDerivationFunctionCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of the target crypto algorithm
Return value:ara::core::Result< KeyDerivationFunctionCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if algId argument specifies a crypto algorithm different from key derivation function
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId argument has an unsupported value
Description:Create a key derivation function context.
9.1.2.2.8 CreateKeyEncapsulatorPublicCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::KeyEncapsulatorPublicCtx::Sptr > CreateKeyEncapsulatorPublicCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of the target KEM crypto algorithm
Return value:ara::core::Result< KeyEncapsulatorPublicCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if algId argument specifies a crypto algorithm different from asymmetric KEM
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId argument has an unsupported value
Description:Create a key-encapsulator public context of a Key Encapsulation Mechanism (KEM).
9.1.2.2.9 CreateMessageAuthnCodeCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::MessageAuthnCodeCtx::Sptr > CreateMessageAuthnCodeCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of the target crypto algorithm
Return value:ara::core::Result< MessageAuthnCodeCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if algId argument specifies a crypto algorithm different from symmetric message authentication code
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId argument has an unsupported value
Description:Create a symmetric message authentication code context.
9.1.2.2.10 CreateProtectedKeyImportCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::ProtectedKeyImportCtx::Sptr > CreateProtectedKeyImportCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of the wrapping algorithm
Return value:ara::core::Result< ProtectedKeyImportCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if algId argument specifies a crypto algorithm that is not supported by this CryptoProvider for wrapping
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId argument has an unsupported value
Description:The interface shall create a protected key import context.
9.1.2.2.11 CreateRandomGeneratorCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::RandomGeneratorCtx::Sptr > CreateRandomGeneratorCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of target RNG algorithm. If no algId is given, the default RNG is returned
Return value:ara::core::Result< RandomGeneratorCtx::Sptr >result containing a shared pointer to the context or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId argument has an unsupported value
Description:Create a Random Number Generator (RNG) context.
9.1.2.2.12 CreateSignerPrivateCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::SignerPrivateCtx::Sptr > CreateSignerPrivateCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of the target signature crypto algorithm
Return value:ara::core::Result< SignerPrivateCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if algId argument specifies a crypto algorithm different from private key signature
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId argument has an unsupported value
Description:Create a signature private key context.
9.1.2.2.13 CreateSymmetricCipherCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::SymmetricCipherCtx::Sptr > CreateSymmetricCipherCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of the target crypto algorithm
Return value:ara::core::Result< SymmetricCipherCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if AlgId argument has an unsupported value
Description:Create a symmetric cipher context.
9.1.2.2.14 CreateSymmetricKeyWrapperCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::SymmetricKeyWrapperCtx::Sptr > CreateSymmetricKeyWrapperCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of the target crypto algorithm
Return value:ara::core::Result< SymmetricKeyWrapperCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId argument has an unsupported value
Description:Create a symmetric key-wrap algorithm context.
9.1.2.2.15 CreateVerifierPublicCtx
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::VerifierPublicCtx::Sptr > CreateVerifierPublicCtx (AlgId algId) noexcept=0;
Parameters (in):algIdidentifier of the target signature crypto algorithm
Return value:ara::core::Result< VerifierPublicCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if algId argument specifies a crypto algorithm different from public key signature verification
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId argument has an unsupported value
Description:Create a signature verification public key context.
9.1.2.2.16 ExportSecuredKey
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< std::size_t > ExportSecuredKey (AlgId algId, ara::crypto::cryp::CryptoObject::Sptr key, ReadWriteMemRegion resultBuffer, ara::core::Optional< ara::crypto::cryp::SymmetricKey::Sptr > kek) noexcept=0;
Parameters (in):algIdthe algId of the secure key export algorithm
keythe key to be exported
resultBufferan output buffer the securely exported key is written to
kekan optional key-encryption-key to be be used for wrapping the secured payload. Only used if the used algorithm does not determine the used key (e.g., based on configuration).
Return value:ara::core::Result< std::size_t >a result containing the size of the result written into resultBuffer or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId has an unsupported value
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the key object cannot be wrapped (e.g., invalid size or type) or if a kek is expected but not provided.
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of key or kek is incompatible to the used algorithm
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics
if the kek is incompatible to the used algorithm
Description:The interface shall format the data referenced by the specified key, securely wrap this payload and serialize the secured payload into the provided output buffer. The format shall be specified implicitly by the AlgId. The formatted payload shall be wrapped according to the specified algId using the kek; if kek is not provided, ExportSecuredKey shall apply a key-encryption-key implictly defined by the algId or the default key-encryption-key of the CryptoProvider.
9.1.2.2.17 GeneratePrivateKey
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::PrivateKey::Sptr > GeneratePrivateKey (AlgId algId, AllowedUsageFlags privateKeyAllowedUsage) noexcept=0;
Parameters (in):algIdthe identifier of the target crypto algorithm
privateKeyAllowedUsagethe flags that define a list of allowed transformations' types in which the private key can be used
Return value:ara::core::Result< PrivateKey::Sptr >result containing a shared pointer to the created private key or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId has an unsupported value
ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics
if the allowedUsage is incompatible with the algId or the key type
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Description:Generate a new public/private key pair and return the private key. The public key can be retrieved via the function SWS_CRYPT_22511.ara::crypto::cryp::PrivateKey::GetPublicKey The allowed usage flags of the Public Key are set based on the allowed usage of the PrivateKey:
• ara::crypto.kAllowDataDecryption --> ara::crypto.kAllowDataEncryption
• ara::crypto.kAllowSigGeneration --> ara::crypto.kAllowSigVerification
• ara::crypto.kAllowKeyAgreement --> ara::crypto.kAllowKeyAgreement
• ara::crypto.kAllowKeyUnwrapping --> ara::crypto.kAllowKeyWrapping
Additionally, the allowed usage:
• ara::crypto.kAllowPlaintextExport
• ara::crypto.kAllowPersist
are set for the public key.
9.1.2.2.18 GenerateRandomData
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< void > GenerateRandomData (ReadWriteMemRegion randomData) noexcept=0;
Parameters (out):randomDataoutput data buffer to be filled with random data
Return value:ara::core::Result< void >an empty result or a result containing an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the used RNG is currently out-of-entropy and therefore cannot provide the requested number of random bytes
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if no default RNG is supported by the CryptoProvider
Description:Fill the provided output data buffer randomData with random data.
9.1.2.2.19 GenerateSymmetricKey
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::SymmetricKey::Sptr > GenerateSymmetricKey (AlgId algId, AllowedUsageFlags allowedUsage) noexcept=0;
Parameters (in):algIdthe identifier of the target symmetric crypto algorithm
allowedUsagethe flags that define a list of allowed transformations' types in which the generated key can be used
Return value:ara::core::Result< SymmetricKey::Sptr >result containing a shared pointer to the created symmetric key object or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId has an unsupported value
ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics
if the allowedUsage is incompatible with the algId or the key type
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Description:Generate a new symmetric key.
9.1.2.2.20 GetDefaultAllowedUsage
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< AllowedUsageFlags > GetDefaultAllowedUsage (AlgId algId) noexcept=0;
Parameters (in):algIdthe identifier of the target crypto algorithm
Return value:ara::core::Result< AllowedUsageFlags >result containing a CryptoProvider specific default set of allowedUsages or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId has an unsupported value
Description:Get a CryptoProvider specific default set of allowedUsages for the provided AlgId. The returned allowedUsages shall not contain ara::crypto.kAllowPlaintextExport, ara::crypto.kAllowPersist and ara::crypto.kAllowSecuredExport.
9.1.2.2.21 GetProviderID
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< void > GetProviderID (ara::core::Optional< ReadOnlyMemRegion > in, ReadWriteMemRegion idData) noexcept=0;
Parameters (in):inOptional input data required by some identification protocols (e.g. SHE/CMD_GET_ID)
Parameters (out):idDatathe identification data of the provider
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this provider does not support identification
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the provided ReadWriteMemRegion parameter idData is insufficient in size to hold the identification data
Description:Obtain provider specific identification data.
9.1.2.2.22 GetProviderIdSize
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< std::size_t > GetProviderIdSize () noexcept=0;
Return value:ara::core::Result< std::size_t >a result containing the required size of ID data in bytes or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this provider does not support identification
Description:Get the required size of the output buffer for ID data used by GetProviderID.
9.1.2.2.23 GetSecureCounter
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:ara::core::Result< SecureCounter > GetSecureCounter () noexcept;
Return value:ara::core::Result< SecureCounter >a result containing a SecureCounter struct made up of the two unsigned 64 bit values (LSQW and MSQW), or an error:
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the Secure Counter is not supported by the CryptoProvider
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
Description:Get the current value of the secure counter of this CryptoProvider. The current counter value is guaranteed to be stricly larger than any previously returned counter value.
9.1.2.2.24 ImportPrivateKey
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::PrivateKey::Sptr > ImportPrivateKey (ReadOnlyMemRegion serialized, AllowedUsageFlags allowedUsage, FormatId formatId, ara::core::Optional< AlgId > algId) noexcept=0;
Parameters (in):serializedthe memory region that contains the serialized key
allowedUsagethe allowedUsage of the key
formatIdthe serialization format
algIdan optional alg ID of the key. Not required if the serialization format already identifies the required properties of the key.
Return value:ara::core::Result< PrivateKey::Sptr >result containing a shared pointer to the created key or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if serialized does not conform to the specified format
ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics
if the allowedUsage is incompatible with the algId
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the CryptoProvider does not support the requested function
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified format ID is not supported for this object type
Description:Import a serialized private key.
9.1.2.2.25 ImportPublicKey
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::PublicKey::Sptr > ImportPublicKey (ReadOnlyMemRegion serialized, AllowedUsageFlags allowedUsage, FormatId formatId, ara::core::Optional< AlgId > algId) noexcept=0;
Parameters (in):serializedthe memory region that contains the serialized key
allowedUsagethe allowedUsage of the key
formatIdthe serialization format
algIdan optional alg ID of the key. Not required if the serialization format already identifies the required properties of the key.
Return value:ara::core::Result< PublicKey::Sptr >result containing a shared pointer to the created key or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if serialized does not conform to the specified format
ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics
if the allowedUsage is incompatible with the algId
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the CryptoProvider does not support the requested function
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified format ID is not supported for this object type
Description:Import a serialized public key.
9.1.2.2.26 ImportSymmetricKey
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::SymmetricKey::Sptr > ImportSymmetricKey (ReadOnlyMemRegion serialized, AllowedUsageFlags allowedUsage, FormatId formatId, ara::core::Optional< AlgId > algId) noexcept=0;
Parameters (in):serializedthe memory region that contains the serialized key
allowedUsagethe allowedUsage of the key
formatIdthe serialization format
algIdan optional alg ID of the key. Not required if the serialization format already identifies the required properties of the key.
Return value:ara::core::Result< SymmetricKey::Sptr >result containing a shared pointer to the created key or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if serialized does not conform to the specified format
ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics
if the allowedUsage is incompatible with the algId
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the CryptoProvider does not support the requested function
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified format ID is not supported for this object type
Description:Import a serialized symmetric key.
9.1.2.2.27 LoadPrivateKey
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::PrivateKey::Sptr > LoadPrivateKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlotthe KeySlot that contains the key for loading
Return value:ara::core::Result< PrivateKey::Sptr >result containing a shared pointer to the loaded key or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if the KeySlot is empty
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the underlying resource belongs to another, incompatible CryptoProvider or contains a different key type
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Description:Load a private key from the provided KeySlot.
9.1.2.2.28 LoadPublicKey
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::PublicKey::Sptr > LoadPublicKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlotthe KeySlot that contains the key for loading
Return value:ara::core::Result< PublicKey::Sptr >result containing a shared pointer to the loaded key or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if the KeySlot is empty
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the underlying resource belongs to another, incompatible CryptoProvider or contains a different key type
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Description:Load a public key from the provided KeySlot.
9.1.2.2.29 LoadSymmetricKey
Kind:function
Header file:#include "ara/crypto/cryp/crypto_provider.h"
Scope:ara::crypto::cryp::CryptoProvider
Syntax:virtual ara::core::Result< ara::crypto::cryp::SymmetricKey::Sptr > LoadSymmetricKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlotthe KeySlot that contains the key for loading
Return value:ara::core::Result< SymmetricKey::Sptr >result containing a shared pointer to the loaded key or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if the KeySlot is empty
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the underlying resource belongs to another, incompatible CryptoProvider or contains a different key type
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Description:Load a symmetric key from the provided KeySlot.

10 Header: ara/crypto/cryp/decryptor_private_ctx.h

10.1 Class: DecryptorPrivateCtx

Kind:class
Header file:#include "ara/crypto/cryp/decryptor_private_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:DecryptorPrivateCtx
Base class:CryptoContext
Syntax:class DecryptorPrivateCtx : public CryptoContext {...};
Description:Interface for asymmetric decryption.

10.1.1 Public Member Types

10.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scope:ara::crypto::cryp::DecryptorPrivateCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<DecryptorPrivateCtx>;
Description:Smart pointer of the interface.

10.1.2 Public Member Functions

10.1.2.1 Member Functions
10.1.2.1.1 Cancel
Kind:function
Header file:#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scope:ara::crypto::cryp::DecryptorPrivateCtx
Syntax:virtual ara::core::Result< void > Cancel () noexcept=0;
Return value:ara::core::Result< void >an empty result if the ongoing streaming operation was cancelled successfully, or a result containing an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
Description:Cancel the ongoing streaming operation that has been initiated by Start() and has not yet been finished.
10.1.2.1.2 Decrypt
Kind:function
Header file:#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scope:ara::crypto::cryp::DecryptorPrivateCtx
Syntax:virtual ara::core::Result< std::size_t > Decrypt (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;
Parameters (in):inan input data buffer containing the ciphertext
Parameters (out):outan output data buffer that the decrypted data is written to
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if single-call decryption is not supported
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided input data contains invalid data
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowDataDecryption
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if type of the key is incompatible to the transformation
Description:Decrypt data in a single-call.
10.1.2.1.3 Finish
Kind:function
Header file:#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scope:ara::crypto::cryp::DecryptorPrivateCtx
Syntax:virtual ara::core::Result< std::size_t > Finish (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;
Parameters (in):inan input data buffer containing a part of the ciphertext
Parameters (out):outan output data buffer that contains decrypted data. The required size of this buffer can be queried using GetRequiredOutputBufferSize()
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided input data contains invalid data
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context
Description:Finalize the decryption.
10.1.2.1.4 GetMaximumChunkSize
Kind:function
Header file:#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scope:ara::crypto::cryp::DecryptorPrivateCtx
Syntax:virtual ara::core::Result< std::size_t > GetMaximumChunkSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >the maximum buffer size in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the maximum input buffer size supported for processing in single calls to Update(), Finish(), or Decrypt() by this context.
10.1.2.1.5 GetMinimumChunkSize
Kind:function
Header file:#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scope:ara::crypto::cryp::DecryptorPrivateCtx
Syntax:virtual ara::core::Result< std::size_t > GetMinimumChunkSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >the minimum buffer size in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the minimum input buffer size supported for processing in single calls to Update(), Finish(), or Decrypt() by this context.
10.1.2.1.6 GetRequiredOutputBufferSize
Kind:function
Header file:#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scope:ara::crypto::cryp::DecryptorPrivateCtx
Syntax:virtual ara::core::Result< std::size_t > GetRequiredOutputBufferSize (std::size_t inputSize, bool isFinal) const noexcept;
Parameters (in):inputSizesize of input data
isFinalif true, calculate maximum required output buffer size for Finish() or Decrypt(), otherwise for Update()
Return value:ara::core::Result< std::size_t >a result containing the required capacity of the output buffer (in bytes) or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key and setting the transformation direction
Description:Calculate the maximum required size of the output buffer depending on the input size in the current state of the context.
10.1.2.1.7 SetKey(PrivateKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scope:ara::crypto::cryp::DecryptorPrivateCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::PrivateKey::Sptr key) noexcept=0;
Parameters (in):keythe PrivateKey to be used for decryption
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a KeySlot
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided key object is incompatible with this context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowDataDecryption
Description:Configure the context to use the provided key.
10.1.2.1.8 SetKey(KeySlot::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scope:ara::crypto::cryp::DecryptorPrivateCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlota keyslot containing a PrivateKey.
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided keyslot is incompatible with this context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a PrivateKey
Description:Configure the context to use the key stored in the provided KeySlot at the time the decryption is started.
10.1.2.1.9 Start
Kind:function
Header file:#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scope:ara::crypto::cryp::DecryptorPrivateCtx
Syntax:virtual ara::core::Result< void > Start () noexcept=0;
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowDataDecryption
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if type of the key is incompatible to the transformation
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context
Description:Initialize the context for a new decryption.
10.1.2.1.10 Update
Kind:function
Header file:#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scope:ara::crypto::cryp::DecryptorPrivateCtx
Syntax:virtual ara::core::Result< std::size_t > Update (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;
Parameters (in):inan input data buffer containing a part of the ciphertext
Parameters (out):outan output data buffer that the decrypted data will be written into. The required size of this buffer can be queried using GetRequiredOutputBufferSize()
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer is invalid
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context
Description:Decrypt a data buffer.

11 Header: ara/crypto/cryp/encryptor_public_ctx.h

11.1 Class: EncryptorPublicCtx

Kind:class
Header file:#include "ara/crypto/cryp/encryptor_public_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:EncryptorPublicCtx
Base class:CryptoContext
Syntax:class EncryptorPublicCtx : public CryptoContext {...};
Description:Interface for asymmetric encryption.

11.1.1 Public Member Types

11.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scope:ara::crypto::cryp::EncryptorPublicCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<EncryptorPublicCtx>;
Description:Smart pointer of the interface.

11.1.2 Public Member Functions

11.1.2.1 Member Functions
11.1.2.1.1 Cancel
Kind:function
Header file:#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scope:ara::crypto::cryp::EncryptorPublicCtx
Syntax:virtual ara::core::Result< void > Cancel () noexcept=0;
Return value:ara::core::Result< void >an empty result if the ongoing streaming operation was cancelled successfully, or a result containing an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
Description:Cancel the ongoing streaming operation that has been initiated by Start() and has not yet been finished.
11.1.2.1.2 Encrypt
Kind:function
Header file:#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scope:ara::crypto::cryp::EncryptorPublicCtx
Syntax:virtual ara::core::Result< std::size_t > Encrypt (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;
Parameters (in):inan input data buffer containing the plaintext
Parameters (out):outan output data buffer that the encrypted data is written to
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if single-call encryption is not supported
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided input data contains invalid data
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowDataEncryption
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if type of the key is incompatible to the transformation
Description:Encrypt data in a single-call.
11.1.2.1.3 Finish
Kind:function
Header file:#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scope:ara::crypto::cryp::EncryptorPublicCtx
Syntax:virtual ara::core::Result< std::size_t > Finish (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;
Parameters (in):inan input data buffer containing a part of the plaintext
Parameters (out):outan output data buffer that contains encrypted data. The required size of this buffer can be queried using GetRequiredOutputBufferSize()
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided input data contains invalid data
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context
Description:Finalize the encryption.
11.1.2.1.4 GetMaximumChunkSize
Kind:function
Header file:#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scope:ara::crypto::cryp::EncryptorPublicCtx
Syntax:virtual ara::core::Result< std::size_t > GetMaximumChunkSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >the maximum buffer size in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the maximum input buffer size supported for processing in single calls to Update(), Finish(), or Encrypt() by this context.
11.1.2.1.5 GetMinimumChunkSize
Kind:function
Header file:#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scope:ara::crypto::cryp::EncryptorPublicCtx
Syntax:virtual ara::core::Result< std::size_t > GetMinimumChunkSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >the minimum buffer size in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the minimum input buffer size supported for processing in single calls to Update(), Finish(), or Encrypt() by this context.
11.1.2.1.6 GetRequiredOutputBufferSize
Kind:function
Header file:#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scope:ara::crypto::cryp::EncryptorPublicCtx
Syntax:virtual ara::core::Result< std::size_t > GetRequiredOutputBufferSize (std::size_t inputSize, bool isFinal) const noexcept;
Parameters (in):inputSizesize of input data
isFinalif true, calculate maximum required output buffer size for Finish() or Encrypt(), otherwise for Update()
Return value:ara::core::Result< std::size_t >a result containing the required capacity of the output buffer (in bytes) or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key and setting the transformation direction
Description:Calculate the maximum required size of the output buffer depending on the input size in the current state of the context.
11.1.2.1.7 SetKey(PublicKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scope:ara::crypto::cryp::EncryptorPublicCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::PublicKey::Sptr key) noexcept=0;
Parameters (in):keythe PublicKey to be used for encryption
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a KeySlot
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided key object is incompatible with this context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowDataEncryption
Description:Configure the context to use the provided key.
11.1.2.1.8 SetKey(KeySlot::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scope:ara::crypto::cryp::EncryptorPublicCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlota keyslot containing a PublicKey.
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided keyslot is incompatible with this context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a PublicKey
Description:Configure the context to use the key stored in the provided KeySlot at the time the encryption is started.
11.1.2.1.9 Start
Kind:function
Header file:#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scope:ara::crypto::cryp::EncryptorPublicCtx
Syntax:virtual ara::core::Result< void > Start () noexcept=0;
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowDataEncryption
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if type of the key is incompatible to the transformation
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context
Description:Initialize the context for a new encryption.
11.1.2.1.10 Update
Kind:function
Header file:#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scope:ara::crypto::cryp::EncryptorPublicCtx
Syntax:virtual ara::core::Result< std::size_t > Update (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;
Parameters (in):inan input data buffer containing a part of the plaintext
Parameters (out):outan output data buffer that the encrypted data will be written into. The required size of this buffer can be queried using GetRequiredOutputBufferSize()
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer is invalid
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context
Description:Encrypt a data buffer.

12 Header: ara/crypto/cryp/hash_function_ctx.h

12.1 Class: HashFunctionCtx

Kind:class
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:HashFunctionCtx
Base class:CryptoContext
Syntax:class HashFunctionCtx : public CryptoContext {...};
Description:Hash function interface.

12.1.1 Public Member Types

12.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<HashFunctionCtx>;
Description:Smart pointer of the interface.

12.1.2 Public Member Functions

12.1.2.1 Member Functions
12.1.2.1.1 CalculateHashDigest
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< std::size_t > CalculateHashDigest (ReadOnlyMemRegion data, ReadWriteMemRegion digest, ara::core::Optional< ReadOnlyMemRegion > iv) const noexcept=0;
Parameters (in):datathe input message that should be processed
ivan optional initialization vector
Parameters (out):digestan output data buffer that the digest will be written into.
Return value:ara::core::Result< std::size_t >A result containing the size in bytes of the digest or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of provided data or IV is not supported
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if single-call operation is not supported, or if the context requires setting an IV but no IV is provided, or if the context does not support setting an IV but an IV is provided
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
Description:Calculate the hash digest and write the the calculated digest into the provided output buffer.
12.1.2.1.2 Cancel
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< void > Cancel () noexcept=0;
Return value:ara::core::Result< void >an empty result if the ongoing streaming operation was cancelled successfully, or a result containing an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
Description:Cancel the ongoing streaming operation that has been initiated by Start() and has not yet been finished.
12.1.2.1.3 Compare
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< bool > Compare (ReadOnlyMemRegion expected) const noexcept=0;
Parameters (in):expectedthe memory region containing an expected digest value
Return value:ara::core::Result< bool >true if the expected byte sequence is identical to the calculated digest
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotFinishedrollback_semantics
if the digest calculation was not finished by a call of the Finish() method
Description:Compare the size and content of the calculated digest against an expected value.
12.1.2.1.4 ExportContextState
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< void > ExportContextState (ReadWriteMemRegion contextState) const noexcept=0;
Parameters (out):contextStatean output data buffer that the state of the context will be written into.
Return value:ara::core::Result< void >An empty result on success or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this context does not support im-/exporting the context state
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
Description:Write the current state of this hash context into the provided output buffer contextState. This function can be used to suspend an ongoing hash operation and resume it at a later point in time.
12.1.2.1.5 Finish
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< void > Finish () noexcept=0;
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidUsageOrderrollback_semantics
the hash calculation has not been started successfully.
Description:Finish the digest calculation.
12.1.2.1.6 GetContextStateSize
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< std::size_t > GetContextStateSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >A result containing required context state buffer size in bytes or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this context does not support im-/exporting the context state
Description:Get the buffer size required to store the state of this context using ExportContextState()
12.1.2.1.7 GetDigest
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< std::size_t > GetDigest (ReadWriteMemRegion digest) const noexcept=0;
Parameters (out):digestan output data buffer that the hash digest will be written into
Return value:ara::core::Result< std::size_t >A result containing the size in bytes of the hash digest or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotFinishedrollback_semantics
if the hash calculation was not finished by a call of the Finish() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
Description:Write the calculated hash digest into the provided output buffer.
12.1.2.1.8 GetDigestSize
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< std::size_t > GetDigestSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >A result containing the size of the output from this digest-function in bytes or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the output digest size.
12.1.2.1.9 GetIntermediateDigest
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< std::size_t > GetIntermediateDigest (ReadWriteMemRegion digest) const noexcept=0;
Parameters (out):digestan output data buffer that the hash digest will be written into
Return value:ara::core::Result< std::size_t >A result containing the size in bytes of the hash digest or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidUsageOrderrollback_semantics
the hash calculation has not been started successfully.
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this context does not support getting an intemediate digest
Description:Calculate the hash digest with the data provided to the hash context and write the calculated hash digest into the provided output buffer. The hash digest is equal to the hash digest returned when calling Finish() and GetDigest(), however, after calling GetIntermediateDigest(), this context can still be updated with additional data.
12.1.2.1.10 GetMaximumChunkSize
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< std::size_t > GetMaximumChunkSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >A result containing the maximum buffer size in bytes or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the maximum input buffer size supported for processing in single calls to Update(), Finish(), or CalculateHashDigest() by this context.
12.1.2.1.11 ImportContextState
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< void > ImportContextState (ReadOnlyMemRegion contextState) noexcept=0;
Parameters (in):contextStatea data buffer that contains a previously exported state of the context
Return value:ara::core::Result< void >An empty result on success or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this context does not support im-/exporting the context state
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the contextState argument contains invalid data
Description:Set the current state of this hash context to the state provided by contextState. This function can be used to resume a previously suspended hash operation. The contextState must have been exported from a HashFunctionCtx with the same AlgorithmId provided by the same CryptoProvider as the current context using the function ExportContextState(). The current state of this context (e.g., any ongoing hash calculation) will be replaced by the state provided to this function.
12.1.2.1.12 Start()
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< void > Start () noexcept=0;
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
the used hash function expects an IV
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
Description:Initialize the context for processing of a hash digest without an IV. Will cancel any ongoing hash calculation.
12.1.2.1.13 Start(ReadOnlyMemRegion)
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< void > Start (ReadOnlyMemRegion iv) noexcept=0;
Parameters (in):ivthe used Initialization Vector (IV)
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
the size of provided IV is not supported
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
the used hash function does not use an IV
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
Description:Initialize the context for processing of a hash digest with an IV. Will cancel any ongoing hash calculation.
12.1.2.1.14 Update(ReadOnlyMemRegion)
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< void > Update (ReadOnlyMemRegion data) noexcept=0;
Parameters (in):dataa part of the input message that should be processed
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if the digest calculation was not initiated by a call of the Start() method
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of provided data is not supported
Description:Update the digest calculation context by a new part of the message.
12.1.2.1.15 Update(CryptoObject::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/hash_function_ctx.h"
Scope:ara::crypto::cryp::HashFunctionCtx
Syntax:virtual ara::core::Result< void > Update (ara::crypto::cryp::CryptoObject::Sptr key) noexcept=0;
Parameters (in):keya part of the input message that should be processed
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if the digest calculation was not initiated by a call of the Start() method
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of provided data is not supported
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if this context does not support hashing of keys
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided key is incompatible with this context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowHashCalculation
Description:Update the digest calculation context by a new part of the message.

13 Header: ara/crypto/cryp/key_agreement_private_ctx.h

13.1 Class: KeyAgreementPrivateCtx

Kind:class
Header file:#include "ara/crypto/cryp/key_agreement_private_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:KeyAgreementPrivateCtx
Base class:CryptoContext
Syntax:class KeyAgreementPrivateCtx : public CryptoContext {...};
Description:Key Agreement Private key Context interface.

13.1.1 Public Member Types

13.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/key_agreement_private_ctx.h"
Scope:ara::crypto::cryp::KeyAgreementPrivateCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<KeyAgreementPrivateCtx>;
Description:Smart pointer of this interface.

13.1.2 Public Member Functions

13.1.2.1 Member Functions
13.1.2.1.1 AgreeKey
Kind:function
Header file:#include "ara/crypto/cryp/key_agreement_private_ctx.h"
Scope:ara::crypto::cryp::KeyAgreementPrivateCtx
Syntax:virtual ara::core::Result< ara::crypto::cryp::SymmetricKey::Sptr > AgreeKey (ara::crypto::cryp::PublicKey::Sptr otherSideKey, AlgId targetAlgId, AllowedUsageFlags allowedUsage) const noexcept=0;
Parameters (in):otherSideKeythe public key of the other side of the Key-Agreement
targetAlgIdidentifier of the symmetric target algorithm
allowedUsagethe allowed usage of the target key
Return value:ara::core::Result< SymmetricKey::Sptr >a result containing either a unique pointer to the SymmetricKey object, which contains the computed shared secret produced by the Key-Agreement algorithm or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key or not all required parameters have been set via SetParameter()
CryptoErrc::kIncompatibleObjectrollback_semantics
if the public key is not compatible to this context
CryptoErrc::kInvalidArgumentrollback_semantics
if the allowed usage flags are invalid for a symmetric key
CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the private or public key do not include kAllowKeyAgreement
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if targetAlgId has an unsupported value
Description:Produce a common symmetric key via execution of the key-agreement algorithm using a private key and a public key of another side.
13.1.2.1.2 SetKey(KeySlot::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/key_agreement_private_ctx.h"
Scope:ara::crypto::cryp::KeyAgreementPrivateCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlota keyslot containing a private key
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided keySlot is incompatible with this context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a PrivateKey
Description:Configure the context to use the key stored in the provided KeySlot at the time the key agreement is performed.
13.1.2.1.3 SetKey(PrivateKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/key_agreement_private_ctx.h"
Scope:ara::crypto::cryp::KeyAgreementPrivateCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::PrivateKey::Sptr key) noexcept=0;
Parameters (in):keythe source key object
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided key object is incompatible with this private key context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowKeyAgreement
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a KeySlot
Description:Configure the context to use the provided key.
13.1.2.1.4 SetParameter(StringView, ReadOnlyMemRegion)
Kind:function
Header file:#include "ara/crypto/cryp/key_agreement_private_ctx.h"
Scope:ara::crypto::cryp::KeyAgreementPrivateCtx
Syntax:virtual ara::core::Result< void > SetParameter (ara::core::StringView parameterName, ReadOnlyMemRegion value) noexcept=0;
Parameters (in):parameterNamean identifier of the parameter
valuean input buffer containing the value of the parameter
Return value:ara::core::Result< void >an empty result on success or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support the parameter
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided parameter value is invalid
Description:Set a parameter of the key agreement identified by parameterName.
13.1.2.1.5 SetParameter(StringView, std::uint64_t)
Kind:function
Header file:#include "ara/crypto/cryp/key_agreement_private_ctx.h"
Scope:ara::crypto::cryp::KeyAgreementPrivateCtx
Syntax:virtual ara::core::Result< void > SetParameter (ara::core::StringView parameterName, std::uint64_t value) noexcept=0;
Parameters (in):parameterNamean identifier of the parameter
valuean unsigned integer containing the value of the parameter
Return value:ara::core::Result< void >an empty result on success or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support the parameter
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided parameter value is invalid
Description:Set a parameter of the key agreement identified by parameterName.

14 Header: ara/crypto/cryp/key_decapsulator_private_ctx.h

14.1 Class: KeyDecapsulatorPrivateCtx

Kind:class
Header file:#include "ara/crypto/cryp/key_decapsulator_private_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:KeyDecapsulatorPrivateCtx
Base class:CryptoContext
Syntax:class KeyDecapsulatorPrivateCtx : public CryptoContext {...};
Description:Asymmetric Key Encapsulation Mechanism (KEM) Private key Context interface.

14.1.1 Public Member Types

14.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/key_decapsulator_private_ctx.h"
Scope:ara::crypto::cryp::KeyDecapsulatorPrivateCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<KeyDecapsulatorPrivateCtx>;
Description:Smart pointer of the interface.

14.1.2 Public Member Functions

14.1.2.1 Member Functions
14.1.2.1.1 Decapsulate
Kind:function
Header file:#include "ara/crypto/cryp/key_decapsulator_private_ctx.h"
Scope:ara::crypto::cryp::KeyDecapsulatorPrivateCtx
Syntax:virtual ara::core::Result< ara::crypto::cryp::SymmetricKey::Sptr > Decapsulate (ReadOnlyMemRegion encapsulatedKey, AlgId algId, AllowedUsageFlags allowedUsage) const noexcept=0;
Parameters (in):encapsulatedKeyan input buffer containing the encapsulated key
algIdthe identifier of the target symmetric crypto algorithm
allowedUsagethe flags that define a list of allowed transformations' types in which the target key can be used
Return value:ara::core::Result< SymmetricKey::Sptr >a result containing a the decapsulated symmetric key object or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by a private key value
CryptoErrc::kInvalidArgumentrollback_semantics
if the format of encapsulatedKey is invalid
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId has an unsupported value
ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics
if the allowedUsage is incompatible with the algId or the key type
ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics
if the algId is incompatible to the encapsulatedKey
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowKeyUnwrapping
Description:Decapsulate the keying data into a new SymmetricKey.
14.1.2.1.2 SetKey(PrivateKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/key_decapsulator_private_ctx.h"
Scope:ara::crypto::cryp::KeyDecapsulatorPrivateCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::PrivateKey::Sptr key) noexcept=0;
Parameters (in):keythe key encapsulation key
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided key object is incompatible with this context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowKeyUnwrapping
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a KeySlot
Description:Configure the context to use the provided key as decapsulation key.
14.1.2.1.3 SetKey(KeySlot::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/key_decapsulator_private_ctx.h"
Scope:ara::crypto::cryp::KeyDecapsulatorPrivateCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlota keyslot containing a private key
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided keySlot is incompatible with this context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a PrivateKey
Description:Configure the context to use the key stored in the provided KeySlot at the time the key decapsulation is performed as encapsulation key.

15 Header: ara/crypto/cryp/key_derivation_function_ctx.h

15.1 Class: KeyDerivationFunctionCtx

Kind:class
Header file:#include "ara/crypto/cryp/key_derivation_function_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:KeyDerivationFunctionCtx
Base class:CryptoContext
Syntax:class KeyDerivationFunctionCtx : public CryptoContext {...};
Description:Key Derivation Function interface.

15.1.1 Public Member Types

15.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/key_derivation_function_ctx.h"
Scope:ara::crypto::cryp::KeyDerivationFunctionCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<KeyDerivationFunctionCtx>;
Description:Smart pointer of the interface.

15.1.2 Public Member Functions

15.1.2.1 Member Functions
15.1.2.1.1 DeriveKey
Kind:function
Header file:#include "ara/crypto/cryp/key_derivation_function_ctx.h"
Scope:ara::crypto::cryp::KeyDerivationFunctionCtx
Syntax:virtual ara::core::Result< ara::crypto::cryp::SymmetricKey::Sptr > DeriveKey (AlgId targetAlgId, AllowedUsageFlags allowedUsage) const noexcept=0;
Parameters (in):targetAlgIdthe identifier of the target symmetric crypto algorithm
allowedUsagethe flags that define a list of allowed usages in which the target key can be used.
Return value:ara::core::Result< SymmetricKey::Sptr >result containing a shared pointer to the created symmetric key object or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if targetAlgId has an unsupported value
ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics
if the allowedUsage of the derived key is incompatible with the targetAlgId.
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context has not been sufficiently initialized
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the source key does not include kAllowKeyDerivation
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowedUsage of the target key includes kAllowPlaintextExport but the allowed usage of the source key does not include kAllowDerivedPlaintextExport
Description:Derive a symmetric key from the provided key material and provided context configuration, e.g., salt, context, IV, iteration count.
15.1.2.1.2 SetKey(KeySlot::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/key_derivation_function_ctx.h"
Scope:ara::crypto::cryp::KeyDerivationFunctionCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlota keyslot containing a symmetric key
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided keySlot is incompatible with this context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a SymmetricKey
Description:Configure the context to use the key stored in the provided KeySlot at the time the key derivation is performed.
15.1.2.1.3 SetKey(SymmetricKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/key_derivation_function_ctx.h"
Scope:ara::crypto::cryp::KeyDerivationFunctionCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::SymmetricKey::Sptr key) noexcept=0;
Parameters (in):keythe source key-material
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided key object is incompatible with this symmetric key context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowKeyDerivation
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a KeySlot
Description:Configure the context to use the provided key.
15.1.2.1.4 SetParameter(StringView, std::uint64_t)
Kind:function
Header file:#include "ara/crypto/cryp/key_derivation_function_ctx.h"
Scope:ara::crypto::cryp::KeyDerivationFunctionCtx
Syntax:virtual ara::core::Result< void > SetParameter (ara::core::StringView parameterName, std::uint64_t value) noexcept=0;
Parameters (in):parameterNamean identifier of the parameter
valuean unsigned integer containing the value of the parameter
Return value:ara::core::Result< void >an empty result on success or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support the parameter
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided parameter value is invalid
Description:Set a parameter of the KDF identified by parameterName.
15.1.2.1.5 SetParameter(StringView, ReadOnlyMemRegion)
Kind:function
Header file:#include "ara/crypto/cryp/key_derivation_function_ctx.h"
Scope:ara::crypto::cryp::KeyDerivationFunctionCtx
Syntax:virtual ara::core::Result< void > SetParameter (ara::core::StringView parameterName, ReadOnlyMemRegion value) noexcept=0;
Parameters (in):parameterNamean identifier of the parameter
valuean input buffer containing the value of the parameter
Return value:ara::core::Result< void >an empty result on success or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support the parameter
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided parameter value is invalid
Description:Set a parameter of the KDF identified by parameterName.
15.1.2.1.6 SetParameter(StringView, SymmetricKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/key_derivation_function_ctx.h"
Scope:ara::crypto::cryp::KeyDerivationFunctionCtx
Syntax:virtual ara::core::Result< void > SetParameter (ara::core::StringView parameterName, ara::crypto::cryp::SymmetricKey::Sptr value) noexcept=0;
Parameters (in):parameterNamean identifier of the parameter
valueSymmetricKey being used as the input parameter
Return value:ara::core::Result< void >an empty result on success or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support the parameter
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided key is incompatible with this context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowKeyDerivation
Description:Set a parameter of the KDF identified by parameterName.

16 Header: ara/crypto/cryp/key_encapsulator_public_ctx.h

16.1 Class: KeyEncapsulatorPublicCtx

Kind:class
Header file:#include "ara/crypto/cryp/key_encapsulator_public_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:KeyEncapsulatorPublicCtx
Base class:CryptoContext
Syntax:class KeyEncapsulatorPublicCtx : public CryptoContext {...};
Description:Asymmetric Key Encapsulation Mechanism (KEM) Public key Context interface.

16.1.1 Public Member Types

16.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/key_encapsulator_public_ctx.h"
Scope:ara::crypto::cryp::KeyEncapsulatorPublicCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<KeyEncapsulatorPublicCtx>;
Description:Smart pointer of the interface.

16.1.2 Public Member Functions

16.1.2.1 Member Functions
16.1.2.1.1 Encapsulate(SymmetricKey::Sptr, ReadWriteMemRegion)
Kind:function
Header file:#include "ara/crypto/cryp/key_encapsulator_public_ctx.h"
Scope:ara::crypto::cryp::KeyEncapsulatorPublicCtx
Syntax:virtual ara::core::Result< std::size_t > Encapsulate (ara::crypto::cryp::SymmetricKey::Sptr key, ReadWriteMemRegion encapsulatedKey) const noexcept=0;
Parameters (in):keythe symmetric key to be encapsulated
Parameters (out):encapsulatedKeyan output buffer the encapsulated key is written to
Return value:ara::core::Result< std::size_t >a result containing the size of the encapsulated key or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by a public key value
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the encapsulation key does not include kAllowKeyWrapping or if the allowed usage of the encapsulated key does not include kAllowSecuredExport
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided encapsulated key object is incompatible with this context
CryptoErrc::kInvalidInputSizerollback_semantics
if this context does not support the size of the encapsulated key
CryptoErrc::kUnsupportedrollback_semantics
if this context does not support setting the encapsulated key, because it generates the key during encapsulation
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowKeyWrapping
Description:Encapsulate the provided symmetric key.
16.1.2.1.2 Encapsulate(AlgId, AllowedUsageFlags, ReadWriteMemRegion)
Kind:function
Header file:#include "ara/crypto/cryp/key_encapsulator_public_ctx.h"
Scope:ara::crypto::cryp::KeyEncapsulatorPublicCtx
Syntax:virtual ara::core::Result< std::pair< std::size_t, SymmetricKey::Sptr > > Encapsulate (AlgId algId, AllowedUsageFlags allowedUsage, ReadWriteMemRegion encapsulatedKey) const noexcept=0;
Parameters (in):algIdthe identifier of the target symmetric crypto algorithm
allowedUsagethe flags that define a list of allowed transformations' types in which the target key can be used
Parameters (out):encapsulatedKeyan output buffer the encapsulated key is written to
Return value:ara::core::Result< std::pair< std::size_t, SymmetricKey::Sptr > >a result containing a pair of the size of the encapsulated key and the generated symmetric key or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by a public key value
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the encapsulation key does not include kAllowKeyWrapping or if the allowed usage of the encapsulated key does not include kAllowSecuredExport
CryptoErrc::kInvalidInputSizerollback_semantics
if this context does not support the size of the encapsulated key
CryptoErrc::kUnsupportedrollback_semantics
if this context does not support generating the encapsulated key during encapsulation
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if algId has an unsupported value
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured via SetKey that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowKeyWrapping
Description:Generate new a symmetric key and encapsulate it. Optionally store the generated key.
16.1.2.1.3 GetRequiredOutputBufferSize
Kind:function
Header file:#include "ara/crypto/cryp/key_encapsulator_public_ctx.h"
Scope:ara::crypto::cryp::KeyEncapsulatorPublicCtx
Syntax:virtual ara::core::Result< std::size_t > GetRequiredOutputBufferSize (AlgId algId) const noexcept;
Parameters (in):algIdthe algId of the key to encapsulate
Return value:ara::core::Result< std::size_t >a result containing the required capacity of the output buffer in bytes or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
Description:Calculate the maximum required size of the output buffer depending on the input size in the current state of the context.
16.1.2.1.4 SetKey(PublicKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/key_encapsulator_public_ctx.h"
Scope:ara::crypto::cryp::KeyEncapsulatorPublicCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::PublicKey::Sptr key) noexcept=0;
Parameters (in):keythe key encapsulation key
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided key object is incompatible with this context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowKeyWrapping
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a KeySlot
Description:Configure the context to use the provided key as encapsulation key.
16.1.2.1.5 SetKey(KeySlot::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/key_encapsulator_public_ctx.h"
Scope:ara::crypto::cryp::KeyEncapsulatorPublicCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlota keyslot containing a public key
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided keySlot is incompatible with this context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a PublicKey
Description:Configure the context to use the key stored in the provided KeySlot at the time the key encapsulation is performed.

17 Header: ara/crypto/cryp/keyslot.h

17.1 Class: KeySlot

Kind:class
Port Interfaces:CryptoKeySlotClientInterface
Header file:#include "ara/crypto/cryp/keyslot.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:KeySlot
Syntax:class KeySlot {...};
Description:KeySlot interface representing a storage location for a key in a CryptoProvider.

17.1.1 Public Member Types

17.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/keyslot.h"
Scope:ara::crypto::cryp::KeySlot
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<KeySlot>;
Description:Smart pointer of the interface.

17.1.2 Public Member Functions

17.1.2.1 Special Member Functions
17.1.2.1.1 Copy Constructor
Kind:function
Header file:#include "ara/crypto/cryp/keyslot.h"
Scope:ara::crypto::cryp::KeySlot
Syntax:KeySlot (const KeySlot &)=delete;
Description:Copy-Constructor.
17.1.2.1.2 Move Constructor
Kind:function
Header file:#include "ara/crypto/cryp/keyslot.h"
Scope:ara::crypto::cryp::KeySlot
Syntax:KeySlot (KeySlot &&)=delete;
Description:Move-Constructor.
17.1.2.1.3 Move Assignment Operator
Kind:function
Header file:#include "ara/crypto/cryp/keyslot.h"
Scope:ara::crypto::cryp::KeySlot
Syntax:ara::crypto::cryp::KeySlot & operator= (ara::crypto::cryp::KeySlot &&other)=delete;
Description:Move-assign another KeySlot to this instance.
17.1.2.1.4 Copy Assignment Operator
Kind:function
Header file:#include "ara/crypto/cryp/keyslot.h"
Scope:ara::crypto::cryp::KeySlot
Syntax:ara::crypto::cryp::KeySlot & operator= (const ara::crypto::cryp::KeySlot &other)=delete;
Description:Copy-assign another KeySlot to this instance.
17.1.2.1.5 Destructor
Kind:function
Header file:#include "ara/crypto/cryp/keyslot.h"
Scope:ara::crypto::cryp::KeySlot
Syntax:virtual ~KeySlot () noexcept=default;
Exception Safety:exception safe
Description:Destructor.
17.1.2.2 Member Functions
17.1.2.2.1 GetAlgId
Kind:function
Header file:#include "ara/crypto/cryp/keyslot.h"
Scope:ara::crypto::cryp::KeySlot
Syntax:virtual ara::core::Result< ara::crypto::AlgIdString > GetAlgId () const noexcept=0;
Return value:ara::core::Result< ara::crypto::AlgIdString >A result containing the AlgId of the current key slot content
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if the KeySlot does not contain a key.
Description:The interface shall return the AlgId of the currently stored key.
17.1.2.2.2 GetCryptoObjectType
Kind:function
Header file:#include "ara/crypto/cryp/keyslot.h"
Scope:ara::crypto::cryp::KeySlot
Syntax:virtual ara::core::Result< CryptoObjectType > GetCryptoObjectType () const noexcept=0;
Return value:ara::core::Result< CryptoObjectType >A result containing the CryptoObjectType of the currently stored key.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if the KeySlot does not contain a key.
Description:The interface shall return the CryptoObjectType of the currently stored key.
17.1.2.2.3 GetCryptoProvider
Kind:function
Header file:#include "ara/crypto/cryp/keyslot.h"
Scope:ara::crypto::cryp::KeySlot
Syntax:virtual ara::core::Result< std::shared_ptr< cryp::CryptoProvider > > GetCryptoProvider () const noexcept=0;
Return value:ara::core::Result< std::shared_ptr< cryp::CryptoProvider > >a result containing a shared pointer to the CryptoProvider to be used with this KeySlot
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:The interface shall return an instance of the CryptoProvider that is responsible for this KeySlot.
17.1.2.2.4 GetPossibleAlgIds
Kind:function
Header file:#include "ara/crypto/cryp/keyslot.h"
Scope:ara::crypto::cryp::KeySlot
Syntax:virtual ara::core::Result< ara::core::Vector< ara::crypto::AlgIdString > > GetPossibleAlgIds () const noexcept=0;
Return value:ara::core::Result< ara::core::Vector< ara::crypto::AlgIdString > >A result containing the possible AlgIds of the key slot
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:The interface shall return a vector of AlgIds supported by this KeySlot.
17.1.2.2.5 RegisterUpdateObserver
Kind:function
Header file:#include "ara/crypto/cryp/keyslot.h"
Scope:ara::crypto::cryp::KeySlot
Syntax:virtual ara::core::Result< void > RegisterUpdateObserver (std::function< void(ara::core::StringView)> callback, ara::core::StringView keySlotIdentifier) const noexcept=0;
Parameters (in):callbackthe registered callback function to be called when the KeySlot content is modified
keySlotIdentifieran application-specific identified of the KeySlot which will be used as a parameter of the callback function
Return value:ara::core::Result< void >an empty result or an implementation specific error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:The interface shall register an application callback function to be called when the content of the KeySlot is updated (i.e., modified or cleared). If this function is called multiple times, only the most recently registered callback of an application will be called.
17.1.2.2.6 UnregisterUpdateObserver
Kind:function
Header file:#include "ara/crypto/cryp/keyslot.h"
Scope:ara::crypto::cryp::KeySlot
Syntax:virtual ara::core::Result< void > UnregisterUpdateObserver () const noexcept=0;
Return value:ara::core::Result< void >an empty result or an implementation specific error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Unregisters any previously UpdateObserver callback that has been registered previously by the application.

18 Header: ara/crypto/cryp/message_authn_code_ctx.h

18.1 Class: MessageAuthnCodeCtx

Kind:class
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:MessageAuthnCodeCtx
Base class:CryptoContext
Syntax:class MessageAuthnCodeCtx : public CryptoContext {...};
Description:Keyed Message Authentication Code Context interface definition.

18.1.1 Public Member Types

18.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<MessageAuthnCodeCtx>;
Description:Smart pointer of the interface.

18.1.2 Public Member Functions

18.1.2.1 Member Functions
18.1.2.1.1 Cancel
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< void > Cancel () noexcept=0;
Return value:ara::core::Result< void >an empty result if the ongoing streaming operation was cancelled successfully, or a result containing an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
Description:Cancel the ongoing streaming operation that has been initiated by Start() and has not yet been finished.
18.1.2.1.2 Compare
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< bool > Compare (ReadOnlyMemRegion expected) const noexcept=0;
Parameters (in):expectedthe expected MAC digest
Return value:ara::core::Result< bool >true if the expected MAC value equals the calculated MAC value, false otherwise.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotFinishedrollback_semantics
if the digest calculation was not finished by a call of the Finish() method
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the expected MAC digest is not supported
Description:Compare the size and content of the calculated MAC digest against an expected value.
18.1.2.1.3 CompareSubspan
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< bool > CompareSubspan (ReadOnlyMemRegion expected) const noexcept=0;
Parameters (in):expectedthe expected MAC digest
Return value:ara::core::Result< bool >true if the most-significant bits of the calculated MAC equal the expected byte sequence, false otherwise.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotFinishedrollback_semantics
if the digest calculation was not finished by a call of the Finish() method
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the expected MAC digest is not supported
Description:Compare the most significant bits of the calculated MAC digest against an expected value.
18.1.2.1.4 Finish
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< void > Finish () noexcept=0;
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if the MAC calculation has not been started successfully.
Description:Finish the MAC calculation.
18.1.2.1.5 Generate
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< std::size_t > Generate (ReadOnlyMemRegion data, ReadWriteMemRegion digest, ara::core::Optional< ReadOnlyMemRegion > iv) const noexcept=0;
Parameters (in):datathe input data for the MAC
ivan optional initialization vector
Parameters (out):digestan output data buffer that the MAC digest will be written into
Return value:ara::core::Result< std::size_t >A result containing the size in bytes of the MAC digest or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if single-call processing is not supported, or if the context requires setting an IV but no IV is provided, or if the context does not support setting an IV but an IV is provided
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of provided data or IV is not supported
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowMac
Description:Calculate a MAC digest and write it to the provided output buffer.
18.1.2.1.6 GenerateSubspan
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< std::size_t > GenerateSubspan (ReadOnlyMemRegion data, ReadWriteMemRegion truncatedDigest, ara::core::Optional< ReadOnlyMemRegion > iv) const noexcept=0;
Parameters (in):datathe input data for the MAC
ivan optional initialization vector
Parameters (out):truncatedDigestan output data buffer that the beginning of the MAC digest will be written into
Return value:ara::core::Result< std::size_t >A result containing the size in bytes of the MAC digest or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if single-call processing is not supported, or if the context requires setting an IV but no IV is provided, or if the context does not support setting an IV but an IV is provided
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of provided data or IV is not supported
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowMac
Description:Calculate a MAC digest and fill the provided output buffer with the beginning (MSB) of the calculated digest.
18.1.2.1.7 GetDigest
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< std::size_t > GetDigest (ReadWriteMemRegion digest) const noexcept=0;
Parameters (out):digestan output data buffer that the MAC digest will be written into
Return value:ara::core::Result< std::size_t >A result containing the size in bytes of the MAC digest or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotFinishedrollback_semantics
if the MAC calculation was not finished by a call of the Finish() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
Description:Write the calculated MAC digest into the provided output buffer.
18.1.2.1.8 GetDigestSize
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< std::size_t > GetDigestSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >size of the hash digest in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the output digest size.
18.1.2.1.9 GetMaximumChunkSize
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< std::size_t > GetMaximumChunkSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >the maximum buffer size in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the maximum input buffer size supported for processing in single calls to Update() or Finish() by this context.
18.1.2.1.10 GetRecommendedIvSize
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< std::size_t > GetRecommendedIvSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >default expected size of IV in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get default expected size of the Initialization Vector (IV) or nonce, e.g., 12 bytes for GMAC, 0 bytes for CMAC.
18.1.2.1.11 SetKey(KeySlot::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlota keyslot containing a symmetric key
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided keySlot is incompatible with this symmetric key context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a SymmetricKey
Description:Configure the context to use the key stored in the provided KeySlot at the time the MAC calculation is started.
18.1.2.1.12 SetKey(SymmetricKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::SymmetricKey::Sptr key) noexcept=0;
Parameters (in):keysymmetric key object used for MAC calculation
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a KeySlot
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided key object is incompatible with this context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowMac
Description:Configure the context to use the provided key.
18.1.2.1.13 Start(ReadOnlyMemRegion)
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< void > Start (ReadOnlyMemRegion iv) noexcept=0;
Parameters (in):ivan Initialization Vector (IV) or "nonce" value
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of provided IV is not supported
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support streaming or the algorithm does not support setting an IV
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowMac
Description:Initialize the context for a new MAC calculation and set an IV (e.g., used for GMAC)
18.1.2.1.14 Start()
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< void > Start () noexcept=0;
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support streaming or the algorithm requires setting an IV
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowMac
Description:Initialize the context for a new MAC calculation.
18.1.2.1.15 Update
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< void > Update (ReadOnlyMemRegion data) noexcept=0;
Parameters (in):dataa part of the input message that should be processed
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if the digest calculation was not initiated by a call of the Start() method
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of provided data is not supported
Description:Update the MAC calculation context by a new part of the message.
18.1.2.1.16 Verify
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< bool > Verify (ReadOnlyMemRegion data, ReadOnlyMemRegion expected, ara::core::Optional< ReadOnlyMemRegion > iv) const noexcept=0;
Parameters (in):datathe input data for the MAC
expectedthe expected MAC digest
ivan optional initialization vector
Return value:ara::core::Result< bool >true if the calculated MAC equals the expected byte sequence, false otherwise.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if single-call operation is not supported, or if the context requires setting an IV but no IV is provided, or if the context does not support setting an IV but an IV is provided
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the provided data, expected digest or IV is not supported
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowMac
Description:Calculate a MAC digest and compare the calculated MAC digest against an expected value.
18.1.2.1.17 VerifySubspan
Kind:function
Header file:#include "ara/crypto/cryp/message_authn_code_ctx.h"
Scope:ara::crypto::cryp::MessageAuthnCodeCtx
Syntax:virtual ara::core::Result< bool > VerifySubspan (ReadOnlyMemRegion data, ReadOnlyMemRegion expected, ara::core::Optional< ReadOnlyMemRegion > iv) const noexcept=0;
Parameters (in):datathe input data for the MAC
expectedthe expected most significant bits of the MAC digest
ivan optional initialization vector
Return value:ara::core::Result< bool >true if the calculated MAC equals the expected byte sequence, false otherwise.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if single-call operation is not supported, or if the context requires setting an IV but no IV is provided, or if the context does not support setting an IV but an IV is provided
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the provided data, expected digest or IV is not supported
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowMac
Description:Calculate a MAC digest and compare the most-significant bits of the calculated MAC digest against an expected value.

19 Header: ara/crypto/cryp/protected_key_import_ctx.h

19.1 Class: ProtectedKeyImportCtx

Kind:class
Header file:#include "ara/crypto/cryp/protected_key_import_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:ProtectedKeyImportCtx
Base class:CryptoContext
Syntax:class ProtectedKeyImportCtx : public CryptoContext {...};
Description:A contexts for importing secured data such as secret key-material.

19.1.1 Public Member Types

19.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/protected_key_import_ctx.h"
Scope:ara::crypto::cryp::ProtectedKeyImportCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<ProtectedKeyImportCtx>;
Description:Smart pointer of the interface.

19.1.2 Public Member Functions

19.1.2.1 Member Functions
19.1.2.1.1 GetCryptoObjectType
Kind:function
Header file:#include "ara/crypto/cryp/protected_key_import_ctx.h"
Scope:ara::crypto::cryp::ProtectedKeyImportCtx
Syntax:virtual ara::core::Result< CryptoObjectType > GetCryptoObjectType () const noexcept=0;
Return value:ara::core::Result< CryptoObjectType >the CryptoObjectType of the last unwrapped CryptoObject
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support identifying imported objects
ara::crypto::CryptoErrc::kNoSuchValuerollback_semantics
if no CryptoObject has been imported yet
Description:The interface shall return the type of the last successfully unwrapped CryptoObject.
19.1.2.1.2 GetPrivateKey
Kind:function
Header file:#include "ara/crypto/cryp/protected_key_import_ctx.h"
Scope:ara::crypto::cryp::ProtectedKeyImportCtx
Syntax:virtual ara::core::Result< ara::crypto::cryp::PrivateKey::Sptr > GetPrivateKey () const noexcept=0;
Return value:ara::core::Result< PrivateKey::Sptr >a PrivateKey shared pointer
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support importing private keys
ara::crypto::CryptoErrc::kNoSuchValuerollback_semantics
if the last imported CryptoObject is not a PrivateKey
ara::crypto::CryptoErrc::kProcessingNotFinishedrollback_semantics
if Import has not been executed successfully before
Description:The interface shall return a shared pointer to the unwrapped PrivateKey.
19.1.2.1.3 GetPublicKey
Kind:function
Header file:#include "ara/crypto/cryp/protected_key_import_ctx.h"
Scope:ara::crypto::cryp::ProtectedKeyImportCtx
Syntax:virtual ara::core::Result< ara::crypto::cryp::PublicKey::Sptr > GetPublicKey () const noexcept=0;
Return value:ara::core::Result< PublicKey::Sptr >a PublicKey shared pointer
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support importing public keys
ara::crypto::CryptoErrc::kNoSuchValuerollback_semantics
if the last imported CryptoObject is not a PublicKey
ara::crypto::CryptoErrc::kProcessingNotFinishedrollback_semantics
if Import has not been executed successfully before
Description:The interface shall return a shared pointer to the unwrapped PublicKey.
19.1.2.1.4 GetResponse
Kind:function
Header file:#include "ara/crypto/cryp/protected_key_import_ctx.h"
Scope:ara::crypto::cryp::ProtectedKeyImportCtx
Syntax:virtual ara::core::Result< std::size_t > GetResponse (ReadWriteMemRegion responseBuffer) const noexcept=0;
DIRECTION NOT DEFINEDresponseBuffer--
Return value:ara::core::Result< std::size_t >the number of Bytes written to the output buffer
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not provide a response
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
Description:The interface shall write the response of the CryptoProvider to the last invocation of Import into the provided output buffer. E.g., this interface could return M4/M5 of a SHE LoadKey operation.
19.1.2.1.5 GetSymmetricKey
Kind:function
Header file:#include "ara/crypto/cryp/protected_key_import_ctx.h"
Scope:ara::crypto::cryp::ProtectedKeyImportCtx
Syntax:virtual ara::core::Result< ara::crypto::cryp::SymmetricKey::Sptr > GetSymmetricKey () const noexcept=0;
Return value:ara::core::Result< SymmetricKey::Sptr >a SymmetricKey shared pointer
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support importing symmetric keys
ara::crypto::CryptoErrc::kNoSuchValuerollback_semantics
if the last imported CryptoObject is not a SymmetricKey
ara::crypto::CryptoErrc::kProcessingNotFinishedrollback_semantics
if Import has not been executed successfully before
Description:The interface shall return a shared pointer to the unwrapped SymmetricKey.
19.1.2.1.6 Import
Kind:function
Header file:#include "ara/crypto/cryp/protected_key_import_ctx.h"
Scope:ara::crypto::cryp::ProtectedKeyImportCtx
Syntax:virtual ara::core::Result< void > Import (ReadOnlyMemRegion serialized, ara::core::Optional< ara::crypto::cryp::WriteableKeySlot::Sptr > keySlot) noexcept=0;
Parameters (in):serializedthe memory region that contains the serialized import data
keySlotan optional WriteableKeySlot to directly store the imported key
Return value:ara::core::Result< void >an empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if serialized cannot be unwrapped due to an unexpected size
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if serialized does not conform to the specified import format
ara::crypto::CryptoErrc::kAuthTagNotValidrollback_semantics
if serialized cannot be authenticated (MAC or signature invalid)
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Description:The interface shall unwrap the protected data provided, parse the content, and make the parsed content (key-material and meta-data) available for retrieval by the application. If optionally a KeySlot is specified, the unwrapped key material shall be directly serialized into the KeySlot.
19.1.2.1.7 Reset
Kind:function
Header file:#include "ara/crypto/cryp/protected_key_import_ctx.h"
Scope:ara::crypto::cryp::ProtectedKeyImportCtx
Syntax:virtual ara::core::Result< void > Reset () const noexcept=0;
Return value:ara::core::Result< void >an empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support resetting its' state.
Description:The interface shall restore the context to its initial state by ensuring that no key-import-key is set and all previously imported data is deleted from the ProtectedKeyImportCtx's internal buffers.
19.1.2.1.8 SetKey(KeySlot::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/protected_key_import_ctx.h"
Scope:ara::crypto::cryp::ProtectedKeyImportCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlota keyslot containing a symmetric key used as transport key
Return value:ara::core::Result< void >an empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a SymmetricKey object
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the key contained in the provided keySlot cannot be used as transport key
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage flags of the key contained in the provided KeySlot does not include kAllowKeyUnwrapping
Description:The interface shall configure the context to use the key stored in the provided KeySlot at the time the import operation is started as the transport key.
19.1.2.1.9 SetKey(SymmetricKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/protected_key_import_ctx.h"
Scope:ara::crypto::cryp::ProtectedKeyImportCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::SymmetricKey::Sptr key) noexcept=0;
Parameters (in):keysymmetric key object used as transport key
Return value:ara::core::Result< void >an empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a KeySlot
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided key object cannot be used as transport key
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage flags of the key does not include kAllowKeyUnwrapping
Description:The interface shall configure the context to use the provided symmetric key as transport key.

20 Header: ara/crypto/cryp/random_generator_ctx.h

20.1 Class: RandomGeneratorCtx

Kind:class
Header file:#include "ara/crypto/cryp/random_generator_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:RandomGeneratorCtx
Base class:CryptoContext
Syntax:class RandomGeneratorCtx : public CryptoContext {...};
Description:Interface of Random Number Generator Context.

20.1.1 Public Member Types

20.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/random_generator_ctx.h"
Scope:ara::crypto::cryp::RandomGeneratorCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<RandomGeneratorCtx>;
Description:Shared smart pointer of the interface.

20.1.2 Public Member Functions

20.1.2.1 Member Functions
20.1.2.1.1 AddEntropy
Kind:function
Header file:#include "ara/crypto/cryp/random_generator_ctx.h"
Scope:ara::crypto::cryp::RandomGeneratorCtx
Syntax:virtual ara::core::Result< void > AddEntropy (ReadOnlyMemRegion entropy) noexcept=0;
Parameters (in):entropya memory region with the additional entropy value
Return value:ara::core::Result< void >a result that is empty if the method is supported and the entropy has been added successfully, an error otherwise
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the RandomGeneratorContext does not support adding entropy.
Description:Update the internal state of the RNG by mixing it with the provided additional entropy.
20.1.2.1.2 Generate
Kind:function
Header file:#include "ara/crypto/cryp/random_generator_ctx.h"
Scope:ara::crypto::cryp::RandomGeneratorCtx
Syntax:virtual ara::core::Result< void > Generate (ReadWriteMemRegion output) noexcept=0;
Parameters (out):outputan output buffer the random sequence will be written into
Return value:ara::core::Result< void >an empty result on success or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if this context has to be seeded by the application
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if this context is currently out-of-entropy and therefore cannot provide the requested number of random bytes
Description:Fill the provided output buffer with a (pseudo)random sequence.
20.1.2.1.3 Seed(ReadOnlyMemRegion)
Kind:function
Header file:#include "ara/crypto/cryp/random_generator_ctx.h"
Scope:ara::crypto::cryp::RandomGeneratorCtx
Syntax:virtual ara::core::Result< void > Seed (ReadOnlyMemRegion seed) noexcept=0;
Parameters (in):seeda memory region with the seed value
Return value:ara::core::Result< void >a result that is empty if the method is supported and the state has been set successfully, an error otherwise
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the RandomGeneratorContext does not support seeding.
Description:Set the internal state of the RNG using the provided seed.
20.1.2.1.4 Seed(SymmetricKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/random_generator_ctx.h"
Scope:ara::crypto::cryp::RandomGeneratorCtx
Syntax:virtual ara::core::Result< void > Seed (ara::crypto::cryp::SymmetricKey::Sptr seed) noexcept=0;
Parameters (in):seeda SymmetricKey with the key used as seed value
Return value:ara::core::Result< void >a result that is empty if the method is supported and the state has been set successfully, an error otherwise
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowRngInit
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the RandomGeneratorContext does not support seeding with a symmetric key.
Description:Set the internal state of the RNG using the provided seed.

21 Header: ara/crypto/cryp/signer_private_ctx.h

21.1 Class: SignerPrivateCtx

Kind:class
Header file:#include "ara/crypto/cryp/signer_private_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:SignerPrivateCtx
Base class:CryptoContext
Syntax:class SignerPrivateCtx : public CryptoContext {...};
Description:Signature Private key Context interface.

21.1.1 Public Member Types

21.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/signer_private_ctx.h"
Scope:ara::crypto::cryp::SignerPrivateCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<SignerPrivateCtx>;
Description:Smart pointer of the interface.

21.1.2 Public Member Functions

21.1.2.1 Member Functions
21.1.2.1.1 Cancel
Kind:function
Header file:#include "ara/crypto/cryp/signer_private_ctx.h"
Scope:ara::crypto::cryp::SignerPrivateCtx
Syntax:virtual ara::core::Result< void > Cancel () noexcept=0;
Return value:ara::core::Result< void >an empty result if the ongoing streaming operation was cancelled successfully, or a result containing an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
Description:Cancel the ongoing streaming operation that has been initiated by Start() and has not yet been finished.
21.1.2.1.2 Finish
Kind:function
Header file:#include "ara/crypto/cryp/signer_private_ctx.h"
Scope:ara::crypto::cryp::SignerPrivateCtx
Syntax:virtual ara::core::Result< size_t > Finish (ReadWriteMemRegion signature, FormatId signatureFormat) noexcept=0;
Parameters (in):signaturean output buffer that the signature will be written into
signatureFormatthe format in which the signature will be written
Return value:ara::core::Result< size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer signature.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if the signature generation has not been started successfully.
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified FormatId is unknown or not supported
Description:Finish the signature generation and write the signature to the provided output buffer.
21.1.2.1.3 GetMaximumChunkSize
Kind:function
Header file:#include "ara/crypto/cryp/signer_private_ctx.h"
Scope:ara::crypto::cryp::SignerPrivateCtx
Syntax:virtual ara::core::Result< std::size_t > GetMaximumChunkSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >the maximum buffer size in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the maximum input buffer size supported for processing in single calls to Update() or Sign() by this context.
21.1.2.1.4 GetSignatureSize
Kind:function
Header file:#include "ara/crypto/cryp/signer_private_ctx.h"
Scope:ara::crypto::cryp::SignerPrivateCtx
Syntax:virtual ara::core::Result< std::size_t > GetSignatureSize (FormatId signatureFormat) const noexcept=0;
Parameters (in):signatureFormatthe format for which the size of the signature will be calculated
Return value:ara::core::Result< std::size_t >size of the signature value in bytes or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified FormatId is unknown or not supported
Description:Get size of the signature value produced by the current algorithm in the provided format.
21.1.2.1.5 SetKey(KeySlot::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/signer_private_ctx.h"
Scope:ara::crypto::cryp::SignerPrivateCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlota keyslot containing a private key
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided keySlot is incompatible with this context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a PrivateKey
Description:Configure the context to use the key stored in the provided KeySlot at the time the signature calculation is started.
21.1.2.1.6 SetKey(PrivateKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/signer_private_ctx.h"
Scope:ara::crypto::cryp::SignerPrivateCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::PrivateKey::Sptr key) noexcept=0;
Parameters (in):keythe source key object
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided key object is incompatible with this context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowSigGeneration
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a KeySlot
Description:Configure the context to use the provided key.
21.1.2.1.7 Sign
Kind:function
Header file:#include "ara/crypto/cryp/signer_private_ctx.h"
Scope:ara::crypto::cryp::SignerPrivateCtx
Syntax:virtual ara::core::Result< std::size_t > Sign (ReadOnlyMemRegion message, ReadWriteMemRegion signature, FormatId signatureFormat, ara::core::Optional< ReadOnlyMemRegion > context) const noexcept=0;
Parameters (in):messagean input buffer containing the message to be signed
signatureFormatthe format in which the signature will be written
contextan optional "context" value
Parameters (out):signaturean output buffer that the signature will be written into
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer signature.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by a key value
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if single-call processing is not supported, or if the context requires setting a context but no context is provided, or if the context does not support setting a context but a context is provided
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer is invalid
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowSigGeneration
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified FormatId is unknown or not supported
Description:This function signs a message.
21.1.2.1.8 Start(ReadOnlyMemRegion)
Kind:function
Header file:#include "ara/crypto/cryp/signer_private_ctx.h"
Scope:ara::crypto::cryp::SignerPrivateCtx
Syntax:virtual ara::core::Result< void > Start (ReadOnlyMemRegion context) noexcept=0;
Parameters (in):contexta context value
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support streaming or the algorithm does not support setting a context value
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowSigGeneration
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the context is invalid
Description:Initialize the context for a new signature generation.
21.1.2.1.9 Start()
Kind:function
Header file:#include "ara/crypto/cryp/signer_private_ctx.h"
Scope:ara::crypto::cryp::SignerPrivateCtx
Syntax:virtual ara::core::Result< void > Start () noexcept=0;
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support streaming or the algorithm requires setting a context value
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowSigGeneration
Description:Initialize the context for a new signature generation.
21.1.2.1.10 Update
Kind:function
Header file:#include "ara/crypto/cryp/signer_private_ctx.h"
Scope:ara::crypto::cryp::SignerPrivateCtx
Syntax:virtual ara::core::Result< void > Update (ReadOnlyMemRegion data) noexcept=0;
Parameters (in):dataa part of the input message that should be processed
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if the signature calculation was not initiated by a call of the Start() method
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of provided data is not supported
Description:Update the signature generation context by a new part of the message.

22 Header: ara/crypto/cryp/symmetric_cipher_ctx.h

22.1 Class: SymmetricCipherCtx

Kind:class
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:SymmetricCipherCtx
Base class:CryptoContext
Syntax:class SymmetricCipherCtx : public CryptoContext {...};
Description:Interface for Symmetric Cipher Operations.

22.1.1 Public Member Types

22.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<SymmetricCipherCtx>;
Description:Smart pointer of the interface.

22.1.2 Public Member Functions

22.1.2.1 Member Functions
22.1.2.1.1 Cancel
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< void > Cancel () noexcept=0;
Return value:ara::core::Result< void >an empty result if the ongoing streaming operation was cancelled successfully, or a result containing an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
Description:Cancel the ongoing streaming operation that has been initiated by Start() and has not yet been finished.
22.1.2.1.2 EncryptSingleCallWithOutputIv
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< std::size_t > EncryptSingleCallWithOutputIv (ReadOnlyMemRegion in, ReadWriteMemRegion out, ReadWriteMemRegion ivOut) noexcept=0;
Parameters (in):inan input data buffer containing the ciphertext or plaintext
Parameters (out):outan output data buffer that the encrypted or decrypted data is written to
ivOutan output data buffer that the initialization vector (IV) generated by the context will be written to. If the algorithm does not use an IV, no data will be written into the buffer.
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if single-call encryption is not supported, or if the algorithm requires providing an input IV
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the data or IV output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided input data contains invalid data
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowDataEncryption for encryption
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if type of the key is incompatible to the transformation or the transformation direction (encrypt)
Description:Perform encryption in a single-call and return an IV generated by the context.
22.1.2.1.3 Finish
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< std::size_t > Finish (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;
Parameters (in):inan input data buffer containing a part of the ciphertext or plaintext
Parameters (out):outan output data buffer that contains encrypted or decrypted data. The required size of this buffer can be queried using GetRequiredOutputBufferSize()
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided input data contains invalid data
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context or
Description:Finalize the encryption/decryption without returning an IV.
22.1.2.1.4 FinishEncrypt
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< std::size_t > FinishEncrypt (ReadOnlyMemRegion in, ReadWriteMemRegion out, ReadWriteMemRegion ivOut) noexcept=0;
Parameters (in):inan input data buffer containing a part of the ciphertext or plaintext
Parameters (out):outan output data buffer that contains encrypted or decrypted data
ivOutan output data buffer that contains the IV
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided input data contains invalid data
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context or if this context does not use an IV or if the IV has been provided by the application in the Start() function
Description:Finalize the encryption and return the IV generated by the context.
22.1.2.1.5 GetMaximumChunkSize
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< std::size_t > GetMaximumChunkSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >the maximum buffer size in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the maximum input buffer size supported for processing in single calls to Update(), Finish(), FinishEncrypt(), or ProcessSingleCall() by this context.
22.1.2.1.6 GetMaximumInputIvSize
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< std::size_t > GetMaximumInputIvSize (CryptoTransform transformDirection) const noexcept=0;
Parameters (in):transformDirectionthe transformation direction, i.e., encryption or decryption
Return value:ara::core::Result< std::size_t >size of IV in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the maximum IV size required to be passed to the context in the functions Start() and ProcessSingleCallWithInputIv() for the given transformDirection.
22.1.2.1.7 GetMinimumChunkSize
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< std::size_t > GetMinimumChunkSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >the minimum buffer size in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the minimum input buffer size supported for processing in single calls to Update(), Finish(), FinishEncrypt(), or ProcessSingleCall() by this context.
22.1.2.1.8 GetMinimumInputIvSize
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< std::size_t > GetMinimumInputIvSize (CryptoTransform transformDirection) const noexcept=0;
Parameters (in):transformDirectionthe transformation direction, i.e., encryption or decryption
Return value:ara::core::Result< std::size_t >size of IV in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the minimum IV size required to be passed to the context in the functions Start() and ProcessSingleCallWithInputIv() for the given transformDirection.
22.1.2.1.9 GetOutputIvSize
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< std::size_t > GetOutputIvSize () const noexcept=0;
Return value:ara::core::Result< std::size_t >size of IV in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the output IV size that will be returned by the functions FinishEncrypt() (in case no IV has been provided by the application during the call to Start()), and EncryptSingleCallWithOutputIv().
22.1.2.1.10 GetRequiredOutputBufferSize
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< std::size_t > GetRequiredOutputBufferSize (std::size_t inputSize, bool isFinal) const noexcept;
Parameters (in):inputSizesize of input data
isFinalif true, calculate maximum required output buffer size for Finish(), FinishEncrypt(), ProcessSingleCallWithInputIv(), and EncryptSingleCallWithOutputIv(), otherwise for Update()
Return value:ara::core::Result< std::size_t >a result containing the required capacity of the output buffer (in bytes) or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key and setting the transformation direction
Description:Calculate the maximum required size of the output buffer depending on the input size in the current state of the context.
22.1.2.1.11 ProcessSingleCall
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< std::size_t > ProcessSingleCall (ReadOnlyMemRegion in, ReadWriteMemRegion out, CryptoTransform transformDirection) noexcept=0;
Parameters (in):inan input data buffer containing the ciphertext or plaintext
transformDirectionthe transformation direction, i.e., encryption or decryption
Parameters (out):outan output data buffer that the encrypted or decrypted data is written to
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if single-call en-/decryption is not supported, or if the context requires setting or returning an IV in the passed transformDirection
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided input data contains invalid data
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowDataEncryption for encryption, or kAllowDataDecryption for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if type of the key is incompatible to the transformation or the transformation direction
Description:Perform en-/decryption in a single-call without setting or returning an IV.
22.1.2.1.12 ProcessSingleCallWithInputIv
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< std::size_t > ProcessSingleCallWithInputIv (ReadOnlyMemRegion in, ReadWriteMemRegion out, CryptoTransform transformDirection, ReadOnlyMemRegion iv) noexcept=0;
Parameters (in):inan input data buffer containing the ciphertext or plaintext
transformDirectionthe transformation direction, i.e., encryption or decryption
ivan input data buffer containing the initialization vector (IV) to be used by the context
Parameters (out):outan output data buffer that the encrypted or decrypted data is written to
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if single-call en-/decryption is not supported, or if single-call processing with an input IV is not supported
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the data output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided input data contains invalid data
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowDataEncryption for encryption, or kAllowDataDecryption for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if type of the key is incompatible to the transformation or the transformation direction
Description:Perform en-/decryption in a single-call, providing an IV to be used during en-/decryption.
22.1.2.1.13 Seek
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< void > Seek (std::int64_t offset, bool fromBegin) noexcept=0;
Parameters (in):offsetthe offset value in bytes, relative to begin or current position in the data stream
fromBeginthe starting point for positioning within the stream: from begin (if true) or from current position (if false)
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the seek operation is not supported by this context
ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if the data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kOutOfBoundsrollback_semantics
if the resulting offset value is too large or too small
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the resulting offset is not block aligned but the context requires block alignment
Description:Set the position of the next byte within the data stream.
22.1.2.1.14 SetKey(SymmetricKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::SymmetricKey::Sptr key) noexcept=0;
Parameters (in):keythe SymmetricKey to be used.
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a KeySlot
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided key object is incompatible with this context
Description:Configure the context to use the provided symmetric key.
22.1.2.1.15 SetKey(KeySlot::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlota keyslot containing a SymmetricKey.
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided keyslot is incompatible with this context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a SymmetricKey
Description:Configure the context to use the key stored in the provided KeySlot at the time the en-/decryption is started.
22.1.2.1.16 Start(CryptoTransform, ReadOnlyMemRegion)
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< void > Start (CryptoTransform transformDirection, ReadOnlyMemRegion iv) noexcept=0;
Parameters (in):transformDirectionthe transformation direction, i.e., encryption or decryption
ivan Initialization Vector (IV) or "nonce" value. The allowed size of the IV can be queried using the functions GetMinimumInputIvSize() and GetMaximumInputIvSize().
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of provided IV is not supported
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support setting an IV in the given transformDirection or if stream processing is not supported by the context
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowDataEncryption for encryption, or kAllowDataDecryption for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if type of the key is incompatible to the transformation or the transformation direction
Description:Initialize the context for a new encryption or decryption and set the IV used by the context.
22.1.2.1.17 Start(CryptoTransform)
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< void > Start (CryptoTransform transformDirection) noexcept=0;
Parameters (in):transformDirectionthe transformation direction, i.e., encryption or decryption
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context requires setting an IV in the given transformDirection or if stream processing is not supported by the context
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowDataEncryption for encryption, or kAllowDataDecryption for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if type of the key is incompatible to the transformation or the transformation direction
Description:Initialize the context for a new encryption or decryption. An IV is either not required for this context in this transformation direction, or set by the context itself.
22.1.2.1.18 Update
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scope:ara::crypto::cryp::SymmetricCipherCtx
Syntax:virtual ara::core::Result< std::size_t > Update (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;
Parameters (in):inan input data buffer containing a part of the ciphertext or plaintext
Parameters (out):outan output data buffer that the encrypted or decrypted data will be written into. The required size of this buffer can be queried using GetRequiredOutputBufferSize()
Return value:ara::core::Result< std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer is invalid
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if stream processing is not supported by the context
Description:Encrypt or decrypt a data buffer.

23 Header: ara/crypto/cryp/symmetric_key_wrapper_ctx.h

23.1 Class: SymmetricKeyWrapperCtx

Kind:class
Header file:#include "ara/crypto/cryp/symmetric_key_wrapper_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:SymmetricKeyWrapperCtx
Base class:CryptoContext
Syntax:class SymmetricKeyWrapperCtx : public CryptoContext {...};
Description:Context of a symmetric key wrap algorithm.

23.1.1 Public Member Types

23.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/symmetric_key_wrapper_ctx.h"
Scope:ara::crypto::cryp::SymmetricKeyWrapperCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<SymmetricKeyWrapperCtx>;
Description:Smart pointer of the interface.

23.1.2 Public Member Functions

23.1.2.1 Member Functions
23.1.2.1.1 GetRequiredWrappedKeyBufferSize
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_key_wrapper_ctx.h"
Scope:ara::crypto::cryp::SymmetricKeyWrapperCtx
Syntax:virtual ara::core::Result< std::size_t > GetRequiredWrappedKeyBufferSize (const ara::crypto::cryp::CryptoObject &key) const noexcept;
Parameters (in):keykey to be wrapped
Return value:ara::core::Result< std::size_t >a result containing the required capacity of the output buffer in bytes or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
Description:Calculate the maximum required size of the wrapped key output buffer depending on the key to be wrapped.
23.1.2.1.2 SetKey(KeySlot::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_key_wrapper_ctx.h"
Scope:ara::crypto::cryp::SymmetricKeyWrapperCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlota keyslot containing a symmetric key
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided keySlot is incompatible with this context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a SymmetricKey
Description:Configure the context to use the key stored in the provided KeySlot at the time the key wrapping is performed.
23.1.2.1.3 SetKey(SymmetricKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_key_wrapper_ctx.h"
Scope:ara::crypto::cryp::SymmetricKeyWrapperCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::SymmetricKey::Sptr key) noexcept=0;
Parameters (in):keythe the key encryption key (KEK) object
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided key object is incompatible with this symmetric key context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowKeyWrapping or kAllowKeyUnwrapping
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a KeySlot
Description:Configure the context to use the provided key as key encryption key.
23.1.2.1.4 UnwrapSymmetricKey
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_key_wrapper_ctx.h"
Scope:ara::crypto::cryp::SymmetricKeyWrapperCtx
Syntax:virtual ara::core::Result< ara::crypto::cryp::SymmetricKey::Sptr > UnwrapSymmetricKey (ReadOnlyMemRegion wrappedKey, AlgId targetAlgId, AllowedUsageFlags allowedUsage) const noexcept=0;
Parameters (in):wrappedKeyan input buffer that contains the wrapped key
targetAlgIdthe algId of the to be created unwrapped key
allowedUsagebit-flags that define a list of allowed transformations' types in which the unwrapped key can be used
Return value:ara::core::Result< SymmetricKey::Sptr >a result containing the unwrapped SymmetricKey object or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the wrapped key data cannot be unwrapped (e.g., invalid format or size)
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by a key value
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the KEK does not include kAllowKeyUnwrapping
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics
if targetAlgId has an unsupported value
ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics
if the allowedUsage is incompatible with the targetAlgId or the key type
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the KEK does not include kAllowKeyUnwrapping
Description:Unwrap a wrapped key using the previously set key encryption key and return an SymmetricKey.
23.1.2.1.5 Wrap
Kind:function
Header file:#include "ara/crypto/cryp/symmetric_key_wrapper_ctx.h"
Scope:ara::crypto::cryp::SymmetricKeyWrapperCtx
Syntax:virtual ara::core::Result< std::size_t > Wrap (ara::crypto::cryp::CryptoObject::Sptr key, ReadWriteMemRegion wrappedKey) const noexcept=0;
Parameters (in):keythe key to be wrapped
Parameters (out):wrappedKeyan output buffer that the wrapped key will be written to
Return value:ara::core::Result< std::size_t >a result containing either a the number of bytes of the wrapped key or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the key object cannot be wrapped (e.g., invalid size or type)
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by a key value
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the KEK does not include kAllowKeyWrapping or the allowed usage of the object does not include kAllowSecuredExport
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the output buffer is too small
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
Description:Wrap the provided key using the previously set key encryption key.

24 Header: ara/crypto/cryp/verifier_public_ctx.h

24.1 Class: VerifierPublicCtx

Kind:class
Header file:#include "ara/crypto/cryp/verifier_public_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:VerifierPublicCtx
Base class:CryptoContext
Syntax:class VerifierPublicCtx : public CryptoContext {...};
Description:Signature Verification Public key Context interface.

24.1.1 Public Member Types

24.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/verifier_public_ctx.h"
Scope:ara::crypto::cryp::VerifierPublicCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<VerifierPublicCtx>;
Description:Smart pointer of the interface.

24.1.2 Public Member Functions

24.1.2.1 Member Functions
24.1.2.1.1 Cancel
Kind:function
Header file:#include "ara/crypto/cryp/verifier_public_ctx.h"
Scope:ara::crypto::cryp::VerifierPublicCtx
Syntax:virtual ara::core::Result< void > Cancel () noexcept=0;
Return value:ara::core::Result< void >an empty result if the ongoing streaming operation was cancelled successfully, or a result containing an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if data processing was not started by a call of the Start() method
Description:Cancel the ongoing streaming operation that has been initiated by Start() and has not yet been finished.
24.1.2.1.2 Finish
Kind:function
Header file:#include "ara/crypto/cryp/verifier_public_ctx.h"
Scope:ara::crypto::cryp::VerifierPublicCtx
Syntax:virtual ara::core::Result< bool > Finish (ReadOnlyMemRegion signature, FormatId signatureFormat) noexcept=0;
Parameters (in):signaturean input buffer containing the signature
signatureFormatthe format in which the signature is provided
Return value:ara::core::Result< bool >An result containing true if the signature was verified successfully, false if the signature verification failed, or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if the signature generation has not been started sucessfully.
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer is invalid
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified format ID is not supported
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if signature does not conform to the specified format
Description:Finish the signature verification and return the verification result.
24.1.2.1.3 GetMaximumChunkSize
Kind:function
Header file:#include "ara/crypto/cryp/verifier_public_ctx.h"
Scope:ara::crypto::cryp::VerifierPublicCtx
Syntax:virtual std::size_t GetMaximumChunkSize () const noexcept=0;
Return value:std::size_tthe maximum buffer size in bytes
Exception Safety:exception safe
Thread Safety:thread-safe
Description:Get the maximum input buffer size supported for processing in single calls to Update() or Verify() by this context.
24.1.2.1.4 SetKey(KeySlot::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/verifier_public_ctx.h"
Scope:ara::crypto::cryp::VerifierPublicCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::KeySlot::Sptr keySlot) noexcept=0;
Parameters (in):keySlota keyslot containing a public key
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided keySlot is incompatible with this context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a PublicKey
Description:Configure the context to use the key stored in the provided KeySlot at the time the signature verification is started.
24.1.2.1.5 SetKey(PublicKey::Sptr)
Kind:function
Header file:#include "ara/crypto/cryp/verifier_public_ctx.h"
Scope:ara::crypto::cryp::VerifierPublicCtx
Syntax:virtual ara::core::Result< void > SetKey (ara::crypto::cryp::PublicKey::Sptr key) noexcept=0;
Parameters (in):keythe source key object
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:CryptoErrc::kIncompatibleObjectrollback_semantics
if the provided key object is incompatible with this signature verification context
CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowSigVerification
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context only supports setting a KeySlot
Description:Configure the context to use the provided key.
24.1.2.1.6 Start()
Kind:function
Header file:#include "ara/crypto/cryp/verifier_public_ctx.h"
Scope:ara::crypto::cryp::VerifierPublicCtx
Syntax:virtual ara::core::Result< void > Start () noexcept=0;
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support streaming or the algorithm requires setting a context value
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowSigVerification
Description:Initialize the context for a new signature verification.
24.1.2.1.7 Start(ReadOnlyMemRegion)
Kind:function
Header file:#include "ara/crypto/cryp/verifier_public_ctx.h"
Scope:ara::crypto::cryp::VerifierPublicCtx
Syntax:virtual ara::core::Result< void > Start (ReadOnlyMemRegion context) noexcept=0;
Parameters (in):contexta context value
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the context does not support streaming or the algorithm does not support setting a context value
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowSigVerification
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the context is invalid
Description:Initialize the context for a new signature verification.
24.1.2.1.8 Update
Kind:function
Header file:#include "ara/crypto/cryp/verifier_public_ctx.h"
Scope:ara::crypto::cryp::VerifierPublicCtx
Syntax:virtual ara::core::Result< void > Update (ReadOnlyMemRegion data) noexcept=0;
Parameters (in):dataa part of the input message that should be processed
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics
if the signature verification was not initiated by a call of the Start() method
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of provided data is not supported
Description:Update the signature verification context by a new part of the message.
24.1.2.1.9 Verify(ReadOnlyMemRegion, ReadOnlyMemRegion, FormatId)
Kind:function
Header file:#include "ara/crypto/cryp/verifier_public_ctx.h"
Scope:ara::crypto::cryp::VerifierPublicCtx
Syntax:virtual ara::core::Result< bool > Verify (ReadOnlyMemRegion message, ReadOnlyMemRegion signature, FormatId signatureFormat) const noexcept=0;
Parameters (in):messagean input buffer containing the message
signaturean input buffer containing the signature
signatureFormatthe format in which the signature is provided
Return value:ara::core::Result< bool >An result containing true if the signature was verified successfully, false if the signature verification failed, or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by a key value
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer is invalid
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the signature algorithm requires a context value
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified format ID is not supported
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if signature does not conform to the specified format.
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowSigVerification
Description:Verify the signature of the provided message in a single call.
24.1.2.1.10 Verify(ReadOnlyMemRegion, ReadOnlyMemRegion, ReadOnlyMemRegion, FormatId)
Kind:function
Header file:#include "ara/crypto/cryp/verifier_public_ctx.h"
Scope:ara::crypto::cryp::VerifierPublicCtx
Syntax:virtual ara::core::Result< bool > Verify (ReadOnlyMemRegion message, ReadOnlyMemRegion context, ReadOnlyMemRegion signature, FormatId signatureFormat) const noexcept=0;
Parameters (in):messagean input buffer containing the message
contexta user supplied "context"
signaturean input buffer containing the signature
signatureFormatthe format in which the signature is provided
Return value:ara::core::Result< bool >An result containing true if the signature was verified successfully, false if the signature verification failed, or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by a key value
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics
if the size of the input buffer is invalid
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the signature algorithm does not support a context value
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified format ID is not supported
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if signature does not conform to the specified format
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowSigVerification
Description:Verify the signature of the provided message with context in a single call.

25 Header: ara/crypto/cryp/writeable_keyslot.h

25.1 Class: WriteableKeySlot

Kind:class
Port Interfaces:CryptoKeySlotInterface
Header file:#include "ara/crypto/cryp/writeable_keyslot.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:WriteableKeySlot
Base class:KeySlot
Syntax:class WriteableKeySlot : public KeySlot {...};
Description:WriteableKeySlot interface representing a writeable storage location for a key in a CryptoProvider.

25.1.1 Public Member Types

25.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/writeable_keyslot.h"
Scope:ara::crypto::cryp::WriteableKeySlot
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<WriteableKeySlot>;
Description:Smart pointer of the interface.

25.1.2 Public Member Functions

25.1.2.1 Special Member Functions
25.1.2.1.1 Move Constructor
Kind:function
Header file:#include "ara/crypto/cryp/writeable_keyslot.h"
Scope:ara::crypto::cryp::WriteableKeySlot
Syntax:WriteableKeySlot (WriteableKeySlot &&)=delete;
Description:Move-Constructor.
25.1.2.1.2 Copy Constructor
Kind:function
Header file:#include "ara/crypto/cryp/writeable_keyslot.h"
Scope:ara::crypto::cryp::WriteableKeySlot
Syntax:WriteableKeySlot (const WriteableKeySlot &)=delete;
Description:Copy-Constructor.
25.1.2.1.3 Copy Assignment Operator
Kind:function
Header file:#include "ara/crypto/cryp/writeable_keyslot.h"
Scope:ara::crypto::cryp::WriteableKeySlot
Syntax:ara::crypto::cryp::WriteableKeySlot & operator= (const ara::crypto::cryp::WriteableKeySlot &other)=delete;
Description:Copy-assign another WriteableKeySlot to this instance.
25.1.2.1.4 Move Assignment Operator
Kind:function
Header file:#include "ara/crypto/cryp/writeable_keyslot.h"
Scope:ara::crypto::cryp::WriteableKeySlot
Syntax:ara::crypto::cryp::WriteableKeySlot & operator= (ara::crypto::cryp::WriteableKeySlot &&other)=delete;
Description:Move-assign another WriteableKeySlot to this instance.
25.1.2.1.5 Destructor
Kind:function
Header file:#include "ara/crypto/cryp/writeable_keyslot.h"
Scope:ara::crypto::cryp::WriteableKeySlot
Syntax:virtual ~WriteableKeySlot () noexcept=default;
Exception Safety:exception safe
Description:Destructor.
25.1.2.2 Member Functions
25.1.2.2.1 Clear
Kind:function
Header file:#include "ara/crypto/cryp/writeable_keyslot.h"
Scope:ara::crypto::cryp::WriteableKeySlot
Syntax:virtual ara::core::Result< void > Clear () const noexcept=0;
Return value:ara::core::Result< void >an empty result if the keyslot was already empty or successfully cleared
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUnsupportedrollback_semantics
if the KeySlot does not support clearing
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Description:The interface shall delete the current content of the KeySlot.

26 Header: ara/crypto/cryp/cryobj/crypto_object.h

26.1 Class: CryptoObject

Kind:class
Header file:#include "ara/crypto/cryp/cryobj/crypto_object.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:CryptoObject
Base class:ara::crypto::Serializable
Syntax:class CryptoObject : public ara::crypto::Serializable {...};
Description:A common interface for all cryptographic objects recognizable by the Crypto Provider.

26.1.1 Public Member Types

26.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/cryobj/crypto_object.h"
Scope:ara::crypto::cryp::CryptoObject
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<CryptoObject>;
Description:Smart pointer of the interface.

26.1.2 Public Member Functions

26.1.2.1 Member Functions
26.1.2.1.1 GetAlgId
Kind:function
Header file:#include "ara/crypto/cryp/cryobj/crypto_object.h"
Scope:ara::crypto::cryp::CryptoObject
Syntax:virtual ara::core::Result< ara::crypto::AlgIdString > GetAlgId () const noexcept=0;
Return value:ara::core::Result< ara::crypto::AlgIdString >A result containing the AlgId of this CryptoObject
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:The interface shall return the AlgId of this CryptoObject.
26.1.2.1.2 GetAllowedUsage
Kind:function
Header file:#include "ara/crypto/cryp/cryobj/crypto_object.h"
Scope:ara::crypto::cryp::CryptoObject
Syntax:virtual ara::core::Result< AllowedUsageFlags > GetAllowedUsage () const noexcept=0;
Return value:ara::core::Result< AllowedUsageFlags >A result containing the allowed usage of the key
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:The interface shall return the allowed usage of the key.
26.1.2.1.3 Save
Kind:function
Header file:#include "ara/crypto/cryp/cryobj/crypto_object.h"
Scope:ara::crypto::cryp::CryptoObject
Syntax:virtual ara::core::Result< void > Save (ara::crypto::cryp::WriteableKeySlot::Sptr keyslot) const noexcept=0;
Parameters (in):keyslotKeySlot representing the underlying storage
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics
if the key is incompatible to the KeySlot, e.g., because the AlgId of the KeySlot is incompatible to the AlgId of the key or because the KeySlot belongs to a different CryptoProvider
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowPersist
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Description:The interface shall persistently store the key-material and its meta-data in the provided WriteableKeySlot. Data previously stored in keyslot shall be overwritten.

27 Header: ara/crypto/cryp/cryobj/private_key.h

27.1 Class: PrivateKey

Kind:class
Header file:#include "ara/crypto/cryp/cryobj/private_key.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:PrivateKey
Base class:CryptoObject
Syntax:class PrivateKey : public CryptoObject {...};
Description:Generalized Asymmetric Private Key interface.

27.1.1 Public Member Types

27.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/cryobj/private_key.h"
Scope:ara::crypto::cryp::PrivateKey
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<PrivateKey>;
Description:shared smart pointer of the interface.

27.1.2 Public Member Functions

27.1.2.1 Member Functions
27.1.2.1.1 GetPublicKey
Kind:function
Header file:#include "ara/crypto/cryp/cryobj/private_key.h"
Scope:ara::crypto::cryp::PrivateKey
Syntax:virtual ara::core::Result< ara::crypto::cryp::PublicKey::Sptr > GetPublicKey () const noexcept=0;
Return value:ara::core::Result< PublicKey::Sptr >A result containing a shared pointer to the public key correspondent to this private key
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:The interface shall return the public key correspondent to this private key.

28 Header: ara/crypto/cryp/cryobj/public_key.h

28.1 Class: PublicKey

Kind:class
Header file:#include "ara/crypto/cryp/cryobj/public_key.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:PublicKey
Base class:CryptoObject
Syntax:class PublicKey : public CryptoObject {...};
Description:General Asymmetric Public Key interface.

28.1.1 Public Member Types

28.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/cryobj/public_key.h"
Scope:ara::crypto::cryp::PublicKey
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<PublicKey>;
Description:Shared smart pointer of the interface.

29 Header: ara/crypto/cryp/cryobj/symmetric_key.h

29.1 Class: SymmetricKey

Kind:class
Header file:#include "ara/crypto/cryp/cryobj/symmetric_key.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::cryp
Symbol:SymmetricKey
Base class:CryptoObject
Syntax:class SymmetricKey : public CryptoObject {...};
Description:Symmetric Key interface.

29.1.1 Public Member Types

29.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/cryp/cryobj/symmetric_key.h"
Scope:ara::crypto::cryp::SymmetricKey
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<SymmetricKey>;
Description:Shared smart pointer of the interface.

30 Header: ara/crypto/x509/cert_sign_request.h

30.1 Class: CertSignRequest

Kind:class
Header file:#include "ara/crypto/x509/cert_sign_request.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::x509
Symbol:CertSignRequest
Base class:ara::crypto::Serializable
Syntax:class CertSignRequest : public ara::crypto::Serializable {...};
Description:Certificate Signing Request (CSR) object interface.

30.1.1 Public Member Types

30.1.1.1 Type Alias: Sptrc
Kind:type alias
Header file:#include "ara/crypto/x509/cert_sign_request.h"
Scope:ara::crypto::x509::CertSignRequest
Symbol:Sptrc
Syntax:using Sptrc = std::shared_ptr<const CertSignRequest>;
Description:Smart pointer of the constant interface.

31 Header: ara/crypto/x509/certificate.h

31.1 Non-Member Types

31.1.1 Type Alias: X509ExtendedKeyUsage

Kind:type alias
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:X509ExtendedKeyUsage
Syntax:using X509ExtendedKeyUsage = std::uint32_t;
Description:X.509 v3 Extended Key Usage type definition.

31.1.2 Type Alias: X509KeyUsage

Kind:type alias
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:X509KeyUsage
Syntax:using X509KeyUsage = std::uint32_t;
Description:X.509 v3 Key Usage type definition.

31.2 Global Variables

31.2.1 kClientAuth

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kClientAuth
Type:X509ExtendedKeyUsage
Syntax:constexpr X509ExtendedKeyUsage kClientAuth {0x4000};
Description:TLS WWW client authentication.

31.2.2 kCodeSigning

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kCodeSigning
Type:X509ExtendedKeyUsage
Syntax:constexpr X509ExtendedKeyUsage kCodeSigning {0x2000};
Description:Signing of downloadable executable code.

31.2.3 kConstrCrlSign

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kConstrCrlSign
Type:X509KeyUsage
Syntax:constexpr X509KeyUsage kConstrCrlSign {0x0200};
Description:The key can be used for Certificates Revokation Lists (CRL) signing.

31.2.4 kConstrDataEncipherment

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kConstrDataEncipherment
Type:X509KeyUsage
Syntax:constexpr X509KeyUsage kConstrDataEncipherment {0x1000};
Description:The key can be used for data encipherment.

31.2.5 kConstrDecipherOnly

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kConstrDecipherOnly
Type:X509KeyUsage
Syntax:constexpr X509KeyUsage kConstrDecipherOnly {0x0080};
Description:The enciphermet key can be used for deciphering only.

31.2.6 kConstrDigitalSignature

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kConstrDigitalSignature
Type:X509KeyUsage
Syntax:constexpr X509KeyUsage kConstrDigitalSignature {0x8000};
Description:The key can be used for digital signature production.

31.2.7 kConstrEncipherOnly

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kConstrEncipherOnly
Type:X509KeyUsage
Syntax:constexpr X509KeyUsage kConstrEncipherOnly {0x0100};
Description:The enciphermet key can be used for enciphering only.

31.2.8 kConstrKeyAgreement

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kConstrKeyAgreement
Type:X509KeyUsage
Syntax:constexpr X509KeyUsage kConstrKeyAgreement {0x0800};
Description:The key can be used for a key agreement protocol execution.

31.2.9 kConstrKeyCertSign

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kConstrKeyCertSign
Type:X509KeyUsage
Syntax:constexpr X509KeyUsage kConstrKeyCertSign {0x0400};
Description:The key can be used for certificates signing.

31.2.10 kConstrKeyEncipherment

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kConstrKeyEncipherment
Type:X509KeyUsage
Syntax:constexpr X509KeyUsage kConstrKeyEncipherment {0x2000};
Description:The key can be used for key encipherment.

31.2.11 kConstrNonRepudiation

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kConstrNonRepudiation
Type:X509KeyUsage
Syntax:constexpr X509KeyUsage kConstrNonRepudiation {0x4000};
Description:The key can be used in cases requiring the "non-repudiation" guarantee.

31.2.12 kEmailProtection

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kEmailProtection
Type:X509ExtendedKeyUsage
Syntax:constexpr X509ExtendedKeyUsage kEmailProtection {0x1000};
Description:Email protection.

31.2.13 kOCSPSigning

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kOCSPSigning
Type:X509ExtendedKeyUsage
Syntax:constexpr X509ExtendedKeyUsage kOCSPSigning {0x0400};
Description:Signing OCSP responses.

31.2.14 kServerAuth

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kServerAuth
Type:X509ExtendedKeyUsage
Syntax:constexpr X509ExtendedKeyUsage kServerAuth {0x8000};
Description:TLS WWW server authentication.

31.2.15 kTimeStamping

Kind:variable
Header file:#include "ara/crypto/x509/certificate.h"
Scope:namespace ara::crypto::x509
Symbol:kTimeStamping
Type:X509ExtendedKeyUsage
Syntax:constexpr X509ExtendedKeyUsage kTimeStamping {0x0800};
Description:Binding the hash of an object to a time.

31.3 Class: Certificate

Kind:class
Header file:#include "ara/crypto/x509/certificate.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::x509
Symbol:Certificate
Base class:ara::crypto::Serializable
Syntax:class Certificate : public ara::crypto::Serializable {...};
Description:X.509 Certificate interface.

31.3.1 Public Member Types

31.3.1.1 Type Alias: Sptrc
Kind:type alias
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Symbol:Sptrc
Syntax:using Sptrc = std::shared_ptr<const Certificate>;
Description:Smart pointer of the interface.

31.3.2 Public Member Functions

31.3.2.1 Member Functions
31.3.2.1.1 GetAuthorityInformationAccessLocation
Kind:function
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Syntax:virtual ara::core::Result< ara::core::Vector< ara::core::String > > GetAuthorityInformationAccessLocation () const noexcept=0;
Return value:ara::core::Result< ara::core::Vector< ara::core::String > >A result containing a vector of strings or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kNoSuchValuerollback_semantics
if the certificate does not contain a Authority Information Access extension or the extension does not contain a accessLocation represented as a uniformResourceIdentifier IA5String
Description:Get the Authority Information Access accessLocations represented as a uniformResourceIdentifier IA5String contained in the certificate according to the Authority Information Access extension.
31.3.2.1.2 GetAuthorityKeyIdentifierExtension
Kind:function
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Syntax:virtual ara::core::Result< ara::core::Vector< std::uint8_t > > GetAuthorityKeyIdentifierExtension () const noexcept=0;
Return value:ara::core::Result< ara::core::Vector< std::uint8_t > >DER encoded AuthorityKeyIdentifier of this certificate
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kNoSuchValuerollback_semantics
if the certificate does not contain an AuthorityKeyIdentifier
Description:Get the DER encoded AuthorityKeyIdentifier of this certificate.
31.3.2.1.3 GetCertificateSignatureAlgorithm
Kind:function
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Syntax:virtual ara::core::Result< AlgIdString > GetCertificateSignatureAlgorithm () const noexcept=0;
Return value:ara::core::Result< AlgIdString >the signature algorithm used by the CA to sign this certificate as an AlgId string
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the signature algorithm used by the CA to sign this certificate as an AlgId string.
31.3.2.1.4 GetCrlDistributionPoints
Kind:function
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Syntax:virtual ara::core::Result< ara::core::Vector< ara::core::String > > GetCrlDistributionPoints () const noexcept=0;
Return value:ara::core::Result< ara::core::Vector< ara::core::String > >A result containing a vector of strings or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kNoSuchValuerollback_semantics
if the certificate does not contain a CRL Distribution Points extension or the extension does not contain a fullNames represented as a uniformResourceIdentifier IA5String
Description:Get the CRL distribution point fullNames represented as a uniformResourceIdentifier IA5String contained in the certificate according to the CRL Distribution Points extension.
31.3.2.1.5 GetExtendedKeyUsageExtension
Kind:function
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Syntax:virtual ara::core::Result< ara::crypto::x509::X509ExtendedKeyUsage > GetExtendedKeyUsageExtension () const noexcept=0;
Return value:ara::core::Result< X509ExtendedKeyUsage >A result containing a bitmask of type X509ExtendedKeyUsage or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kNoSuchValuerollback_semantics
if the certificate does not contain an extended key usage extension
Description:Get the purpose of the key contained in the certificate according to the extended key usage extension.
31.3.2.1.6 GetIssuer
Kind:function
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Syntax:virtual ara::core::Result< ara::crypto::x509::X509DN::Sptrc > GetIssuer () const =0;
Return value:ara::core::Result< X509DN::Sptrc >Issuer DN of this certificate
Exception Safety:not exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the issuer certificate DN.
31.3.2.1.7 GetKeyUsageExtension
Kind:function
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Syntax:virtual ara::core::Result< ara::crypto::x509::X509KeyUsage > GetKeyUsageExtension () const noexcept=0;
Return value:ara::core::Result< X509KeyUsage >The KeyUsage containing the defined purposes of the key as a bitmask.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kNoSuchValuerollback_semantics
if the certificate does not contain a key usage extension
Description:Get the purpose of the key contained in the certificate according to the key usage extension.
31.3.2.1.8 GetNotAfter
Kind:function
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Syntax:virtual ara::core::Result< Timestamp > GetNotAfter () const noexcept=0;
Return value:ara::core::Result< Timestamp >"Not After" of the certificate
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the "Not After" of the certificate.
31.3.2.1.9 GetNotBefore
Kind:function
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Syntax:virtual ara::core::Result< Timestamp > GetNotBefore () const noexcept=0;
Return value:ara::core::Result< Timestamp >"Not Before" of the certificate
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the "Not Before" of the certificate.
31.3.2.1.10 GetSerialNumber
Kind:function
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Syntax:virtual ara::core::Result< ara::core::Vector< std::uint8_t > > GetSerialNumber () const noexcept=0;
Return value:ara::core::Result< ara::core::Vector< std::uint8_t > >The serial number of this certificate.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the serial number of this certificate.
31.3.2.1.11 GetSubject
Kind:function
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Syntax:virtual ara::core::Result< ara::crypto::x509::X509DN::Sptrc > GetSubject () const noexcept=0;
Return value:ara::core::Result< X509DN::Sptrc >subject DN
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the subject DN.
31.3.2.1.12 GetSubjectKeyIdentifierExtension
Kind:function
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Syntax:virtual ara::core::Result< ara::core::Vector< std::uint8_t > > GetSubjectKeyIdentifierExtension () const noexcept=0;
Return value:ara::core::Result< ara::core::Vector< std::uint8_t > >DER encoded SubjectKeyIdentifier of this certificate
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kNoSuchValuerollback_semantics
if the certificate does not contain a SubjectKeyIdentifier
Description:Get the DER encoded SubjectKeyIdentifier of this certificate.
31.3.2.1.13 GetSubjectPublicKeyAlgorithm
Kind:function
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Syntax:virtual ara::core::Result< AlgIdString > GetSubjectPublicKeyAlgorithm () const noexcept=0;
Return value:ara::core::Result< AlgIdString >the algorithm of the subject public key as an AlgId string
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the algorithm of the subject public key as an AlgId string.
31.3.2.1.14 LoadSubjectPublicKey
Kind:function
Header file:#include "ara/crypto/x509/certificate.h"
Scope:ara::crypto::x509::Certificate
Syntax:virtual ara::core::Result< ara::crypto::cryp::PublicKey::Sptr > LoadSubjectPublicKey (ara::crypto::cryp::CryptoProvider::Sptr cryptoProvider) const noexcept=0;
Parameters (in):cryptoProviderthe CryptoProvider to which the PublicKey will be loaded
Return value:ara::core::Result< ara::crypto::cryp::PublicKey::Sptr >the subject public key
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics
The CryptoProvider cannot load the PublicKey
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Description:Load the subject public key as a PublicKey object usable in scope of the provided CryptoProvider. The allowed usage of the PublicKey will be set according to the key usage extension of the certificate.

32 Header: ara/crypto/x509/certificate_validation_ctx.h

32.1 Non-Member Types

32.1.1 Type Alias: CertificateValidationOptions

Kind:type alias
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:namespace ara::crypto::x509
Symbol:CertificateValidationOptions
Syntax:using CertificateValidationOptions = std::uint32_t;
Description:Type for holding bit-flags of certificate validation options.

32.2 Global Variables

32.2.1 kIgnoreCrl

Kind:variable
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:namespace ara::crypto::x509
Symbol:kIgnoreCrl
Type:CertificateValidationOptions
Syntax:constexpr CertificateValidationOptions kIgnoreCrl {0x0008};
Description:ignore previously imported CRLs

32.2.2 kIgnoreNotAfter

Kind:variable
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:namespace ara::crypto::x509
Symbol:kIgnoreNotAfter
Type:CertificateValidationOptions
Syntax:constexpr CertificateValidationOptions kIgnoreNotAfter {0x0002};
Description:ignore the NotAfter field

32.2.3 kIgnoreNotBefore

Kind:variable
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:namespace ara::crypto::x509
Symbol:kIgnoreNotBefore
Type:CertificateValidationOptions
Syntax:constexpr CertificateValidationOptions kIgnoreNotBefore {0x0001};
Description:ignore the NotBefore field

32.2.4 kIgnoreUnknownCriticalExtensions

Kind:variable
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:namespace ara::crypto::x509
Symbol:kIgnoreUnknownCriticalExtensions
Type:CertificateValidationOptions
Syntax:constexpr CertificateValidationOptions kIgnoreUnknownCriticalExtensions {0x0004};
Description:ignore all unknown critical extensions

32.2.5 kOcspOff

Kind:variable
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:namespace ara::crypto::x509
Symbol:kOcspOff
Type:CertificateValidationOptions
Syntax:constexpr CertificateValidationOptions kOcspOff {0x0040};
Description:do not require OCSP response during certificate validation. This is the default behavior.

32.2.6 kOcspResponseCompleteChain

Kind:variable
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:namespace ara::crypto::x509
Symbol:kOcspResponseCompleteChain
Type:CertificateValidationOptions
Syntax:constexpr CertificateValidationOptions kOcspResponseCompleteChain {0x0010};
Description:require OCSP response for all certificates of chain

32.2.7 kOcspResponseTargetOnly

Kind:variable
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:namespace ara::crypto::x509
Symbol:kOcspResponseTargetOnly
Type:CertificateValidationOptions
Syntax:constexpr CertificateValidationOptions kOcspResponseTargetOnly {0x0020};
Description:require OCSP response only for target certificate

32.3 Class: CertificateValidationCtx

Kind:class
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::x509
Symbol:CertificateValidationCtx
Syntax:class CertificateValidationCtx {...};
Description:Certificate Validation Context.

32.3.1 Public Member Types

32.3.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:ara::crypto::x509::CertificateValidationCtx
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<CertificateValidationCtx>;
Description:Smart pointer of the interface.

32.3.2 Public Member Functions

32.3.2.1 Member Functions
32.3.2.1.1 AddOcspResponse
Kind:function
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:ara::crypto::x509::CertificateValidationCtx
Syntax:virtual ara::core::Result< ara::crypto::x509::CertificateValidationStatus > AddOcspResponse (ara::crypto::x509::OcspResponse::Sptrc ocspResponse, ara::core::Optional< ara::crypto::x509::Certificate::Sptrc > trustedOcspIssuerCertificate) noexcept=0;
Parameters (in):ocspResponseThe OCSP response to be used during certificate validation.
trustedOcspIssuerCertificateIf provided, the certificate to be considered trusted during validation of the OCSP response. If not provided, the certificates added via AddTrustedCertificate are considered trusted.
Return value:ara::core::Result< CertificateValidationStatus >a result containing kValid if the response was added, or the result of the OCSP response validation, or an implementation specific error otherwise.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Validate and add an OCSP response to be used during certificate validation to the set of previously added OCSP responses. Multiple OCSP responses may be added to one context. In order to validate the OCSP response, the issuer of the OCSP response must have been a) set as a trusted or untrusted certificate in this context previously, or b) the CRL must have been signed by another certificate that has the id-kp-OCSPSigning extended key usage set issued by the same CA, or c) the CRL must be signed by a trusted CA passed to this function using the optional trustedOcspIssuerCertificate parameter.
32.3.2.1.2 AddTrustedCertificate
Kind:function
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:ara::crypto::x509::CertificateValidationCtx
Syntax:virtual ara::core::Result< void > AddTrustedCertificate (ara::crypto::x509::Certificate::Sptrc trustedCertificate) noexcept=0;
Parameters (in):trustedCertificatea certificate to be considered trusted during certificate path validation.
Return value:ara::core::Result< void >An empty result on success, or an implementation specific error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Add a trusted certificates to be used during certificate path validation to the set of previously added trusted certificates.
32.3.2.1.3 AddUntrustedCertificate
Kind:function
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:ara::crypto::x509::CertificateValidationCtx
Syntax:virtual ara::core::Result< void > AddUntrustedCertificate (ara::crypto::x509::Certificate::Sptrc untrustedCertificate) noexcept=0;
Parameters (in):untrustedCertificatea certificate to be considered untrusted during certificate path validation.
Return value:ara::core::Result< void >An empty result on success, or an implementation specific error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Add an untrusted certificate to be used during certificate path validation to the set of previously added untrusted certificates.
32.3.2.1.4 IgnoreCriticalExtension
Kind:function
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:ara::crypto::x509::CertificateValidationCtx
Syntax:virtual ara::core::Result< void > IgnoreCriticalExtension (ara::core::StringView ignoredExtensionOid) noexcept=0;
Parameters (in):ignoredExtensionOidthe OID of the extension to be ignored during certificate and OCSP response validation
Return value:ara::core::Result< void >An empty result on success, or an implementation specific error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Configure the context to ignore an extension during validation of certificates and OCSP responses, even if the extension is marked as critical and the validation context does not support the extension. It is the responsibility of the application to validate such extensions. Multiple invocations of this function lead to ignoring all passed extensions. This function has no effect if the kIgnoreUnknownCriticalExtensions validation option is set.
32.3.2.1.5 SetCurrentTime
Kind:function
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:ara::crypto::x509::CertificateValidationCtx
Syntax:virtual ara::core::Result< void > SetCurrentTime (Timestamp currentTime) noexcept=0;
Parameters (in):currentTimeThe time point to be used as the current time during certificate validation.
Return value:ara::core::Result< void >An empty result on success, or an implementation specific error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Set the reference time point to be used as the current time during certificate validation. If this function is not called, the system time will be used during certificate validation.
32.3.2.1.6 SetValidationOptions
Kind:function
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:ara::crypto::x509::CertificateValidationCtx
Syntax:virtual ara::core::Result< void > SetValidationOptions (ara::crypto::x509::CertificateValidationOptions ara::crypto::x509::CertificateValidationOptions) noexcept=0;
Parameters (in):CertificateValidationOptionsA bitmask identifying validation options. The semantics of each option is specified in the CertificateValidationOptions type.
Return value:ara::core::Result< void >An empty result on success, or an implementation specific error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
an invalid CertificateValidationOptions has been provided
Description:Set validation options to be used during certificate validation.
32.3.2.1.7 ValidateCertificate
Kind:function
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:ara::crypto::x509::CertificateValidationCtx
Syntax:virtual ara::core::Result< ara::crypto::x509::CertificateValidationResult::Sptrc > ValidateCertificate (ara::crypto::x509::Certificate::Sptrc certificate) noexcept=0;
Parameters (in):certificateThe certificate to be validated.
Return value:ara::core::Result< CertificateValidationResult::Sptrc >The result of the certificate validation, or an implementation specific error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics
if an OCSP response has been set via AddOcspResponse, but the CertificateValidationOptions do not specify the OCSP behavior.
Description:Performs certificate path validation according to RFC 5280 and according to the previous configuration of the context.
32.3.2.1.8 ValidateCertificateChain
Kind:function
Header file:#include "ara/crypto/x509/certificate_validation_ctx.h"
Scope:ara::crypto::x509::CertificateValidationCtx
Syntax:virtual ara::core::Result< ara::crypto::x509::CertificateValidationResult::Sptrc > ValidateCertificateChain (const ara::core::Span< ara::crypto::x509::Certificate::Sptrc > certificateChain) noexcept=0;
Parameters (in):certificateChainThe certificate chain to be validated. Element 0 contains the leaf certificate and each subsequent certificate contains the issuer of the previous certificate.
Return value:ara::core::Result< CertificateValidationResult::Sptrc >The result of the certificate validation, or an implementation specific error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics
if an OCSP response has been set via AddOcspResponse, but the CertificateValidationOptions do not specify the OCSP behavior.
Description:Performs certificate path validation according to RFC 5280 and according to the previous configuration of the context. The function ignores any certificates added to the context via AddUntrustedCertificate. Instead, the function validates the provided chain against any trusted certificate that has been set using the function AddTrustedCertificate.

33 Header: ara/crypto/x509/certificate_validation_result.h

33.1 Non-Member Types

33.1.1 Enumeration: CertificateValidationStatus

Kind:enumeration
Header file:#include "ara/crypto/x509/certificate_validation_result.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::x509
Symbol:CertificateValidationStatus
Underlying type:std::uint8_t
Syntax:enum class CertificateValidationStatus : std::uint8_t {...};
Values:kValid= 0
The certificate path validation succeeded.
kInvalidSignature= 1
The certificate path validation failed because a signature of a certificate in the path could not be verified.
kNoPathToTrustedCertificate= 3
The certificate path validation failed because no path to a trusted certificate could be found.
kExpired= 4
The certificate path validation failed because a certificate is expired according to the notAfter field.
kFuture= 5
The certificate path validation failed because a certificate is not valid yet according to the notBefore field.
kRevoked= 6
The certificate path validation failed because a certificate has been revoked through a previously imported CRL or through an OCSP response (if OCSP is enabled through kOcspResponseCompleteChain or kOcspResponseTargetOnly)
kUnknownOcspStatus= 7
The certificate path validation failed because a certificate state is 'unknown' according to an OCSP response (if OCSP is enabled through kOcspResponseCompleteChain or kOcspResponseTargetOnly).
kUnknownCriticalExtension= 8
The certificate path validation failed because a certificate contains an unknown critical extension that has not been excluded from validation using the kIgnoreUnknownCriticalExtensions flag or the IgnoreCriticalExtension() function
Description:Certificate Validation Status.

33.2 Class: CertificateValidationResult

Kind:class
Header file:#include "ara/crypto/x509/certificate_validation_result.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::x509
Symbol:CertificateValidationResult
Syntax:class CertificateValidationResult {...};
Description:X.509 Certificate Validation Result.

33.2.1 Public Member Types

33.2.1.1 Type Alias: Sptrc
Kind:type alias
Header file:#include "ara/crypto/x509/certificate_validation_result.h"
Scope:ara::crypto::x509::CertificateValidationResult
Symbol:Sptrc
Syntax:using Sptrc = std::shared_ptr<const CertificateValidationResult>;
Description:Smart pointer of the interface.

33.2.2 Public Member Functions

33.2.2.1 Member Functions
33.2.2.1.1 GetCertificateChain
Kind:function
Header file:#include "ara/crypto/x509/certificate_validation_result.h"
Scope:ara::crypto::x509::CertificateValidationResult
Syntax:virtual ara::core::Result< ara::core::Vector< ara::crypto::x509::Certificate::Sptrc > > GetCertificateChain () const noexcept=0;
Return value:ara::core::Result< ara::core::Vector< Certificate::Sptrc > >A vector containing the found certificate chain, beginning with the leaf certificate at position 0.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the certificate chain found during certificate validation.
33.2.2.1.2 GetFailedCertificate
Kind:function
Header file:#include "ara/crypto/x509/certificate_validation_result.h"
Scope:ara::crypto::x509::CertificateValidationResult
Syntax:virtual ara::core::Result< ara::crypto::x509::Certificate::Sptrc > GetFailedCertificate () const noexcept=0;
Return value:ara::core::Result< Certificate::Sptrc >A result containing the certificate that caused the certificate path validation to fail
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kNoSuchValuerollback_semantics
if the certificate validation returned kValid, i.e., no certificate caused the validation to fail.
Description:Get the certificate that caused the certificate path validation to fail.
33.2.2.1.3 GetValidationStatus
Kind:function
Header file:#include "ara/crypto/x509/certificate_validation_result.h"
Scope:ara::crypto::x509::CertificateValidationResult
Syntax:virtual ara::core::Result< ara::crypto::x509::CertificateValidationStatus > GetValidationStatus () const noexcept=0;
Return value:ara::core::Result< CertificateValidationStatus >The result of the certificate validation, or an implementation specific error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the result of the certificate validation.

34 Header: ara/crypto/x509/ocsp_response.h

34.1 Non-Member Types

34.1.1 Enumeration: OcspResponseStatus

Kind:enumeration
Header file:#include "ara/crypto/x509/ocsp_response.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::x509
Symbol:OcspResponseStatus
Underlying type:std::uint8_t
Syntax:enum class OcspResponseStatus : std::uint8_t {...};
Values:kSuccessful= 0
Response has valid confirmations.
kMalformedRequest= 1
Illegal confirmation request.
kInternalError= 2
Internal error in issuer.
kTryLater= 3
Try again later.
kSigRequired= 5
Must sign the request.
kUnauthorized= 6
Request unauthorized.
Description:On-line Certificate Status Protocol (OCSP) Response Status.

34.2 Class: OcspResponse

Kind:class
Header file:#include "ara/crypto/x509/ocsp_response.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::x509
Symbol:OcspResponse
Syntax:class OcspResponse {...};
Description:Interface of OcspResponse.

34.2.1 Public Member Types

34.2.1.1 Type Alias: Sptrc
Kind:type alias
Header file:#include "ara/crypto/x509/ocsp_response.h"
Scope:ara::crypto::x509::OcspResponse
Symbol:Sptrc
Syntax:using Sptrc = std::shared_ptr<const OcspResponse>;
Description:Shared smart pointer of the interface.

34.2.2 Public Member Functions

34.2.2.1 Member Functions
34.2.2.1.1 GetCertificates
Kind:function
Header file:#include "ara/crypto/x509/ocsp_response.h"
Scope:ara::crypto::x509::OcspResponse
Syntax:virtual ara::core::Result< ara::core::Vector< ara::crypto::x509::Certificate::Sptrc > > GetCertificates () const noexcept=0;
Return value:ara::core::Result< ara::core::Vector< Certificate::Sptrc > >A Vector containing the certificates contained in the OCSP response.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the certificates contained in the OCSP response.
34.2.2.1.2 GetResponseStatus
Kind:function
Header file:#include "ara/crypto/x509/ocsp_response.h"
Scope:ara::crypto::x509::OcspResponse
Syntax:virtual ara::core::Result< ara::crypto::x509::OcspResponseStatus > GetResponseStatus () const noexcept=0;
Return value:ara::core::Result< OcspResponseStatus >The OCSP response status.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the OCSP response status.

35 Header: ara/crypto/x509/x509_dn.h

35.1 Class: X509DN

Kind:class
Header file:#include "ara/crypto/x509/x509_dn.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::x509
Symbol:X509DN
Base class:ara::crypto::Serializable
Syntax:class X509DN : public ara::crypto::Serializable {...};
Description:Interface of X.509 Distinguished Name (DN).

35.1.1 Public Member Types

35.1.1.1 Type Alias: Sptrc
Kind:type alias
Header file:#include "ara/crypto/x509/x509_dn.h"
Scope:ara::crypto::x509::X509DN
Symbol:Sptrc
Syntax:using Sptrc = std::shared_ptr<const X509DN>;
Description:Const shared smart pointer of the interface.

35.1.2 Public Member Functions

35.1.2.1 Member Functions
35.1.2.1.1 ToString
Kind:function
Header file:#include "ara/crypto/x509/x509_dn.h"
Scope:ara::crypto::x509::X509DN
Syntax:virtual ara::core::Result< ara::core::String > ToString () const noexcept=0;
Return value:ara::core::Result< ara::core::String >String of the whole DN string
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Get the whole Distinguished Name (DN) as a single string according to RFC 4514. If the DN contains unstandardized attributes, the attribute's OID is used.

36 Header: ara/crypto/x509/x509_provider.h

36.1 Class: X509Provider

Kind:class
Port Interfaces:CryptoCertificateGroupInterface, CryptoCertificateInterface
Header file:#include "ara/crypto/x509/x509_provider.h"
Forwarding header file:#include "ara/crypto/crypto_fwd.h"
Scope:namespace ara::crypto::x509
Symbol:X509Provider
Syntax:class X509Provider {...};
Description:X.509 Provider interface.

36.1.1 Public Member Types

36.1.1.1 Type Alias: Sptr
Kind:type alias
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Symbol:Sptr
Syntax:using Sptr = std::shared_ptr<X509Provider>;
Description:Smart pointer of the interface.

36.1.2 Public Member Functions

36.1.2.1 Special Member Functions
36.1.2.1.1 Move Constructor
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:X509Provider (X509Provider &&)=delete;
Description:Move-Constructor.
36.1.2.1.2 Copy Constructor
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:X509Provider (const X509Provider &)=delete;
Description:Copy-Constructor.
36.1.2.1.3 Move Assignment Operator
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:ara::crypto::x509::X509Provider & operator= (ara::crypto::x509::X509Provider &&other)=delete;
Description:Move-assign another X509Provider to this instance.
36.1.2.1.4 Copy Assignment Operator
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:ara::crypto::x509::X509Provider & operator= (const ara::crypto::x509::X509Provider &other)=delete;
Description:Copy-assign another X509Provider to this instance.
36.1.2.1.5 Destructor
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ~X509Provider () noexcept=default;
Exception Safety:exception safe
Description:Destructor.
36.1.2.2 Member Functions
36.1.2.2.1 ClearCertificateSlot
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< bool > ClearCertificateSlot (const ara::core::InstanceSpecifier &instanceSpecifier) noexcept=0;
Parameters (in):instanceSpecifierAn instance specifier identifying a storage location of a certificate.
Return value:ara::core::Result< bool >true if the slot contained a certificate which has been successfully removed false if the slot contained no certificate.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Violations:ProcessMappingViolationIn case InstanceSpecifier does not point to a PortPrototype typed by a CryptoCertificateInterface modeled for the current process.
InsufficientPermissionsViolationIn case the current process does not have write permissions, i.e., CryptoCertificateToPortPrototypeMapping.writeAccess != True
Description:Clear the certificate slot identified by the passed instance specifier.
36.1.2.2.2 CreateCertSignRequest
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< ara::crypto::x509::CertSignRequest::Sptrc > CreateCertSignRequest (cryp::SignerPrivateCtx::Sptr signerCtx, ara::crypto::x509::X509DN::Sptrc subjectDn, cryp::PublicKey::Sptr publicKey, ara::core::Optional< ReadOnlyMemRegion > attributes) const noexcept=0;
Parameters (in):signerCtxthe fully configured SignerPrivateCtx to be used for signing this certificate request
subjectDnthe DN to be used in the CSR
publicKeythe public key to be used in the CSR. Must correspond to the private key configured in the signerCtx.
attributesthe DER-encoded attributes that should be included to the certificate signing request
Return value:ara::core::Result< CertSignRequest::Sptrc >Smart pointer to created certificate signing request
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the attributes parameter contains invalid data
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the context was not initialized by a key value
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics
if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics
if the allowed usage of the key does not include kAllowSigGeneration
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the publicKey does not correspond to the private key configured at the signerCtx
Description:Create certificate signing request according to RFC 2986.
36.1.2.2.3 CreateCertificateValidationCtx
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< ara::crypto::x509::CertificateValidationCtx::Sptr > CreateCertificateValidationCtx () noexcept=0;
Return value:ara::core::Result< CertificateValidationCtx::Sptr >Smart pointer to the created context
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Description:Create a certificate validation context.
36.1.2.2.4 CreateDn(StringView)
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< ara::crypto::x509::X509DN::Sptrc > CreateDn (ara::core::StringView dnString) const noexcept=0;
Parameters (in):dnStringstring representing a DN according to RFC 4514
Return value:ara::core::Result< X509DN::Sptrc >a result containing a X509DN or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided DN string is invalid.
Description:Create DN from string representation.
36.1.2.2.5 CreateDn(ReadOnlyMemRegion, FormatId)
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< ara::crypto::x509::X509DN::Sptrc > CreateDn (ReadOnlyMemRegion dn, FormatId formatId) const noexcept=0;
Parameters (in):dna DN serialized according to the provided format
formatIdinput format identifier
Return value:ara::core::Result< X509DN::Sptrc >a result containing a X509DN or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the provided dn buffer is invalid.
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified FormatId is unknown or not supported
Description:Create DN from a serialized buffer.
36.1.2.2.6 CreateOcspRequest(Span, Span, Optional)
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< ara::core::Vector< std::uint8_t > > CreateOcspRequest (const ara::core::Span< ara::crypto::x509::Certificate::Sptrc > certList, const ara::core::Span< ara::crypto::x509::Certificate::Sptrc > issuerCertList, ara::core::Optional< cryp::SignerPrivateCtx::Sptr > signerCtx) noexcept=0;
Parameters (in):certLista list of certificates that should be verified
issuerCertLista list of issuer certificates of the certificates that should be verified
signerCtxan optional pointer to initialized signer context (if the request should be signed)
Return value:ara::core::Result< ara::core::Vector< std::uint8_t > >Smart pointer to the created OCSP request
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the signer context is not initialized by a key
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Description:Create OCSP request for specified list of certificates according to RFC 6960.
36.1.2.2.7 CreateOcspRequest(Certificate::Sptrc, Certificate::Sptrc, Optional)
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< ara::core::Vector< std::uint8_t > > CreateOcspRequest (ara::crypto::x509::Certificate::Sptrc cert, ara::crypto::x509::Certificate::Sptrc issuerCert, ara::core::Optional< cryp::SignerPrivateCtx::Sptr > signerCtx) noexcept=0;
Parameters (in):certa certificate that should be verified
issuerCertthe issuer certificate of the certificate that should be verified
signerCtxan optional pointer to initialized signer context (if the request should be signed)
Return value:ara::core::Result< ara::core::Vector< std::uint8_t > >Smart pointer to the created OCSP request
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics
if the signer context is not initialized by a key
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Description:Create OCSP request for specified certificate according to RFC 6960.
36.1.2.2.8 DeleteCrl
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< void > DeleteCrl (ara::core::InstanceSpecifier crlInstanceSpecifier) noexcept=0;
Parameters (in):crlInstanceSpecifierinstance specifier to the RPortPrototype of a CryptoCertificateInterface that identifies the certificate for which the CRL shall be deleted
Return value:ara::core::Result< void >an empty result if no CRL was stored or if the CRL was successfully deleted, or a result containing an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Violations:ProcessMappingViolationIn case InstanceSpecifier does not point to a PortPrototype typed by a CryptoCertificateInterface modeled for the current process.
InsufficientPermissionsViolationIn case the current process does not have write permissions, i.e., CryptoCertificateToPortPrototypeMapping.writeAccess != True
Description:Delete a stored CRL identified by the passed instance specifier.
36.1.2.2.9 ImportCertificate
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< void > ImportCertificate (const ara::core::InstanceSpecifier &instanceSpecifier, ara::crypto::x509::Certificate::Sptrc certificate) noexcept=0;
Parameters (in):instanceSpecifieran InstanceSpecifier identifying a certificate slot
certificatea certificate that should be imported
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Violations:ProcessMappingViolationIn case InstanceSpecifier does not point to a PortPrototype typed by a CryptoCertificateInterface modeled for the current process.
InsufficientPermissionsViolationIn case the current process does not have write permissions, i.e., CryptoCertificateToPortPrototypeMapping.writeAccess != True
Description:Persistently store a certificate in a certificate slot.
36.1.2.2.10 ImportCertificateInGroup
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< void > ImportCertificateInGroup (const ara::core::InstanceSpecifier &instanceSpecifier, ara::crypto::x509::Certificate::Sptrc certificate) noexcept=0;
Parameters (in):instanceSpecifieran InstanceSpecifier identifying a certificate group
certificatea certificate that should be imported
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics
if the capacity of the certificate group is not sufficient to store the certificate
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Violations:ProcessMappingViolationIn case InstanceSpecifier does not point to a PortPrototype typed by a CryptoCertificateGroupInterface modeled for the current process.
InsufficientPermissionsViolationIn case the current process does not have write permissions, i.e., CryptoCertificateGroupToPortPrototypeMapping.writeAccess != True
Description:Persistently store a certificate in a certificate group.
36.1.2.2.11 ImportCrl
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< ara::crypto::x509::CertificateValidationStatus > ImportCrl (ara::core::InstanceSpecifier crlInstanceSpecifier, ReadOnlyMemRegion crl, FormatId formatId) noexcept=0;
Parameters (in):crlInstanceSpecifierara::core::InstanceSpecifier to the RPortPrototype of a CryptoCertificateInterface that identifies the certificate for which the CRL shall be imported
crlserialized CRL or Delta CRL
formatIdthe format of the serialized CRL
Return value:ara::core::Result< CertificateValidationStatus >a result containing kValid if the CRL was added, or the result of the CRL validation, or an error otherwise.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if crl does not conform to the specified format
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified FormatId is unknown or not supported
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Violations:ProcessMappingViolationIn case InstanceSpecifier does not point to a PortPrototype typed by a CryptoCertificateInterface modeled for the current process.
InsufficientPermissionsViolationIn case the current process does not have write permissions, i.e., CryptoCertificateToPortPrototypeMapping.writeAccess != True
Description:Parse and persist a Certificate Revocation List (CRL) or Delta CRL which is issued by the CA certificate identified by the passed ara::core::InstanceSpecifier.
36.1.2.2.12 ParseCert
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< ara::crypto::x509::Certificate::Sptrc > ParseCert (ReadOnlyMemRegion cert, FormatId formatId) noexcept=0;
Parameters (in):certcertificate encoded in the given format
formatIdinput format identifier
Return value:ara::core::Result< Certificate::Sptrc >A result containing either the parsed certificate or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the cert argument cannot be parsed
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified FormatId is unknown or not supported
Description:Parse a serialized representation of an X.509v3 certificate and create a certificate object.
36.1.2.2.13 ParseCertChain
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< ara::core::Vector< ara::crypto::x509::Certificate::Sptrc > > ParseCertChain (ReadOnlyMemRegion certChain, FormatId formatId) noexcept=0;
Parameters (in):certChaincertificate chain encoded in the given format
formatIdinput format identifier
Return value:ara::core::Result< ara::core::Vector< Certificate::Sptrc > >A result containing either the vector of certificates or an error.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the certChain argument cannot be parsed
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified FormatId is unknown or not supported
Description:Parse a serialized representation of a certificate chain, creating a new Certificate instance for each parsed certificate. Certificates in the returned vector will be placed in the same order as provided in certChain.
36.1.2.2.14 ParseOcspResponse
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< ara::crypto::x509::OcspResponse::Sptrc > ParseOcspResponse (ReadOnlyMemRegion response, FormatId formatId) const noexcept=0;
Parameters (in):responsea serialized OCSP response
formatIdthe format of the serialized OCSP response
Return value:ara::core::Result< OcspResponse::Sptrc >Smart pointer to the created OCSP response instance
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics
if the response argument cannot be parsed
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics
if the specified FormatId is unknown or not supported
Description:Parse serialized OCSP response.
36.1.2.2.15 RemoveCertificateFromGroup
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< void > RemoveCertificateFromGroup (const ara::core::InstanceSpecifier &instanceSpecifier, ara::crypto::x509::Certificate::Sptrc certificate) noexcept=0;
Parameters (in):instanceSpecifieran InstanceSpecifier identifying a certificate group
certificatea certificate that should be removed from the certificate group
Return value:ara::core::Result< void >An empty result or an error
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kNoSuchValuerollback_semantics
if the certificate group does not contain the certificate to be removed
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics
if the operation temporarily cannot be performed
Violations:ProcessMappingViolationIn case InstanceSpecifier does not point to a PortPrototype typed by a CryptoCertificateGroupInterface modeled for the current process.
InsufficientPermissionsViolationIn case the current process does not have write permissions, i.e., CryptoCertificateGroupToPortPrototypeMapping.writeAccess != True
Description:Remove a certificate from a certificate group.
36.1.2.3 Named Constructors
36.1.2.3.1 LoadCertificate
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< ara::crypto::x509::Certificate::Sptrc > LoadCertificate (const ara::core::InstanceSpecifier &instanceSpecifier) noexcept=0;
Parameters (in):instanceSpecifierAn ara::core::InstanceSpecifier identifying a storage location of a certificate.
Return value:ara::core::Result< Certificate::Sptrc >an Smart pointer to the instantiated certificate
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:ara::crypto::CryptoErrc::kEmptyCertificateSlotrollback_semantics
The CryptoCertificate identified by the provided InstanceSpecifier does not contain a persisted Certificate
Violations:ProcessMappingViolationIn case InstanceSpecifier does not point to a PortPrototype typed by a CryptoCertificateInterface modeled for the current process.
Description:Load a certificate from the persistent certificate storage.
36.1.2.3.2 LoadCertificateGroup
Kind:function
Header file:#include "ara/crypto/x509/x509_provider.h"
Scope:ara::crypto::x509::X509Provider
Syntax:virtual ara::core::Result< ara::core::Vector< ara::crypto::x509::Certificate::Sptrc > > LoadCertificateGroup (const ara::core::InstanceSpecifier &instanceSpecifier) noexcept=0;
Parameters (in):instanceSpecifierAn instance specifier identifying a storage location of a certificate group.
Return value:ara::core::Result< ara::core::Vector< Certificate::Sptrc > >a vector containing the certificates stored in the certificate group.
Exception Safety:exception safe
Thread Safety:thread-safe
Errors:This function does not specify any standardized errors.
Violations:ProcessMappingViolationIn case InstanceSpecifier does not point to a PortPrototype typed by a CryptoCertificateGroupInterface modeled for the current process.
Description:Load a group of certificates from the persistent certificate storage.

참고

  • 런타임 모델에서의 크립토 프로바이더와 키 슬롯: PARA 개요
  • 키 슬롯 설정: CryptoKeySlotInterface, CryptoProviderInterface