DEENESPTFRRUARHIKOZHNL

classe ara::crypto::cryp::CryptoContext

[SWS_CRYPT_20400] Upstream: RS_CRYPTO_02008

class CryptoContext {...};

A common interface of a mutable cryptographic context, i.e. that is not binded to a single crypto object.

Header-Datei#include "ara/crypto/cryp/crypto_context.h"
Forwarding-Header#include "ara/crypto/crypto_fwd.h"
Scopenamespace ara::crypto::cryp

Guide utilisateurGÉNÉRÉ PAR IA

Fournit une interface de base pour les contextes cryptographiques modifiables permettant l'interrogation thread-safe de l'ID d'algorithme.
GÉNÉRÉ PAR IA non vérifié Modèle : gemini-3.8-flash-medium · Effort : medium · Température : non réglable · Prompt : 40f33685b357 Provenance Questions ouvertes (2)
traduit du guide allemandgemini-3.8-flash-low · 2026-10-13 · Original allemand

Fournit une interface de base pour les contextes cryptographiques modifiables permettant l'interrogation thread-safe de l'ID d'algorithme.

L'interface sert de classe de base commune pour les contextes cryptographiques modifiables qui ne sont pas liés de manière fixe à un objet cryptographique individuel. Via la méthode purement virtuelle GetAlgId(), elle permet l'interrogation thread-safe de l'identifiant d'algorithme sous forme de ara::core::Result [SWS_CRYPT_20411]. Afin d'empêcher les duplications d'état indésirables, les opérations de copie et de déplacement sont totalement interdites [SWS_CRYPT_41003]. La libération s'effectue de manière déterministe et sûre via un destructeur virtuel par défaut.

Contexte

L'interface ara::crypto::cryp::CryptoContext définit l'abstraction fondamentale pour les contextes cryptographiques modifiables (mutable cryptographic contexts) au sein du module crypto de l'AUTOSAR Adaptive Platform. Contrairement aux objets cryptographiques statiques, un tel contexte n'est pas lié rigidement à un unique objet cryptographique. Il sert plutôt de classe de base commune pour différents contextes de traitement cryptographique dont l'état interne peut changer pendant l'exécution d'opérations cryptographiques.

La fonction membre purement virtuelle GetAlgId() fait office d'élément central de cette interface de base. Elle permet aux partenaires d'interaction d'interroger l'identifiant de l'algorithme cryptographique actuellement configuré dans le contexte [SWS_CRYPT_20411]. Des contextes de calcul et de transformation cryptographiques concrets, tels que pour des services de hachage, de signature ou de chiffrement, devraient être dérivés de CryptoContext dans le système afin de fournir des fonctionnalités d'algorithmes spécifiques. Question Q-203d40209cd355fa (ouverte)

Cycle de vie

Le cycle de vie de CryptoContext est caractérisé par une identité unique et des relations de propriété strictes. Afin d'empêcher la duplication incontrôlée ou les transferts incohérents d'états de contexte au moment de la compilation, les opérations de copie sémantiques sont totalement proscrites. Le constructeur de copie [SWS_CRYPT_41003] tout comme l'opérateur d'assignation par copie [SWS_CRYPT_30214] sont explicitement déclarés comme supprimés (=delete).

De la même manière, la définition de l'interface interdit le déplacement de contextes : le constructeur de déplacement [SWS_CRYPT_41004] ainsi que l'opérateur d'assignation par déplacement [SWS_CRYPT_30215] sont supprimés (=delete). Les instances de classes dérivées restent donc en permanence à leur emplacement mémoire d'origine. La destruction et la libération des ressources s'effectuent de façon déterministe via le destructeur virtuel défini comme default et noexcept [SWS_CRYPT_20401]. Cela garantit que les objets de contexte dérivés peuvent être libérés de manière sûre et sans fuite de ressources via des pointeurs vers l'interface de base.

