DEENESPTFRRUARHIKOZHNL

class ara::crypto::cryp::CryptoObject

[SWS_CRYPT_20500] Upstream: RS_CRYPTO_02005

class CryptoObject :           public ara::crypto::Serializable {...};

A common interface for all cryptographic objects recognizable by the Crypto Provider.

Header-Datei#include "ara/crypto/cryp/cryobj/crypto_object.h"
Forwarding-Header#include "ara/crypto/crypto_fwd.h"
Scopenamespace ara::crypto::cryp
Basisklasse(n)ara::crypto::Serializable

User GuideAI-GENERATED

Serves as a common interface for thread-safe inspection and persistent storage of cryptographic objects.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 156a618ba987 Provenance Open questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Serves as a common interface for thread-safe inspection and persistent storage of cryptographic objects.

The interface ara::crypto::cryp::CryptoObject defines the common abstraction for all cryptographic objects in the Adaptive crypto stack and governs their lifecycle via Sptr [SWS_CRYPT_20501]. It enables the thread-safe retrieval of algorithm identifiers as well as usage flags and supports the persistent overwriting of key material in a WriteableKeySlot [SWS_CRYPT_20505], [SWS_CRYPT_20517]. During the storage operation, defined error codes with rollback semantics ensure the data integrity of the underlying storage slot [SWS_CRYPT_20517].

Context

The interface ara::crypto::cryp::CryptoObject forms the common abstraction for all cryptographic objects that can be recognized and managed by a crypto provider. The class extends ara::crypto::Serializable and defines fundamental properties such as algorithm identification, usage restrictions, and mechanisms for persistent storage. Typical interaction partners are calling applications, the providing crypto provider, and target storages in the form of WriteableKeySlot instances.

Lifecycle

Cryptographic objects are primarily managed within the platform via shared ownership. For this purpose, the class defines the canonical smart pointer alias ara::crypto::cryp::CryptoObject::Sptr as std::shared_ptr<CryptoObject> [SWS_CRYPT_20501]. Concrete instances are likely instantiated by the specialized factory and loader routines of a crypto provider and made available to the caller via this pointer type. Question Q-36e2bd12d7dc8b98 (open) All declared methods of the interface are specified as thread-safe and exception-safe (exception safe, noexcept), thereby ensuring safe concurrent read and store access across multiple threads [SWS_CRYPT_20505], [SWS_CRYPT_50092], [SWS_CRYPT_20517]. The release of the object and the associated key material occurs automatically as soon as the last Sptr reference expires.

Usage Path

A typical usage path comprises the identification of an object's cryptographic properties and its subsequent persistent storage. First, the application queries the algorithm identifier of the object as ara::crypto::AlgIdString via GetAlgId() [SWS_CRYPT_20505]. Subsequently, the permitted usage flags (AllowedUsageFlags) are determined via GetAllowedUsage() [SWS_CRYPT_50092] to ensure that the object is authorized for the intended operation. For permanent preservation, the application passes a writable key slot to the method Save() [SWS_CRYPT_20517]. The key material as well as associated metadata are then stored in the destination slot, overwriting previously existing data in the slot [SWS_CRYPT_20517].

Inspection and persistence of a CryptoObjectApplicationCryptoObjectWriteableKeySlotGetAlgId()AlgIdStringGetAllowedUsage()AllowedUsageFlags (kAllowPersist)Save(keyslot)Write key material and metadataSpeicherquittungResult<void>

Sequence diagram: Typical sequence for inspecting and persisting a cryptographic object in a KeySlot. Sources: [SWS_CRYPT_20505], [SWS_CRYPT_50092], [SWS_CRYPT_20517].

Error Scenarios

