DEENESPTFRRUARHIKOZHNL

clase 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

Guía del usuarioGENERADO POR IA

Sirve como interfaz común para la inspección segura para subprocesos y el almacenamiento persistente de objetos criptográficos.
GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: 156a618ba987 Procedencia Preguntas abiertas (2)
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

Sirve como interfaz común para la inspección segura para subprocesos y el almacenamiento persistente de objetos criptográficos.

La interfaz ara::crypto::cryp::CryptoObject define la abstracción común para todos los objetos criptográficos en la pila criptográfica de Adaptive y regula su ciclo de vida mediante Sptr [SWS_CRYPT_20501]. Permite la lectura segura para subprocesos de identificadores de algoritmos e indicadores de uso, y admite la sobreescritura permanente de material de clave en un WriteableKeySlot [SWS_CRYPT_20505], [SWS_CRYPT_20517]. Durante el proceso de almacenamiento, los códigos de error definidos con semántica de reversión garantizan la integridad de los datos de la ranura de memoria subyacente [SWS_CRYPT_20517].

Contexto

La interfaz ara::crypto::cryp::CryptoObject constituye la abstracción común para todos los objetos criptográficos que pueden ser reconocidos y gestionados por un proveedor de criptografía. La clase extiende ara::crypto::Serializable y define propiedades fundamentales como la identificación de algoritmos, las restricciones de uso y los mecanismos para el almacenamiento persistente. Los interlocutores típicos son las aplicaciones llamantes, el proveedor de criptografía suministrador y las memorias de destino en forma de instancias de WriteableKeySlot.

Ciclo de vida

Los objetos criptográficos se gestionan dentro de la plataforma principalmente mediante propiedad compartida. Para ello, la clase define el alias canónico de puntero inteligente ara::crypto::cryp::CryptoObject::Sptr como std::shared_ptr<CryptoObject> [SWS_CRYPT_20501]. Las instancias concretas deberían ser instanciadas por las rutinas especializadas de fábrica y de carga de un proveedor de criptografía y puestas a disposición del llamante mediante este tipo de puntero. Pregunta Q-36e2bd12d7dc8b98 (abierta) Todos los métodos declarados de la interfaz están especificados como seguros para subprocesos y seguros frente a excepciones (exception safe, noexcept), lo que garantiza un acceso concurrente seguro de lectura y almacenamiento a través de múltiples subprocesos [SWS_CRYPT_20505], [SWS_CRYPT_50092], [SWS_CRYPT_20517]. La liberación del objeto y del material de clave asociado se produce automáticamente tan pronto como se extingue la última referencia de Sptr.

Ruta de uso

Una ruta de uso típica incluye la identificación de las propiedades criptográficas de un objeto y su posterior almacenamiento persistente. En primer lugar, la aplicación consulta a través de GetAlgId() el identificador de algoritmo del objeto como ara::crypto::AlgIdString [SWS_CRYPT_20505]. A continuación, se determinan los indicadores de uso permitidos (AllowedUsageFlags) mediante GetAllowedUsage() [SWS_CRYPT_50092], para asegurar que el objeto esté autorizado para la operación prevista. Para el resguardo permanente, la aplicación pasa una ranura de clave con permisos de escritura al método Save() [SWS_CRYPT_20517]. El material de clave, así como los metadatos correspondientes, se almacenan seguidamente en la ranura de destino, sobrescribiéndose los datos previamente existentes en la ranura [SWS_CRYPT_20517].

Inspección y persistencia de un CryptoObjectAplicaciónCryptoObjectWriteableKeySlotGetAlgId()AlgIdStringGetAllowedUsage()AllowedUsageFlags (kAllowPersist)Save(keyslot)Escritura de material de clave y metadatosSpeicherquittungResult<void>

Diagrama de secuencia: Flujo típico para la inspección y persistencia de un objeto criptográfico en un KeySlot. Fuentes: [SWS_CRYPT_20505], [SWS_CRYPT_50092], [SWS_CRYPT_20517].