En ce qui concerne la concurrence, l'exigence pour GetAlgId() spécifie expressément la sécurité des threads [SWS_CRYPT_20411]. Plusieurs threads peuvent ainsi lire simultanément et sans synchronisation externe l'identifiant d'algorithme du même contexte.

Parcours d'utilisation

Étant donné que CryptoContext est une interface purement virtuelle, les développeurs d'applications ne peuvent pas créer d'instances directes. Les instances de classes de contexte spécialisées devraient généralement être instanciées via des fonctions de fabrique ou des composants fournisseurs de la pile crypto et mises à disposition de l'appelant via des pointeurs ou des références. Question Q-728a7b6dd526eb64 (ouverte) Le flux d'utilisation typique au niveau de l'interface de base comprend les phases suivantes :

  • Mise à disposition : un appelant reçoit d'un fournisseur crypto une référence ou un pointeur vers un contexte configuré.
  • Vérification de l'algorithme : via l'appel de GetAlgId(), l'identifiant d'algorithme est interrogé et évalué [SWS_CRYPT_20411] afin de s'assurer que le contexte respecte les spécifications requises.
  • Opération et nettoyage : après l'exécution des opérations spécifiques à l'algorithme via l'interface dérivée, le contexte est automatiquement libéré via le destructeur virtuel [SWS_CRYPT_20401].

Scénarios d'erreur

Le concept de gestion des erreurs de CryptoContext suit la conception générale tolérante aux pannes de l'AUTOSAR Adaptive Platform et renonce aux exceptions C++. La méthode GetAlgId() est spécifiée comme sûre vis-à-vis des exceptions (exception safe) et renvoie son résultat dans un ara::core::Result<ara::crypto::AlgIdString> [SWS_CRYPT_20411]. Si une erreur survient lors de la détermination de l'ID d'algorithme, elle est acheminée dans le canal d'erreur de l'objet Result.

Conformément à la spécification, GetAlgId() ne définit aucun code d'erreur standardisé [SWS_CRYPT_20411]. Les appelants doivent donc principalement vérifier si le Result contient une valeur valide avant d'accéder à la chaîne de caractères de l'ID d'algorithme. Lors de la destruction de l'objet, le destructeur virtuel déclaré avec noexcept garantit qu'aucune exception n'est propagée pendant la destruction et que le nettoyage s'achève toujours de manière fiable [SWS_CRYPT_20401].

Ce guide est basé sur la spécification AUTOSAR Adaptive R25-11 et a été généré par un assistant de curation IA.

Carte des membres

Constructeurs et destructeur

2

Méthodes

1

Opérateurs

1

Diagramme de classes

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

G nara__crypto__cryp__CryptoContext85 CryptoContext + CryptoContext() + operator=() + ~CryptoContext() + GetAlgId() nara__crypto__cryp__AuthCipherCtx142 AuthCipherCtx nara__crypto__cryp__AuthCipherCtx142->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__DecryptorPrivateCtx616 DecryptorPrivateCtx nara__crypto__cryp__DecryptorPrivateCtx616->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__EncryptorPublicCtx829 EncryptorPublicCtx nara__crypto__cryp__EncryptorPublicCtx829->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__HashFunctionCtx412 HashFunctionCtx nara__crypto__cryp__HashFunctionCtx412->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__KeyAgreementPrivateCtx203 KeyAgreementPrivateCtx nara__crypto__cryp__KeyAgreementPrivateCtx203->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__KeyDecapsulatorPrivateCtx748 KeyDecapsulatorPrivateCtx nara__crypto__cryp__KeyDecapsulatorPrivateCtx748->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__KeyDerivationFunctionCtx485 KeyDerivationFunctionCtx nara__crypto__cryp__KeyDerivationFunctionCtx485->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__KeyEncapsulatorPublicCtx699 KeyEncapsulatorPublicCtx nara__crypto__cryp__KeyEncapsulatorPublicCtx699->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__MessageAuthnCodeCtx845 MessageAuthnCodeCtx nara__crypto__cryp__MessageAuthnCodeCtx845->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__ProtectedKeyImportCtx279 ProtectedKeyImportCtx nara__crypto__cryp__ProtectedKeyImportCtx279->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__RandomGeneratorCtx512 RandomGeneratorCtx nara__crypto__cryp__RandomGeneratorCtx512->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__SignerPrivateCtx943 SignerPrivateCtx nara__crypto__cryp__SignerPrivateCtx943->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__SymmetricCipherCtx167 SymmetricCipherCtx nara__crypto__cryp__SymmetricCipherCtx167->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__SymmetricKeyWrapperCtx465 SymmetricKeyWrapperCtx nara__crypto__cryp__SymmetricKeyWrapperCtx465->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__VerifierPublicCtx35 VerifierPublicCtx nara__crypto__cryp__VerifierPublicCtx35->nara__crypto__cryp__CryptoContext85