While GetAlgId() [SWS_CRYPT_20505] and GetAllowedUsage() [SWS_CRYPT_50092] specify no standardized error codes and return the respective result in a ara::core::Result in case of success, the persistence operation Save() defines specific error conditions with mandatory rollback semantics [SWS_CRYPT_20517]:

  • ara::crypto::CryptoErrc::kIncompatibleObject: Occurs if the object is incompatible with the passed WriteableKeySlot, for example because the algorithm identifiers (AlgId) differ from each other or the key slot belongs to a different crypto provider [SWS_CRYPT_20517].
  • ara::crypto::CryptoErrc::kUsageViolation: Signals unauthorized usage if the key's usage flags declared via GetAllowedUsage() do not include the permission for persistence (kAllowPersist) [SWS_CRYPT_50092], [SWS_CRYPT_20517].
  • ara::crypto::CryptoErrc::kBusyResource: Is returned if the underlying storage resource is temporarily busy and the operation cannot be executed immediately [SWS_CRYPT_20517].

Thanks to the rollback semantics, the state of the WriteableKeySlot remains intact upon any of these errors, ensuring that no partially written or corrupted key data remains in storage [SWS_CRYPT_20517].

This guide is based on the AUTOSAR Adaptive R25-11 specification and summarizes the requirements for the interface ara::crypto::cryp::CryptoObject.

Member map

Type aliases

1

Class diagram

Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.

G nara__crypto__cryp__CryptoObject679 CryptoObject + GetAlgId() + GetAllowedUsage() + Save() nara__crypto__Serializable855 Serializable nara__crypto__cryp__CryptoObject679->nara__crypto__Serializable855 nara__crypto__cryp__PrivateKey762 PrivateKey nara__crypto__cryp__PrivateKey762->nara__crypto__cryp__CryptoObject679 nara__crypto__cryp__PublicKey940 PublicKey nara__crypto__cryp__PublicKey940->nara__crypto__cryp__CryptoObject679 nara__crypto__cryp__SymmetricKey111 SymmetricKey nara__crypto__cryp__SymmetricKey111->nara__crypto__cryp__CryptoObject679

Detail view

Select an entry in the outline.

Methods

GetAlgId function

The interface shall return the AlgId of this CryptoObject.

virtual ara::core::Result< ara::crypto::AlgIdString > GetAlgId () const noexcept=0;

The interface shall return the allowed usage of the key.

virtual ara::core::Result< AllowedUsageFlags > GetAllowedUsage () const noexcept=0;
Save function

The interface shall persistently store the key-material and its meta-data in the provided WriteableKeySlot. Data previously stored in keyslot shall be overwritten.

virtual ara::core::Result< void > Save (WriteableKeySlot::Sptr keyslot) const noexcept=0;

Type aliases

Sptr type alias

Smart pointer of the interface.

Method documentation

function GetAlgId [SWS_CRYPT_20505] Upstream: RS_CRYPTO_02005

virtual ara::core::Result< ara::crypto::AlgIdString > GetAlgId () const noexcept=0;

The interface shall return the AlgId of this CryptoObject.

Header-Datei#include "ara/crypto/cryp/cryobj/crypto_object.h"
Scopeclass ara::crypto::cryp::CryptoObject
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
ara::core::Result<ara::crypto::AlgIdString >A result containing the AlgId of this CryptoObject

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_20505
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_20505@rel:R25-11#fa5364ac
Content hash
fa5364ac
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_20505
Status: valid/unmigrated Version: rel:R25-11#974298db Versionshistorie & Revisions (1 transition, 7 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_20505@rel:R25-11#974298db
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#fa5364ac2026-09-30
  • R20-11rel:R20-11#3073d8c92026-10-14
  • R21-11rel:R21-11#3073d8c92026-10-14
  • R22-11rel:R22-11#131cf8662026-10-14
  • R23-11rel:R23-11#b34bd5a42026-10-14
  • R24-11rel:R24-11#36c55a302026-10-14
  • R25-11rel:R25-11#974298db2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function GetAllowedUsage [SWS_CRYPT_50092] Upstream: RS_CRYPTO_02005

virtual ara::core::Result< AllowedUsageFlags > GetAllowedUsage () const noexcept=0;

The interface shall return the allowed usage of the key.

Header-Datei#include "ara/crypto/cryp/cryobj/crypto_object.h"
Scopeclass ara::crypto::cryp::CryptoObject
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
ara::core::Result<AllowedUsageFlags >A result containing the allowed usage of the key

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_50092
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50092@rel:R25-11#eb9b3394
Content hash
eb9b3394
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50092
Status: valid/unmigrated Version: rel:R25-11#eb9b3394 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50092@rel:R25-11#eb9b3394
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function Save [SWS_CRYPT_20517] Upstream: RS_CRYPTO_02004

