Manages storage for cryptographic keys and enables metadata queries as well as modification callbacks.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 15ebff2d544cProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Manages storage for cryptographic keys and enables metadata queries as well as modification callbacks.
The interface encapsulates persistent or volatile storage for cryptographic keys and enables querying key metadata as well as the responsible CryptoProvider[SWS_CRYPT_30403]. Applications can monitor content changes via a registrable observer callback [SWS_CRYPT_30404]. If the slot is empty, access to the key type or its algorithm fails with the error code ara::crypto::CryptoErrc::kEmptyKeySlot[SWS_CRYPT_50055]. Because copying and moving are prohibited, access is thread-safe via shared pointers.
Context
The interface ara::crypto::cryp::KeySlot represents a dedicated storage location for cryptographic keys within the AUTOSAR Adaptive Platform. As an encapsulation of a logical key slot, it manages metadata, type information, and the assignment of supported algorithms for the key stored within it. An instance typically interacts with three parties: the application software, the associated cryp::CryptoProvider (to which a shared reference can be obtained via [SWS_CRYPT_30403]), and an application-specific callback for content monitoring according to [SWS_CRYPT_30404].
A KeySlot is permanently bound to the key storage it represents. Accordingly, the interface prohibits duplicating and moving the instance: both the copy constructor [SWS_CRYPT_50149] and the move constructor [SWS_CRYPT_50150] are explicitly deleted. The same applies to the copy assignment operator [SWS_CRYPT_50147] and the move assignment operator [SWS_CRYPT_50148].
To manage ownership and reference relationships, the class defines the smart pointer type alias Sptr as std::shared_ptr<KeySlot>[SWS_CRYPT_50151]. Deallocation is performed via a virtual default destructor [SWS_CRYPT_50146]. Interpretation: Since the interface defines no public constructors, concrete instances are likely created by the responsible CryptoProvider and provided as Sptr. Question Q-baef4cb1493c96cd (open) All provided methods are declared thread-safe, meaning concurrent read and monitoring accesses from multiple execution contexts are permitted.
Usage Path
Typical interaction with a KeySlot is divided into configuring content monitoring and querying stored key metadata:
Registering an observer: Using RegisterUpdateObserver, the application registers a callback function as well as an application-specific identifier keySlotIdentifier[SWS_CRYPT_30404]. Upon repeated calls, only the most recently passed callback is ever invoked upon updates or deletions of the slot content.
Querying supported algorithms: Via GetPossibleAlgIds, the application determines a list of all algorithm identifiers supported by the slot [SWS_CRYPT_50056].
Checking current key: If a key is present in the slot, GetCryptoObjectType returns the object type of the key [SWS_CRYPT_50054] and GetAlgId returns its concrete algorithm identifier [SWS_CRYPT_50055].
Determining responsible provider: If needed, the managing CryptoProvider can be queried as a shared pointer via GetCryptoProvider[SWS_CRYPT_30403].
Unregistering observer: After monitoring is complete, the registration is revoked via UnregisterUpdateObserver[SWS_CRYPT_30406].
The querying methods safeguard error states via the result type ara::core::Result. If a KeySlot contains no key, the calls GetCryptoObjectType[SWS_CRYPT_50054] and GetAlgId[SWS_CRYPT_50055] each return the standardized error code ara::crypto::CryptoErrc::kEmptyKeySlot with rollback semantics. The methods GetPossibleAlgIds[SWS_CRYPT_50056] and GetCryptoProvider[SWS_CRYPT_30403] specify no standardized error codes. For observer management using RegisterUpdateObserver[SWS_CRYPT_30404] as well as UnregisterUpdateObserver[SWS_CRYPT_30406], implementation-specific errors in the result object are intended in case of error.
This guide was created by an AI based on the specification R25-11.
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.
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.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 9361e576efa7ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The method RegisterUpdateObserver of class ara::crypto::cryp::KeySlot serves to register an application-specific callback function that is notified upon every update of the content of a key slot [SWS_CRYPT_30404]. Here, both modifications of content and the complete clearing of the slot are considered updates [SWS_CRYPT_30404].
Usage and Parameters
The function is included via header ara/crypto/cryp/keyslot.h and accepts callback callback as well as an identifier keySlotIdentifier[SWS_CRYPT_30404]. When called, function object callback receives string keySlotIdentifier as argument to allow unambiguous assignment of the affected slot in the application logic [SWS_CRYPT_30404]. Upon repeated calls to RegisterUpdateObserver by the same application, only the most recently registered callback function is retained and executed [SWS_CRYPT_30404].
Concurrency and Error Handling
The interface is thread-safe (thread-safe) and specified as noexcept without throwing exceptions [SWS_CRYPT_30404]. It returns a ara::core::Result<void>[SWS_CRYPT_30404]. Standardized errors do not exist; in case of an error, an implementation-specific error code is returned [SWS_CRYPT_30404]. Interpretation: The actual invocation of the callback function is likely to occur asynchronously in the context of the crypto driver as soon as the update takes effect in the key storage. Question Q-cfbcc1ddcbe88062 (open)
This usage note is based on the specification of AUTOSAR Adaptive R25-11.
Unregisters any previously UpdateObserver callback that has been registered previously by the application.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: b5edba50839dProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The UnregisterUpdateObserver method of class ara::crypto::cryp::KeySlot serves to deregister an observer callback (UpdateObserver) previously registered by the application [SWS_CRYPT_30406]. The function is declared in header ara/crypto/cryp/keyslot.h, designed as a pure virtual method (=0), and expects no parameters [SWS_CRYPT_30406].
With regard to the invocation context and concurrency, the following boundary conditions apply:
Synchronous semantics and thread safety: Deregistration takes place synchronously and is explicitly specified as thread-safe [SWS_CRYPT_30406]. Calls can thus be executed in a thread-safe manner and concurrently with other operations on the same KeySlot instance.
Exception safety: The method has the specification noexcept and is considered exception-safe [SWS_CRYPT_30406]. Error states therefore never lead to C++ exceptions, but are handled in an orderly fashion via the return object.
As a return value, the function returns a ara::core::Result<void>, which is empty upon successful deregistration or encapsulates an error code in case of an error [SWS_CRYPT_30406]. The specification deliberately defines no standardized AUTOSAR error codes for this call; any errors are therefore vendor- or implementation-specific [SWS_CRYPT_30406]. Callers must check the result for errors, but cannot test for standardized error constants.
In interaction with key management, deregistration reliably prevents the application from receiving further notifications about changes to the key content. If no callback was registered at the time of the call, the function is likely, according to interpretation, to either return successfully without effect or return an implementation-specific error. Question Q-7a1e7e0db0691ce6 (open)
This usage note was generated automatically based on the AUTOSAR specification.
gemini-3.8-flash-low· 2026-10-13 · German original