Vue détaillée

Sélectionnez une entrée dans le plan.

Constructeurs et destructeur

CryptoContext fonction 2

Copy-Constructor.

Surcharges CryptoContext 2
CryptoContext (const CryptoContext &)=delete; SWS_CRYPT_41003
CryptoContext (CryptoContext &&)=delete; SWS_CRYPT_41004

Destructor.

virtual ~CryptoContext () noexcept=default;

Méthodes

GetAlgId fonction

The interface shall return the AlgId of the context.

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

Opérateurs

operator= fonction 2

Copy-assign another CryptoContext to this instance.

Surcharges = 2
CryptoContext & operator= (const CryptoContext &other)=delete; SWS_CRYPT_30214
CryptoContext & operator= (CryptoContext &&other)=delete; SWS_CRYPT_30215

Documentation des méthodes

fonction CryptoContext [SWS_CRYPT_41003] Upstream: RS_CRYPTO_02004

CryptoContext (const CryptoContext &)=delete;

Copy-Constructor.

Header-Datei#include "ara/crypto/cryp/crypto_context.h"
Scopeclass ara::crypto::cryp::CryptoContext

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

Record
AUTOSAR/AP/record/SWS_CRYPT_41003
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_41003@rel:R25-11#4c824b01
Content hash
4c824b01
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_41003
Status: valid/unmigrated Version: rel:R25-11#98ee9054 Versionshistorie & Revisions (1 transition, 4 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_41003@rel:R25-11#98ee9054
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#8cdfc0542026-09-30
  • R23-11rel:R23-11#24b116da2026-10-14
  • R24-11rel:R24-11#98ee90542026-10-14
  • R25-11rel:R25-11#98ee90542026-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

fonction CryptoContext [SWS_CRYPT_41004] Upstream: RS_CRYPTO_02004

CryptoContext (CryptoContext &&)=delete;

Move-Constructor.

Header-Datei#include "ara/crypto/cryp/crypto_context.h"
Scopeclass ara::crypto::cryp::CryptoContext

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

Record
AUTOSAR/AP/record/SWS_CRYPT_41004
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_41004@rel:R25-11#e7b86be0
Content hash
e7b86be0
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_41004
Status: valid/unmigrated Version: rel:R25-11#62d2964c Versionshistorie & Revisions (1 transition, 4 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_41004@rel:R25-11#62d2964c
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#e84c8c582026-09-30
  • R23-11rel:R23-11#d9afa7b72026-10-14
  • R24-11rel:R24-11#62d2964c2026-10-14
  • R25-11rel:R25-11#62d2964c2026-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

fonction GetAlgId [SWS_CRYPT_20411] Upstream: RS_CRYPTO_02008

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

The interface shall return the AlgId of the context.