Escenarios de error

Mientras que GetAlgId() [SWS_CRYPT_20505] y GetAllowedUsage() [SWS_CRYPT_50092] no muestran códigos de error estandarizados y, en caso de éxito, devuelven el resultado respectivo en un ara::core::Result, la operación de persistencia Save() define condiciones de error específicas con semántica de reversión vinculante [SWS_CRYPT_20517]:

  • ara::crypto::CryptoErrc::kIncompatibleObject: Se produce cuando el objeto es incompatible con el WriteableKeySlot proporcionado, por ejemplo, porque los identificadores de algoritmo (AlgId) difieren entre sí o la ranura de clave pertenece a un proveedor de criptografía diferente [SWS_CRYPT_20517].
  • ara::crypto::CryptoErrc::kUsageViolation: Señaliza un uso no permitido si los indicadores de uso de la clave declarados mediante GetAllowedUsage() no contienen el derecho de persistencia (kAllowPersist) [SWS_CRYPT_50092], [SWS_CRYPT_20517].
  • ara::crypto::CryptoErrc::kBusyResource: Se devuelve cuando el recurso de memoria subyacente está temporalmente ocupado y la operación no puede ejecutarse de forma inmediata [SWS_CRYPT_20517].

Gracias a la semántica de reversión, el estado del WriteableKeySlot permanece intacto ante cualquiera de estos errores, de modo que no quedan datos de clave parcialmente escritos o corrompidos en la memoria [SWS_CRYPT_20517].

Esta guía se basa en la especificación AUTOSAR Adaptive R25-11 y resume los requisitos para la interfaz ara::crypto::cryp::CryptoObject.

Mapa de miembros

Alias de tipo

1

Diagrama de clases

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

Vista de detalle

Selecciona una entrada en el índice.

Métodos

GetAlgId función

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 función

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;

Alias de tipo

Sptr alias de tipo

Smart pointer of the interface.

Documentación de los métodos

función 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#901d0d0f
Content hash
901d0d0f
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

función 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#01f49be8
Content hash
01f49be8
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

función 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.

GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: 0aae854cf6a9 Procedencia
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

El método Save de la interfaz ara::crypto::cryp::CryptoObject sirve para almacenar de forma persistente material de clave junto con los metadatos correspondientes en un WriteableKeySlot proporcionado ([SWS_CRYPT_20517]). Los datos previamente almacenados en el KeySlot de destino se sobrescriben durante la ejecución ([SWS_CRYPT_20517]).

Como parámetro se pasa keyslot del tipo WriteableKeySlot::Sptr, que representa el espacio de memoria subyacente ([SWS_CRYPT_20517]). La función está especificada como noexcept y exception safe, y entrega como valor devuelto un ara::core::Result<void>, el cual está vacío en caso de éxito ([SWS_CRYPT_20517]).

En caso de error, se aplica una semántica de reversión ([SWS_CRYPT_20517]). Específicamente, se devuelven los siguientes códigos de error:

  • ara::crypto::CryptoErrc::kIncompatibleObject: la clave es incompatible con el KeySlot, por ejemplo debido a una AlgId discrepante o a la asignación a otro CryptoProvider ([SWS_CRYPT_20517]).
  • ara::crypto::CryptoErrc::kUsageViolation: el uso permitido de la clave no incluye el permiso kAllowPersist ([SWS_CRYPT_20517]).
  • ara::crypto::CryptoErrc::kBusyResource: la operación no se puede ejecutar temporalmente ([SWS_CRYPT_20517]).

Con respecto a la concurrencia, el método está declarado como thread-safe ([SWS_CRYPT_20517]).

Esta nota de uso fue generada por una IA a partir de la especificación AUTOSAR R25-11.

Guía del implementador pendiente (complejidad 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#44d17b44
Content hash
44d17b44
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

Documentación de los alias de tipo

alias de tipo 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#0fc1bef1
Content hash
0fc1bef1
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