The Cryptography Functional Cluster provides cryptographic primitives, key storage
and X.509 certificate handling. This page specifies the public API of the
ara::crypto namespace — common types, the crypto provider and its contexts, key
slots and crypto objects, and X.509 handling — organized by header file.
| 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 |
| 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): | iSpecify | InstanceSpecifier 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: | ProcessMappingViolation | In 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. |
| 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): | iSpecify | instance 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: | ProcessMappingViolation | In 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. |
| 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): | iSpecify | instance 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: | ProcessMappingViolation | In 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. |
| 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): | input | an input buffer containing the data in the input format |
| Parameters (out): | out | an 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::kInvalidArgument | rollback_semantics |
| if serialized does not conform to the specified format |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| Description: | Converts the data according to the previous configuration of the Formatter. |
| 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): | inputFormat | the input format |
| outputFormat | the output format |
| algId | the 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::kUnsupportedFormat | rollback_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. |
| 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): | format | identifier of the output format |
| Parameters (out): | out | an 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::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_semantics |
| if the specified format ID is not supported for this object type |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if exporting the object is not supported |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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. |
| 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): | format | identifier 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::kUnsupportedFormat | rollback_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() |
| 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::kProcessingNotStarted | rollback_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. |
| 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): | dataIn | an input data buffer containing the plaintext/ciphertext |
| authenticatedData | optional additional authenticated data |
| Parameters (out): | dataOut | an output data buffer that contains en-/decrypted data |
| ivOut | an output data buffer that the initialization vector (IV) generated by the context will be written to |
| Parameters (inout): | tag | for 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::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if single shot processing is not supported by the context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context requires setting an IV |
| ara::crypto::CryptoErrc::kUninitializedContext | rollback_semantics |
| if SetKey has not been successfully called before |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if a KeySlot has been configured, but is currently busy |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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::kIncompatibleObject | rollback_semantics |
| if a KeySlot has been configured, but does not contain a SymmetricKey |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if a KeySlot has been configured, but the SymmetricKey contained is not supported by this context |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of provided input buffer or authentication tag is invalid |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the data or IV output buffer is too small |
| ara::crypto::CryptoErrc::kAuthTagNotValid | rollback_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. |
| 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): | in | an input data buffer that contains a part of the plaintext/ciphertext |
| Parameters (out): | out | an output data buffer that the en-/decrypted data is written to |
| Parameters (inout): | tag | for 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::kProcessingNotStarted | rollback_semantics |
| if data processing has not been started by a call of the Start() method |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer or the authentication tag is invalid |
| ara::crypto::CryptoErrc::kAuthTagNotValid | rollback_semantics |
| if the processed data cannot be authenticated during decryption |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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): | in | an input data buffer that contains a part of the plaintext/ciphertext |
| Parameters (out): | out | an output data buffer that the en-/decrypted data is written to |
| ivOut | an output data buffer that contains the IV |
| Parameters (inout): | tag | for 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::kProcessingNotStarted | rollback_semantics |
| if data processing has not been started by a call of the Start() method |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer or the authentication tag is invalid |
| ara::crypto::CryptoErrc::kAuthTagNotValid | rollback_semantics |
| if the processed data cannot be authenticated during decryption |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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::kUnsupported | rollback_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. |
| 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): | transformDirection | the 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::kUnsupported | rollback_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. |
| 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::kUnsupported | rollback_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. |
| 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): | transformDirection | the 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::kUnsupported | rollback_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. |
| 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): | inputSize | size of input data |
| isFinal | if 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key and setting the transformation direction |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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): | dataIn | an input data buffer containing the plaintext/ciphertext |
| transformDirection | the transformation direction, i.e., encryption or decryption |
| authenticatedData | optional additional authenticated data |
| Parameters (out): | dataOut | an output data buffer that contains en-/decrypted data |
| Parameters (inout): | tag | for 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::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if single shot processing is not supported by the context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context requires setting or returning an IV |
| ara::crypto::CryptoErrc::kUninitializedContext | rollback_semantics |
| if SetKey has not been successfully called before |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if a KeySlot has been configured, but is currently busy |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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::kIncompatibleObject | rollback_semantics |
| if a KeySlot has been configured, but does not contain a SymmetricKey |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if a KeySlot has been configured, but the SymmetricKey contained is not supported by this context |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of provided input buffer or authentication tag is invalid |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kAuthTagNotValid | rollback_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. |
| 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): | dataIn | an input data buffer containing the plaintext/ciphertext |
| transformDirection | the transformation direction, i.e., encryption or decryption |
| iv | an Initialization Vector (IV) or "nonce" value |
| authenticatedData | optional additional authenticated data |
| Parameters (out): | dataOut | an output data buffer that contains en-/decrypted data |
| Parameters (inout): | tag | for 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::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if single shot processing is not supported by the context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context requires setting or returning an IV |
| ara::crypto::CryptoErrc::kUninitializedContext | rollback_semantics |
| if SetKey has not been successfully called before |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if a KeySlot has been configured, but is currently busy |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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::kIncompatibleObject | rollback_semantics |
| if a KeySlot has been configured, but does not contain a SymmetricKey |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if a KeySlot has been configured, but the SymmetricKey contained is not supported by this context |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of provided input buffer, authentication tag, or IV is invalid |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the data or IV output buffer is too small |
| ara::crypto::CryptoErrc::kAuthTagNotValid | rollback_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. |
| 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): | keySlot | a 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::kUnsupported | rollback_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. |
| 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): | key | symmetric 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::kUnsupported | rollback_semantics |
| if the context only supports setting a KeySlot |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if the provided SymmetricKey is incompatible with this AuthCipherCtx |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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. |
| 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): | transformDirection | the transformation direction, i.e., encryption or decryption |
| iv | an 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::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if stream processing is not supported by the context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context does not support setting an IV in the given transformDirection |
| ara::crypto::CryptoErrc::kUninitializedContext | rollback_semantics |
| if SetKey has not been successfully called before |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if the configured KeySlot is currently busy |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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::kIncompatibleObject | rollback_semantics |
| if a KeySlot has been configured, but does not contain a SymmetricKey |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if a KeySlot has been configured, but the SymmetricKey contained is not supported by this context |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_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. |
| 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): | transformDirection | the 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::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if stream processing is not supported by the context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context requires setting an IV in the given transformDirection |
| ara::crypto::CryptoErrc::kUninitializedContext | rollback_semantics |
| if SetKey has not been successfully called before |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if a KeySlot has been configured, but is currently busy |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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::kIncompatibleObject | rollback_semantics |
| if a KeySlot has been configured, but does not contain a SymmetricKey |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_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. |
| 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): | authenticatedData | a 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::kProcessingNotStarted | rollback_semantics |
| if the processing was not initiated by a call of the Start() method |
| ara::crypto::CryptoErrc::kInvalidUsageOrder | rollback_semantics |
| if UpdateConfidentialData has already been called |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer is invalid |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if stream processing is not supported by the context |
| Description: | Update the tag calculation by a new chunk of additional authenticated data. |
| 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): | in | an input data buffer containing a part of the ciphertext or plaintext |
| Parameters (out): | out | an 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::kProcessingNotStarted | rollback_semantics |
| if data processing was not started by a call of the Start() method |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer is invalid |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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(). |
| 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): | algId | identifier 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::kInvalidArgument | rollback_semantics |
| if algId argument specifies a crypto algorithm different from symmetric authenticated stream cipher |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_semantics |
| if algId argument has an unsupported value |
| Description: | Create a symmetric authenticated cipher context. |
| 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): | algId | identifier 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::kUnknownIdentifier | rollback_semantics |
| if AlgId argument has an unsupported value |
| Description: | Create a decryption private key context. |
| 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): | algId | identifier 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::kUnknownIdentifier | rollback_semantics |
| if AlgId argument has an unsupported value |
| Description: | Create an encryption public key context. |
| 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): | algId | identifier 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::kInvalidArgument | rollback_semantics |
| if algId argument specifies a crypto algorithm different from hash function |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_semantics |
| if algId argument has an unsupported value |
| Description: | Create a hash function context. |
| 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): | algId | identifier 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::kInvalidArgument | rollback_semantics |
| if algId argument specifies a crypto algorithm different from key-agreement |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_semantics |
| if algId argument has an unsupported value |
| Description: | Create a key-agreement private key context. |
| 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): | algId | identifier 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::kInvalidArgument | rollback_semantics |
| if algId argument specifies a crypto algorithm different from asymmetric KEM |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_semantics |
| if algId argument has an unsupported value |
| Description: | Create a key-decapsulator private context of a Key Encapsulation Mechanism (KEM). |
| 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): | algId | identifier 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::kInvalidArgument | rollback_semantics |
| if algId argument specifies a crypto algorithm different from key derivation function |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_semantics |
| if algId argument has an unsupported value |
| Description: | Create a key derivation function context. |
| 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): | algId | identifier 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::kInvalidArgument | rollback_semantics |
| if algId argument specifies a crypto algorithm different from asymmetric KEM |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_semantics |
| if algId argument has an unsupported value |
| Description: | Create a key-encapsulator public context of a Key Encapsulation Mechanism (KEM). |
| 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): | algId | identifier 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::kInvalidArgument | rollback_semantics |
| if algId argument specifies a crypto algorithm different from symmetric message authentication code |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_semantics |
| if algId argument has an unsupported value |
| Description: | Create a symmetric message authentication code context. |
| 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): | algId | identifier 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::kInvalidArgument | rollback_semantics |
| if algId argument specifies a crypto algorithm that is not supported by this CryptoProvider for wrapping |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_semantics |
| if algId argument has an unsupported value |
| Description: | The interface shall create a protected key import context. |
| 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): | algId | identifier 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::kUnknownIdentifier | rollback_semantics |
| if algId argument has an unsupported value |
| Description: | Create a Random Number Generator (RNG) context. |
| 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): | algId | identifier 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::kInvalidArgument | rollback_semantics |
| if algId argument specifies a crypto algorithm different from private key signature |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_semantics |
| if algId argument has an unsupported value |
| Description: | Create a signature private key context. |
| 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): | algId | identifier 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::kUnknownIdentifier | rollback_semantics |
| if AlgId argument has an unsupported value |
| Description: | Create a symmetric cipher context. |
| 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): | algId | identifier 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::kUnknownIdentifier | rollback_semantics |
| if algId argument has an unsupported value |
| Description: | Create a symmetric key-wrap algorithm context. |
| 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): | algId | identifier 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::kInvalidArgument | rollback_semantics |
| if algId argument specifies a crypto algorithm different from public key signature verification |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_semantics |
| if algId argument has an unsupported value |
| Description: | Create a signature verification public key context. |
| 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): | algId | the algId of the secure key export algorithm |
| key | the key to be exported |
| resultBuffer | an output buffer the securely exported key is written to |
| kek | an 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::kUnknownIdentifier | rollback_semantics |
| if algId has an unsupported value |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_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::kUsageViolation | rollback_semantics |
| if the allowed usage of key or kek is incompatible to the used algorithm |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kIncompatibleArguments | rollback_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. |
| 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): | algId | the identifier of the target crypto algorithm |
| privateKeyAllowedUsage | the 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::kUnknownIdentifier | rollback_semantics |
| if algId has an unsupported value |
| ara::crypto::CryptoErrc::kIncompatibleArguments | rollback_semantics |
| if the allowedUsage is incompatible with the algId or the key type |
| ara::crypto::CryptoErrc::kBusyResource | rollback_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. |
| 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): | randomData | output 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::kBusyResource | rollback_semantics |
| if the used RNG is currently out-of-entropy and therefore cannot provide the requested number of random bytes |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if no default RNG is supported by the CryptoProvider |
| Description: | Fill the provided output data buffer randomData with random data. |
| 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): | algId | the identifier of the target symmetric crypto algorithm |
| allowedUsage | the 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::kUnknownIdentifier | rollback_semantics |
| if algId has an unsupported value |
| ara::crypto::CryptoErrc::kIncompatibleArguments | rollback_semantics |
| if the allowedUsage is incompatible with the algId or the key type |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| Description: | Generate a new symmetric key. |
| 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): | algId | the 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::kUnknownIdentifier | rollback_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. |
| 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): | in | Optional input data required by some identification protocols (e.g. SHE/CMD_GET_ID) |
| Parameters (out): | idData | the 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::kUnsupported | rollback_semantics |
| if this provider does not support identification |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the provided ReadWriteMemRegion parameter idData is insufficient in size to hold the identification data |
| Description: | Obtain provider specific identification data. |
| 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::kUnsupported | rollback_semantics |
| if the Secure Counter is not supported by the CryptoProvider |
| ara::crypto::CryptoErrc::kBusyResource | rollback_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. |
| 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): | serialized | the memory region that contains the serialized key |
| allowedUsage | the allowedUsage of the key |
| formatId | the serialization format |
| algId | an 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::kInvalidArgument | rollback_semantics |
| if serialized does not conform to the specified format |
| ara::crypto::CryptoErrc::kIncompatibleArguments | rollback_semantics |
| if the allowedUsage is incompatible with the algId |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the CryptoProvider does not support the requested function |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_semantics |
| if the specified format ID is not supported for this object type |
| Description: | Import a serialized private key. |
| 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): | serialized | the memory region that contains the serialized key |
| allowedUsage | the allowedUsage of the key |
| formatId | the serialization format |
| algId | an 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::kInvalidArgument | rollback_semantics |
| if serialized does not conform to the specified format |
| ara::crypto::CryptoErrc::kIncompatibleArguments | rollback_semantics |
| if the allowedUsage is incompatible with the algId |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the CryptoProvider does not support the requested function |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_semantics |
| if the specified format ID is not supported for this object type |
| Description: | Import a serialized public key. |
| 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): | serialized | the memory region that contains the serialized key |
| allowedUsage | the allowedUsage of the key |
| formatId | the serialization format |
| algId | an 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::kInvalidArgument | rollback_semantics |
| if serialized does not conform to the specified format |
| ara::crypto::CryptoErrc::kIncompatibleArguments | rollback_semantics |
| if the allowedUsage is incompatible with the algId |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the CryptoProvider does not support the requested function |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_semantics |
| if the specified format ID is not supported for this object type |
| Description: | Import a serialized symmetric key. |
| 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): | keySlot | the 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::kEmptyKeySlot | rollback_semantics |
| if the KeySlot is empty |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if the underlying resource belongs to another, incompatible CryptoProvider or contains a different key type |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| Description: | Load a private key from the provided KeySlot. |
| 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): | keySlot | the 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::kEmptyKeySlot | rollback_semantics |
| if the KeySlot is empty |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if the underlying resource belongs to another, incompatible CryptoProvider or contains a different key type |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| Description: | Load a public key from the provided KeySlot. |
| 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): | keySlot | the 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::kEmptyKeySlot | rollback_semantics |
| if the KeySlot is empty |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if the underlying resource belongs to another, incompatible CryptoProvider or contains a different key type |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| Description: | Load a symmetric key from the provided KeySlot. |
| 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::kProcessingNotStarted | rollback_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. |
| 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): | in | an input data buffer containing the ciphertext |
| Parameters (out): | out | an 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if single-call decryption is not supported |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer cannot be processed |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if the provided input data contains invalid data |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowDataDecryption |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if type of the key is incompatible to the transformation |
| Description: | Decrypt data in a single-call. |
| 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): | in | an input data buffer containing a part of the ciphertext |
| Parameters (out): | out | an 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::kProcessingNotStarted | rollback_semantics |
| if data processing was not started by a call of the Start() method |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer cannot be processed |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if the provided input data contains invalid data |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if stream processing is not supported by the context |
| Description: | Finalize the decryption. |
| 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): | inputSize | size of input data |
| isFinal | if 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::kUninitializedContext | rollback_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. |
| 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): | key | the 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::kUnsupported | rollback_semantics |
| if the context only supports setting a KeySlot |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if the provided key object is incompatible with this context |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowDataDecryption |
| Description: | Configure the context to use the provided key. |
| 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): | keySlot | a 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::kIncompatibleObject | rollback_semantics |
| if the provided keyslot is incompatible with this context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowDataDecryption |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if type of the key is incompatible to the transformation |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if stream processing is not supported by the context |
| Description: | Initialize the context for a new decryption. |
| 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): | in | an input data buffer containing a part of the ciphertext |
| Parameters (out): | out | an 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::kProcessingNotStarted | rollback_semantics |
| if data processing was not started by a call of the Start() method |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer is invalid |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if stream processing is not supported by the context |
| Description: | Decrypt a data buffer. |
| 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::kProcessingNotStarted | rollback_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. |
| 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): | in | an input data buffer containing the plaintext |
| Parameters (out): | out | an 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if single-call encryption is not supported |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer cannot be processed |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if the provided input data contains invalid data |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowDataEncryption |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if type of the key is incompatible to the transformation |
| Description: | Encrypt data in a single-call. |
| 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): | in | an input data buffer containing a part of the plaintext |
| Parameters (out): | out | an 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::kProcessingNotStarted | rollback_semantics |
| if data processing was not started by a call of the Start() method |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer cannot be processed |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if the provided input data contains invalid data |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if stream processing is not supported by the context |
| Description: | Finalize the encryption. |
| 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): | inputSize | size of input data |
| isFinal | if 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::kUninitializedContext | rollback_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. |
| 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): | key | the 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::kUnsupported | rollback_semantics |
| if the context only supports setting a KeySlot |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if the provided key object is incompatible with this context |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowDataEncryption |
| Description: | Configure the context to use the provided key. |
| 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): | keySlot | a 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::kIncompatibleObject | rollback_semantics |
| if the provided keyslot is incompatible with this context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowDataEncryption |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if type of the key is incompatible to the transformation |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if stream processing is not supported by the context |
| Description: | Initialize the context for a new encryption. |
| 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): | in | an input data buffer containing a part of the plaintext |
| Parameters (out): | out | an 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::kProcessingNotStarted | rollback_semantics |
| if data processing was not started by a call of the Start() method |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer is invalid |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if stream processing is not supported by the context |
| Description: | Encrypt a data buffer. |
| 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): | data | the input message that should be processed |
| iv | an optional initialization vector |
| Parameters (out): | digest | an 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::kInvalidInputSize | rollback_semantics |
| if the size of provided data or IV is not supported |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| Description: | Calculate the hash digest and write the the calculated digest into the provided output buffer. |
| 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::kProcessingNotStarted | rollback_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. |
| 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): | expected | the 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::kProcessingNotFinished | rollback_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. |
| 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): | contextState | an 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::kUnsupported | rollback_semantics |
| if this context does not support im-/exporting the context state |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_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. |
| 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): | digest | an 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::kProcessingNotFinished | rollback_semantics |
| if the hash calculation was not finished by a call of the Finish() method |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| Description: | Write the calculated hash digest into the provided output buffer. |
| 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): | digest | an 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::kInvalidUsageOrder | rollback_semantics |
| the hash calculation has not been started successfully. |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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): | contextState | a 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::kUnsupported | rollback_semantics |
| if this context does not support im-/exporting the context state |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_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. |
| 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::kUnsupported | rollback_semantics |
| the used hash function expects an IV |
| ara::crypto::CryptoErrc::kBusyResource | rollback_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. |
| 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): | iv | the 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::kInvalidInputSize | rollback_semantics |
| the size of provided IV is not supported |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| the used hash function does not use an IV |
| ara::crypto::CryptoErrc::kBusyResource | rollback_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. |
| 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): | data | a 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::kProcessingNotStarted | rollback_semantics |
| if the digest calculation was not initiated by a call of the Start() method |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of provided data is not supported |
| Description: | Update the digest calculation context by a new part of the message. |
| 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): | key | a 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::kProcessingNotStarted | rollback_semantics |
| if the digest calculation was not initiated by a call of the Start() method |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of provided data is not supported |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if this context does not support hashing of keys |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if the provided key is incompatible with this context |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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. |
| 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): | otherSideKey | the public key of the other side of the Key-Agreement |
| targetAlgId | identifier of the symmetric target algorithm |
| allowedUsage | the 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key or not all required parameters have been set via SetParameter() |
| CryptoErrc::kIncompatibleObject | rollback_semantics |
| if the public key is not compatible to this context |
| CryptoErrc::kInvalidArgument | rollback_semantics |
| if the allowed usage flags are invalid for a symmetric key |
| CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the private or public key do not include kAllowKeyAgreement |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_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. |
| 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): | keySlot | a 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::kIncompatibleObject | rollback_semantics |
| if the provided keySlot is incompatible with this context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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): | key | the 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::kIncompatibleObject | rollback_semantics |
| if the provided key object is incompatible with this private key context |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowKeyAgreement |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context only supports setting a KeySlot |
| Description: | Configure the context to use the provided key. |
| 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): | parameterName | an identifier of the parameter |
| value | an 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::kUnsupported | rollback_semantics |
| if the context does not support the parameter |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if the provided parameter value is invalid |
| Description: | Set a parameter of the key agreement identified by parameterName. |
| 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): | parameterName | an identifier of the parameter |
| value | an 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::kUnsupported | rollback_semantics |
| if the context does not support the parameter |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if the provided parameter value is invalid |
| Description: | Set a parameter of the key agreement identified by parameterName. |
| 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): | encapsulatedKey | an input buffer containing the encapsulated key |
| algId | the identifier of the target symmetric crypto algorithm |
| allowedUsage | the 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by a private key value |
| CryptoErrc::kInvalidArgument | rollback_semantics |
| if the format of encapsulatedKey is invalid |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_semantics |
| if algId has an unsupported value |
| ara::crypto::CryptoErrc::kIncompatibleArguments | rollback_semantics |
| if the allowedUsage is incompatible with the algId or the key type |
| ara::crypto::CryptoErrc::kIncompatibleArguments | rollback_semantics |
| if the algId is incompatible to the encapsulatedKey |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowKeyUnwrapping |
| Description: | Decapsulate the keying data into a new SymmetricKey. |
| 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): | key | the 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::kIncompatibleObject | rollback_semantics |
| if the provided key object is incompatible with this context |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowKeyUnwrapping |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context only supports setting a KeySlot |
| Description: | Configure the context to use the provided key as decapsulation key. |
| 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): | keySlot | a 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::kIncompatibleObject | rollback_semantics |
| if the provided keySlot is incompatible with this context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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): | targetAlgId | the identifier of the target symmetric crypto algorithm |
| allowedUsage | the 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::kUnknownIdentifier | rollback_semantics |
| if targetAlgId has an unsupported value |
| ara::crypto::CryptoErrc::kIncompatibleArguments | rollback_semantics |
| if the allowedUsage of the derived key is incompatible with the targetAlgId. |
| ara::crypto::CryptoErrc::kUninitializedContext | rollback_semantics |
| if the context has not been sufficiently initialized |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the source key does not include kAllowKeyDerivation |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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. |
| 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): | keySlot | a 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::kIncompatibleObject | rollback_semantics |
| if the provided keySlot is incompatible with this context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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): | key | the 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::kIncompatibleObject | rollback_semantics |
| if the provided key object is incompatible with this symmetric key context |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowKeyDerivation |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context only supports setting a KeySlot |
| Description: | Configure the context to use the provided key. |
| 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): | parameterName | an identifier of the parameter |
| value | an 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::kUnsupported | rollback_semantics |
| if the context does not support the parameter |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if the provided parameter value is invalid |
| Description: | Set a parameter of the KDF identified by parameterName. |
| 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): | parameterName | an identifier of the parameter |
| value | an 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::kUnsupported | rollback_semantics |
| if the context does not support the parameter |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if the provided parameter value is invalid |
| Description: | Set a parameter of the KDF identified by parameterName. |
| 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): | parameterName | an identifier of the parameter |
| value | SymmetricKey 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::kUnsupported | rollback_semantics |
| if the context does not support the parameter |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if the provided key is incompatible with this context |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowKeyDerivation |
| Description: | Set a parameter of the KDF identified by parameterName. |
| 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): | key | the symmetric key to be encapsulated |
| Parameters (out): | encapsulatedKey | an 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by a public key value |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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::kIncompatibleObject | rollback_semantics |
| if the provided encapsulated key object is incompatible with this context |
| CryptoErrc::kInvalidInputSize | rollback_semantics |
| if this context does not support the size of the encapsulated key |
| CryptoErrc::kUnsupported | rollback_semantics |
| if this context does not support setting the encapsulated key, because it generates the key during encapsulation |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowKeyWrapping |
| Description: | Encapsulate the provided symmetric key. |
| 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): | algId | the identifier of the target symmetric crypto algorithm |
| allowedUsage | the flags that define a list of allowed transformations' types in which the target key can be used |
| Parameters (out): | encapsulatedKey | an 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by a public key value |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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::kInvalidInputSize | rollback_semantics |
| if this context does not support the size of the encapsulated key |
| CryptoErrc::kUnsupported | rollback_semantics |
| if this context does not support generating the encapsulated key during encapsulation |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_semantics |
| if algId has an unsupported value |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured via SetKey that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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. |
| 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): | algId | the 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::kUninitializedContext | rollback_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. |
| 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): | key | the 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::kIncompatibleObject | rollback_semantics |
| if the provided key object is incompatible with this context |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowKeyWrapping |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context only supports setting a KeySlot |
| Description: | Configure the context to use the provided key as encapsulation key. |
| 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): | keySlot | a 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::kIncompatibleObject | rollback_semantics |
| if the provided keySlot is incompatible with this context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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): | callback | the registered callback function to be called when the KeySlot content is modified |
| keySlotIdentifier | an 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. |
| 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::kProcessingNotStarted | rollback_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. |
| 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): | expected | the 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::kProcessingNotFinished | rollback_semantics |
| if the digest calculation was not finished by a call of the Finish() method |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_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. |
| 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): | expected | the 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::kProcessingNotFinished | rollback_semantics |
| if the digest calculation was not finished by a call of the Finish() method |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_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. |
| 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): | data | the input data for the MAC |
| iv | an optional initialization vector |
| Parameters (out): | digest | an 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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::kInvalidInputSize | rollback_semantics |
| if the size of provided data or IV is not supported |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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. |
| 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): | data | the input data for the MAC |
| iv | an optional initialization vector |
| Parameters (out): | truncatedDigest | an 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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::kInvalidInputSize | rollback_semantics |
| if the size of provided data or IV is not supported |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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. |
| 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): | digest | an 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::kProcessingNotFinished | rollback_semantics |
| if the MAC calculation was not finished by a call of the Finish() method |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| Description: | Write the calculated MAC digest into the provided output buffer. |
| 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): | keySlot | a 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::kIncompatibleObject | rollback_semantics |
| if the provided keySlot is incompatible with this symmetric key context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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): | key | symmetric 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::kUnsupported | rollback_semantics |
| if the context only supports setting a KeySlot |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if the provided key object is incompatible with this context |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowMac |
| Description: | Configure the context to use the provided key. |
| 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): | iv | an 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of provided IV is not supported |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context does not support streaming or the algorithm does not support setting an IV |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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) |
| 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context does not support streaming or the algorithm requires setting an IV |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowMac |
| Description: | Initialize the context for a new MAC calculation. |
| 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): | data | a 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::kProcessingNotStarted | rollback_semantics |
| if the digest calculation was not initiated by a call of the Start() method |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of provided data is not supported |
| Description: | Update the MAC calculation context by a new part of the message. |
| 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): | data | the input data for the MAC |
| expected | the expected MAC digest |
| iv | an 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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::kInvalidInputSize | rollback_semantics |
| if the size of the provided data, expected digest or IV is not supported |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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. |
| 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): | data | the input data for the MAC |
| expected | the expected most significant bits of the MAC digest |
| iv | an 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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::kInvalidInputSize | rollback_semantics |
| if the size of the provided data, expected digest or IV is not supported |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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. |
| 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::kUnsupported | rollback_semantics |
| if the context does not support identifying imported objects |
| ara::crypto::CryptoErrc::kNoSuchValue | rollback_semantics |
| if no CryptoObject has been imported yet |
| Description: | The interface shall return the type of the last successfully unwrapped CryptoObject. |
| 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::kUnsupported | rollback_semantics |
| if the context does not support importing private keys |
| ara::crypto::CryptoErrc::kNoSuchValue | rollback_semantics |
| if the last imported CryptoObject is not a PrivateKey |
| ara::crypto::CryptoErrc::kProcessingNotFinished | rollback_semantics |
| if Import has not been executed successfully before |
| Description: | The interface shall return a shared pointer to the unwrapped PrivateKey. |
| 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::kUnsupported | rollback_semantics |
| if the context does not support importing public keys |
| ara::crypto::CryptoErrc::kNoSuchValue | rollback_semantics |
| if the last imported CryptoObject is not a PublicKey |
| ara::crypto::CryptoErrc::kProcessingNotFinished | rollback_semantics |
| if Import has not been executed successfully before |
| Description: | The interface shall return a shared pointer to the unwrapped PublicKey. |
| 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 DEFINED | responseBuffer | -- |
| 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::kUnsupported | rollback_semantics |
| if the context does not provide a response |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_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. |
| 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::kUnsupported | rollback_semantics |
| if the context does not support importing symmetric keys |
| ara::crypto::CryptoErrc::kNoSuchValue | rollback_semantics |
| if the last imported CryptoObject is not a SymmetricKey |
| ara::crypto::CryptoErrc::kProcessingNotFinished | rollback_semantics |
| if Import has not been executed successfully before |
| Description: | The interface shall return a shared pointer to the unwrapped SymmetricKey. |
| 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): | serialized | the memory region that contains the serialized import data |
| keySlot | an 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::kInvalidInputSize | rollback_semantics |
| if serialized cannot be unwrapped due to an unexpected size |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if serialized does not conform to the specified import format |
| ara::crypto::CryptoErrc::kAuthTagNotValid | rollback_semantics |
| if serialized cannot be authenticated (MAC or signature invalid) |
| ara::crypto::CryptoErrc::kBusyResource | rollback_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. |
| 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): | keySlot | a 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::kUnsupported | rollback_semantics |
| if the context only supports setting a SymmetricKey object |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if the key contained in the provided keySlot cannot be used as transport key |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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. |
| 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): | key | symmetric 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::kUnsupported | rollback_semantics |
| if the context only supports setting a KeySlot |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if the provided key object cannot be used as transport key |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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. |
| 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): | entropy | a 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::kUnsupported | rollback_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. |
| 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): | output | an 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::kUninitializedContext | rollback_semantics |
| if this context has to be seeded by the application |
| ara::crypto::CryptoErrc::kBusyResource | rollback_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. |
| 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): | seed | a 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::kUnsupported | rollback_semantics |
| if the RandomGeneratorContext does not support seeding. |
| Description: | Set the internal state of the RNG using the provided seed. |
| 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): | seed | a 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::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowRngInit |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the RandomGeneratorContext does not support seeding with a symmetric key. |
| Description: | Set the internal state of the RNG using the provided seed. |
| 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::kProcessingNotStarted | rollback_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. |
| 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): | signature | an output buffer that the signature will be written into |
| signatureFormat | the 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::kProcessingNotStarted | rollback_semantics |
| if the signature generation has not been started successfully. |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_semantics |
| if the specified FormatId is unknown or not supported |
| Description: | Finish the signature generation and write the signature to the provided output buffer. |
| 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): | signatureFormat | the 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::kUnsupportedFormat | rollback_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. |
| 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): | keySlot | a 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::kIncompatibleObject | rollback_semantics |
| if the provided keySlot is incompatible with this context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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): | key | the 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::kIncompatibleObject | rollback_semantics |
| if the provided key object is incompatible with this context |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowSigGeneration |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context only supports setting a KeySlot |
| Description: | Configure the context to use the provided key. |
| 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): | message | an input buffer containing the message to be signed |
| signatureFormat | the format in which the signature will be written |
| context | an optional "context" value |
| Parameters (out): | signature | an 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by a key value |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer is invalid |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowSigGeneration |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_semantics |
| if the specified FormatId is unknown or not supported |
| Description: | This function signs a message. |
| 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): | context | a 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context does not support streaming or the algorithm does not support setting a context value |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowSigGeneration |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the context is invalid |
| Description: | Initialize the context for a new signature generation. |
| 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context does not support streaming or the algorithm requires setting a context value |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowSigGeneration |
| Description: | Initialize the context for a new signature generation. |
| 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): | data | a 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::kProcessingNotStarted | rollback_semantics |
| if the signature calculation was not initiated by a call of the Start() method |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of provided data is not supported |
| Description: | Update the signature generation context by a new part of the message. |
| 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::kProcessingNotStarted | rollback_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. |
| 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): | in | an input data buffer containing the ciphertext or plaintext |
| Parameters (out): | out | an output data buffer that the encrypted or decrypted data is written to |
| ivOut | an 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if single-call encryption is not supported, or if the algorithm requires providing an input IV |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the data or IV output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer cannot be processed |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if the provided input data contains invalid data |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowDataEncryption for encryption |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_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. |
| 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): | in | an input data buffer containing a part of the ciphertext or plaintext |
| Parameters (out): | out | an 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::kProcessingNotStarted | rollback_semantics |
| if data processing was not started by a call of the Start() method |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer cannot be processed |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if the provided input data contains invalid data |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if stream processing is not supported by the context or |
| Description: | Finalize the encryption/decryption without returning an IV. |
| 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): | in | an input data buffer containing a part of the ciphertext or plaintext |
| Parameters (out): | out | an output data buffer that contains encrypted or decrypted data |
| ivOut | an 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::kProcessingNotStarted | rollback_semantics |
| if data processing was not started by a call of the Start() method |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer cannot be processed |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if the provided input data contains invalid data |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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. |
| 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. |
| 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): | inputSize | size of input data |
| isFinal | if 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::kUninitializedContext | rollback_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. |
| 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): | in | an input data buffer containing the ciphertext or plaintext |
| transformDirection | the transformation direction, i.e., encryption or decryption |
| Parameters (out): | out | an 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer cannot be processed |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if the provided input data contains invalid data |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowDataEncryption for encryption, or kAllowDataDecryption for decryption, respectively |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_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. |
| 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): | in | an input data buffer containing the ciphertext or plaintext |
| transformDirection | the transformation direction, i.e., encryption or decryption |
| iv | an input data buffer containing the initialization vector (IV) to be used by the context |
| Parameters (out): | out | an 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if single-call en-/decryption is not supported, or if single-call processing with an input IV is not supported |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the data output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer cannot be processed |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if the provided input data contains invalid data |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowDataEncryption for encryption, or kAllowDataDecryption for decryption, respectively |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_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. |
| 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): | offset | the offset value in bytes, relative to begin or current position in the data stream |
| fromBegin | the 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::kUnsupported | rollback_semantics |
| if the seek operation is not supported by this context |
| ara::crypto::CryptoErrc::kProcessingNotStarted | rollback_semantics |
| if the data processing was not started by a call of the Start() method |
| ara::crypto::CryptoErrc::kOutOfBounds | rollback_semantics |
| if the resulting offset value is too large or too small |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_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. |
| 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): | key | the 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::kUnsupported | rollback_semantics |
| if the context only supports setting a KeySlot |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics |
| if the provided key object is incompatible with this context |
| Description: | Configure the context to use the provided symmetric key. |
| 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): | keySlot | a 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::kIncompatibleObject | rollback_semantics |
| if the provided keyslot is incompatible with this context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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): | transformDirection | the transformation direction, i.e., encryption or decryption |
| iv | an 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of provided IV is not supported |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowDataEncryption for encryption, or kAllowDataDecryption for decryption, respectively |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_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. |
| 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): | transformDirection | the 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowDataEncryption for encryption, or kAllowDataDecryption for decryption, respectively |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_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. |
| 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): | in | an input data buffer containing a part of the ciphertext or plaintext |
| Parameters (out): | out | an 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::kProcessingNotStarted | rollback_semantics |
| if data processing was not started by a call of the Start() method |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer is invalid |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if stream processing is not supported by the context |
| Description: | Encrypt or decrypt a data buffer. |
| 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): | key | key 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::kUninitializedContext | rollback_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. |
| 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): | keySlot | a 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::kIncompatibleObject | rollback_semantics |
| if the provided keySlot is incompatible with this context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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): | key | the 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::kIncompatibleObject | rollback_semantics |
| if the provided key object is incompatible with this symmetric key context |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowKeyWrapping or kAllowKeyUnwrapping |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context only supports setting a KeySlot |
| Description: | Configure the context to use the provided key as key encryption key. |
| 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): | wrappedKey | an input buffer that contains the wrapped key |
| targetAlgId | the algId of the to be created unwrapped key |
| allowedUsage | bit-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::kInvalidArgument | rollback_semantics |
| if the wrapped key data cannot be unwrapped (e.g., invalid format or size) |
| ara::crypto::CryptoErrc::kUninitializedContext | rollback_semantics |
| if the context was not initialized by a key value |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the KEK does not include kAllowKeyUnwrapping |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_semantics |
| if targetAlgId has an unsupported value |
| ara::crypto::CryptoErrc::kIncompatibleArguments | rollback_semantics |
| if the allowedUsage is incompatible with the targetAlgId or the key type |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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. |
| 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): | key | the key to be wrapped |
| Parameters (out): | wrappedKey | an 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::kInvalidArgument | rollback_semantics |
| if the key object cannot be wrapped (e.g., invalid size or type) |
| ara::crypto::CryptoErrc::kUninitializedContext | rollback_semantics |
| if the context was not initialized by a key value |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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::kInsufficientCapacity | rollback_semantics |
| if the output buffer is too small |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| Description: | Wrap the provided key using the previously set key encryption key. |
| 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::kProcessingNotStarted | rollback_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. |
| 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): | signature | an input buffer containing the signature |
| signatureFormat | the 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::kProcessingNotStarted | rollback_semantics |
| if the signature generation has not been started sucessfully. |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer is invalid |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_semantics |
| if the specified format ID is not supported |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if signature does not conform to the specified format |
| Description: | Finish the signature verification and return the verification result. |
| 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): | keySlot | a 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::kIncompatibleObject | rollback_semantics |
| if the provided keySlot is incompatible with this context |
| ara::crypto::CryptoErrc::kUnsupported | rollback_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. |
| 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): | key | the 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::kIncompatibleObject | rollback_semantics |
| if the provided key object is incompatible with this signature verification context |
| CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowSigVerification |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context only supports setting a KeySlot |
| Description: | Configure the context to use the provided key. |
| 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context does not support streaming or the algorithm requires setting a context value |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowSigVerification |
| Description: | Initialize the context for a new signature verification. |
| 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): | context | a 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by deploying a key |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the context does not support streaming or the algorithm does not support setting a context value |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowSigVerification |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the context is invalid |
| Description: | Initialize the context for a new signature verification. |
| 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): | data | a 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::kProcessingNotStarted | rollback_semantics |
| if the signature verification was not initiated by a call of the Start() method |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of provided data is not supported |
| Description: | Update the signature verification context by a new part of the message. |
| 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): | message | an input buffer containing the message |
| signature | an input buffer containing the signature |
| signatureFormat | the 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by a key value |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer is invalid |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the signature algorithm requires a context value |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_semantics |
| if the specified format ID is not supported |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if signature does not conform to the specified format. |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowSigVerification |
| Description: | Verify the signature of the provided message in a single call. |
| 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): | message | an input buffer containing the message |
| context | a user supplied "context" |
| signature | an input buffer containing the signature |
| signatureFormat | the 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::kUninitializedContext | rollback_semantics |
| if the context was not initialized by a key value |
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics |
| if the size of the input buffer is invalid |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics |
| if the signature algorithm does not support a context value |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_semantics |
| if the specified format ID is not supported |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if signature does not conform to the specified format |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_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. |
| 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::kUnsupported | rollback_semantics |
| if the KeySlot does not support clearing |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| Description: | The interface shall delete the current content of the KeySlot. |
| 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): | keyslot | KeySlot 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::kIncompatibleObject | rollback_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::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowPersist |
| ara::crypto::CryptoErrc::kBusyResource | rollback_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. |
| 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::kNoSuchValue | rollback_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. |
| 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::kNoSuchValue | rollback_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. |
| 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): | cryptoProvider | the 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::kIncompatibleArguments | rollback_semantics |
| The CryptoProvider cannot load the PublicKey |
| ara::crypto::CryptoErrc::kBusyResource | rollback_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. |
| 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): | ocspResponse | The OCSP response to be used during certificate validation. |
| trustedOcspIssuerCertificate | If 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. |
| 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): | trustedCertificate | a 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. |
| 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): | untrustedCertificate | a 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. |
| 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): | ignoredExtensionOid | the 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. |
| 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): | currentTime | The 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. |
| 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): | CertificateValidationOptions | A 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::kInvalidArgument | rollback_semantics |
| an invalid CertificateValidationOptions has been provided |
| Description: | Set validation options to be used during certificate validation. |
| 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): | certificate | The 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::kIncompatibleArguments | rollback_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. |
| 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): | certificateChain | The 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::kIncompatibleArguments | rollback_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. |
| 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. |
| 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::kNoSuchValue | rollback_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. |
| 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): | instanceSpecifier | An 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::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| Violations: | ProcessMappingViolation | In case InstanceSpecifier does not point to a PortPrototype typed by a CryptoCertificateInterface modeled for the current process. |
| InsufficientPermissionsViolation | In 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. |
| 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): | signerCtx | the fully configured SignerPrivateCtx to be used for signing this certificate request |
| subjectDn | the DN to be used in the CSR |
| publicKey | the public key to be used in the CSR. Must correspond to the private key configured in the signerCtx. |
| attributes | the 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::kInvalidArgument | rollback_semantics |
| if the attributes parameter contains invalid data |
| ara::crypto::CryptoErrc::kUninitializedContext | rollback_semantics |
| if the context was not initialized by a key value |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics |
| if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics |
| if the allowed usage of the key does not include kAllowSigGeneration |
| ara::crypto::CryptoErrc::kInvalidArgument | rollback_semantics |
| if the publicKey does not correspond to the private key configured at the signerCtx |
| Description: | Create certificate signing request according to RFC 2986. |
| 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): | dnString | string 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::kInvalidArgument | rollback_semantics |
| if the provided DN string is invalid. |
| Description: | Create DN from string representation. |
| 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): | dn | a DN serialized according to the provided format |
| formatId | input 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::kInvalidArgument | rollback_semantics |
| if the provided dn buffer is invalid. |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_semantics |
| if the specified FormatId is unknown or not supported |
| Description: | Create DN from a serialized buffer. |
| 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): | certList | a list of certificates that should be verified |
| issuerCertList | a list of issuer certificates of the certificates that should be verified |
| signerCtx | an 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::kUninitializedContext | rollback_semantics |
| if the signer context is not initialized by a key |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| Description: | Create OCSP request for specified list of certificates according to RFC 6960. |
| 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): | cert | a certificate that should be verified |
| issuerCert | the issuer certificate of the certificate that should be verified |
| signerCtx | an 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::kUninitializedContext | rollback_semantics |
| if the signer context is not initialized by a key |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| Description: | Create OCSP request for specified certificate according to RFC 6960. |
| 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): | crlInstanceSpecifier | instance 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::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| Violations: | ProcessMappingViolation | In case InstanceSpecifier does not point to a PortPrototype typed by a CryptoCertificateInterface modeled for the current process. |
| InsufficientPermissionsViolation | In 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. |
| 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): | instanceSpecifier | an InstanceSpecifier identifying a certificate slot |
| certificate | a 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::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| Violations: | ProcessMappingViolation | In case InstanceSpecifier does not point to a PortPrototype typed by a CryptoCertificateInterface modeled for the current process. |
| InsufficientPermissionsViolation | In case the current process does not have write permissions, i.e., CryptoCertificateToPortPrototypeMapping.writeAccess != True |
| Description: | Persistently store a certificate in a certificate slot. |
| 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): | instanceSpecifier | an InstanceSpecifier identifying a certificate group |
| certificate | a 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::kInsufficientCapacity | rollback_semantics |
| if the capacity of the certificate group is not sufficient to store the certificate |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| Violations: | ProcessMappingViolation | In case InstanceSpecifier does not point to a PortPrototype typed by a CryptoCertificateGroupInterface modeled for the current process. |
| InsufficientPermissionsViolation | In case the current process does not have write permissions, i.e., CryptoCertificateGroupToPortPrototypeMapping.writeAccess != True |
| Description: | Persistently store a certificate in a certificate group. |
| 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): | crlInstanceSpecifier | ara::core::InstanceSpecifier to the RPortPrototype of a CryptoCertificateInterface that identifies the certificate for which the CRL shall be imported |
| crl | serialized CRL or Delta CRL |
| formatId | the 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::kInvalidArgument | rollback_semantics |
| if crl does not conform to the specified format |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_semantics |
| if the specified FormatId is unknown or not supported |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| Violations: | ProcessMappingViolation | In case InstanceSpecifier does not point to a PortPrototype typed by a CryptoCertificateInterface modeled for the current process. |
| InsufficientPermissionsViolation | In 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. |
| 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): | cert | certificate encoded in the given format |
| formatId | input 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::kInvalidArgument | rollback_semantics |
| if the cert argument cannot be parsed |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_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. |
| 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): | certChain | certificate chain encoded in the given format |
| formatId | input 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::kInvalidArgument | rollback_semantics |
| if the certChain argument cannot be parsed |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_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. |
| 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): | response | a serialized OCSP response |
| formatId | the 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::kInvalidArgument | rollback_semantics |
| if the response argument cannot be parsed |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_semantics |
| if the specified FormatId is unknown or not supported |
| Description: | Parse serialized OCSP response. |
| 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): | instanceSpecifier | an InstanceSpecifier identifying a certificate group |
| certificate | a 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::kNoSuchValue | rollback_semantics |
| if the certificate group does not contain the certificate to be removed |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics |
| if the operation temporarily cannot be performed |
| Violations: | ProcessMappingViolation | In case InstanceSpecifier does not point to a PortPrototype typed by a CryptoCertificateGroupInterface modeled for the current process. |
| InsufficientPermissionsViolation | In case the current process does not have write permissions, i.e., CryptoCertificateGroupToPortPrototypeMapping.writeAccess != True |
| Description: | Remove a certificate from a certificate group. |
| 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): | instanceSpecifier | An 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::kEmptyCertificateSlot | rollback_semantics |
| The CryptoCertificate identified by the provided InstanceSpecifier does not contain a persisted Certificate |
| Violations: | ProcessMappingViolation | In 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. |
| 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): | instanceSpecifier | An 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: | ProcessMappingViolation | In 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. |