Header-Datei#include "ara/crypto/cryp/crypto_context.h"
Scopeclass ara::crypto::cryp::CryptoContext
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
ara::core::Result<ara::crypto::AlgIdString >the AlgId of the context or an error

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_20411
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_20411@rel:R25-11#805a2d64
Content hash
805a2d64
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_20411
Status: valid/unmigrated Version: rel:R25-11#268ba62b 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_20411@rel:R25-11#268ba62b
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#0505bc8c2026-09-30
  • R19-11rel:R19-11#44b1ac7b2026-10-14
  • R20-11rel:R20-11#1bdef3fa2026-10-14
  • R21-11rel:R21-11#1bdef3fa2026-10-14
  • R22-11rel:R22-11#5dd94a472026-10-14
  • R23-11rel:R23-11#3ac9359d2026-10-14
  • R24-11rel:R24-11#d2d6ca2d2026-10-14
  • R25-11rel:R25-11#268ba62b2026-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

fonction operator= [SWS_CRYPT_30214] Upstream: RS_CRYPTO_02004

CryptoContext & operator= (const CryptoContext &other)=delete;

Copy-assign another CryptoContext to this instance.

Header-Datei#include "ara/crypto/cryp/crypto_context.h"
Scopeclass ara::crypto::cryp::CryptoContext

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

Record
AUTOSAR/AP/record/SWS_CRYPT_30214
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_30214@rel:R25-11#bb0253e3
Content hash
bb0253e3
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_30214
Status: valid/unmigrated Version: rel:R25-11#54e94bf7 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_30214@rel:R25-11#54e94bf7
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#7667e7772026-09-30
  • R20-11rel:R20-11#8da104e32026-10-14
  • R21-11rel:R21-11#78cc10a82026-10-14
  • R22-11rel:R22-11#760b4ede2026-10-14
  • R23-11rel:R23-11#8fd55e4c2026-10-14
  • R24-11rel:R24-11#54e94bf72026-10-14
  • R25-11rel:R25-11#54e94bf72026-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

fonction operator= [SWS_CRYPT_30215] Upstream: RS_CRYPTO_02004

CryptoContext & operator= (CryptoContext &&other)=delete;

Move-assign another CryptoContext to this instance.

Header-Datei#include "ara/crypto/cryp/crypto_context.h"
Scopeclass ara::crypto::cryp::CryptoContext

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

Record
AUTOSAR/AP/record/SWS_CRYPT_30215
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_30215@rel:R25-11#41b26a41
Content hash
41b26a41
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_30215
Status: valid/unmigrated Version: rel:R25-11#f0c7c4e1 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_30215@rel:R25-11#f0c7c4e1
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#e0e202f42026-09-30
  • R20-11rel:R20-11#17d0c85f2026-10-14
  • R21-11rel:R21-11#17d0c85f2026-10-14
  • R22-11rel:R22-11#843bd59e2026-10-14
  • R23-11rel:R23-11#50f4cde12026-10-14
  • R24-11rel:R24-11#f0c7c4e12026-10-14
  • R25-11rel:R25-11#f0c7c4e12026-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

fonction ~CryptoContext [SWS_CRYPT_20401] Upstream: RS_CRYPTO_02008

virtual ~CryptoContext () noexcept=default;

Destructor.

Header-Datei#include "ara/crypto/cryp/crypto_context.h"
Scopeclass ara::crypto::cryp::CryptoContext
Exception-Sicherheitexception safe

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

Record
AUTOSAR/AP/record/SWS_CRYPT_20401
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_20401@rel:R25-11#2ee0f5c0
Content hash
2ee0f5c0
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_20401
Status: valid/unmigrated Version: rel:R25-11#0d1ace43 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_20401@rel:R25-11#0d1ace43
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#a3a37bef2026-09-30
  • R20-11rel:R20-11#0a163ac42026-10-14
  • R21-11rel:R21-11#5ba66c7c2026-10-14
  • R22-11rel:R22-11#91bc35ba2026-10-14
  • R23-11rel:R23-11#40c1b8e32026-10-14
  • R24-11rel:R24-11#66216e1d2026-10-14
  • R25-11rel:R25-11#0d1ace432026-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