virtual ara::core::Result< void > Save (WriteableKeySlot::Sptr keyslot) const noexcept=0;

The interface shall persistently store the key-material and its meta-data in the provided WriteableKeySlot. Data previously stored in keyslot shall be overwritten.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 0aae854cf6a9 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The Save method of the ara::crypto::cryp::CryptoObject interface serves to persistently store key material along with associated metadata in a provided WriteableKeySlot ([SWS_CRYPT_20517]). Data previously stored in the target KeySlot is overwritten during execution ([SWS_CRYPT_20517]).

keyslot of type WriteableKeySlot::Sptr, which represents the underlying storage space, is passed as a parameter ([SWS_CRYPT_20517]). The function is specified as noexcept as well as exception safe and returns a ara::core::Result<void> as its return value, which is empty in case of success ([SWS_CRYPT_20517]).

In case of an error, rollback semantics apply ([SWS_CRYPT_20517]). Specifically, the following error codes are returned:

  • ara::crypto::CryptoErrc::kIncompatibleObject: The key is incompatible with the KeySlot, for example due to a differing AlgId or assignment to another CryptoProvider ([SWS_CRYPT_20517]).
  • ara::crypto::CryptoErrc::kUsageViolation: The permitted usage of the key does not include the right kAllowPersist ([SWS_CRYPT_20517]).
  • ara::crypto::CryptoErrc::kBusyResource: The operation cannot be executed temporarily ([SWS_CRYPT_20517]).

Regarding concurrency, the method is declared as thread-safe ([SWS_CRYPT_20517]).

This usage note was generated by an AI based on the AUTOSAR R25-11 specification.

Implementer's Guide to follow (complexity I1)

Header-Datei#include "ara/crypto/cryp/cryobj/crypto_object.h"
Scopeclass ara::crypto::cryp::CryptoObject
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
keyslotKeySlot representing the underlying storage

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if the key is incompatible to the KeySlot, e.g., because the AlgId of the KeySlot is incompatible to the AlgId of the key or because the KeySlot belongs to a different CryptoProvider
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the key does not include kAllowPersist
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics if the operation temporarily cannot be performed

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_20517
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_20517@rel:R25-11#401495a6
Content hash
401495a6
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_20517
Status: valid/unmigrated Version: rel:R25-11#27ad83e4 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_20517@rel:R25-11#27ad83e4
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#401495a62026-09-30
  • R19-11rel:R19-11#12df20182026-10-14
  • R20-11rel:R20-11#74dce1282026-10-14
  • R21-11rel:R21-11#9fdecde72026-10-14
  • R22-11rel:R22-11#4e577c772026-10-14
  • R23-11rel:R23-11#302bac292026-10-14
  • R24-11rel:R24-11#7745263b2026-10-14
  • R25-11rel:R25-11#27ad83e42026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

Type alias documentation

type alias Sptr [SWS_CRYPT_20501] Upstream: RS_CRYPTO_02005

using Sptr = std::shared_ptr<CryptoObject>;

Smart pointer of the interface.

Header-Datei#include "ara/crypto/cryp/cryobj/crypto_object.h"
Scopeclass ara::crypto::cryp::CryptoObject
SymbolSptr

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_20501
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_20501@rel:R25-11#2f0be81f
Content hash
2f0be81f
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_20501
Status: valid/unmigrated Version: rel:R25-11#4816c7c1 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_20501@rel:R25-11#4816c7c1
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#2f0be81f2026-09-30
  • R19-11rel:R19-11#b83af8272026-10-14
  • R20-11rel:R20-11#eb73b7d72026-10-14
  • R21-11rel:R21-11#eb73b7d72026-10-14
  • R22-11rel:R22-11#cc06a6ac2026-10-14
  • R23-11rel:R23-11#0db32e6b2026-10-14
  • R24-11rel:R24-11#0db32e6b2026-10-14
  • R25-11rel:R25-11#4816c7c12026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill