DEENESPTFRRUARHIKOZHNL

class 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

User GuideKI-GENERIERT

Bietet eine Basisschnittstelle für veränderliche Krypto-Kontexte zur threadsicheren Abfrage der Algorithmus-ID.
KI-GENERIERT ungeprüft Modell: gemini-3.8-flash-medium · Aufwand: medium · Temperatur: nicht steuerbar · Prompt: 40f33685b357 Herkunft Offene Fragen (2)
KI-generiertgemini-3.8-flash-medium · 2026-10-13

Bietet eine Basisschnittstelle für veränderliche Krypto-Kontexte zur threadsicheren Abfrage der Algorithmus-ID.

Die Schnittstelle dient als gemeinsame Basisklasse für veränderliche kryptografische Kontexte, die nicht fest an ein einzelnes Krypto-Objekt gebunden sind. Über die rein virtuelle Methode GetAlgId() ermöglicht sie das threadsichere Abfragen der Algorithmuskennung als ara::core::Result [SWS_CRYPT_20411]. Um unerwünschte Zustandsduplikationen zu verhindern, sind Kopier- und Verschiebeoperationen vollständig unterbunden [SWS_CRYPT_41003]. Die Freigabe erfolgt deterministisch und sicher über einen virtuellen Standard-Destruktor.

Kontext

Die Schnittstelle ara::crypto::cryp::CryptoContext definiert die grundlegende Abstraktion für veränderliche kryptografische Kontexte (mutable cryptographic contexts) innerhalb des Krypto-Moduls der AUTOSAR Adaptive Platform. Im Gegensatz zu statischen Krypto-Objekten ist ein solcher Kontext nicht starr an ein einzelnes kryptografisches Objekt gebunden. Er dient vielmehr als gemeinsame Basisklasse für verschiedene kryptografische Verarbeitungskontexte, deren interner Zustand sich während der Ausführung kryptografischer Operationen verändern kann.

Als zentrales Element dieser Basisschnittstelle fungiert die rein virtuelle Elementfunktion GetAlgId(). Sie ermöglicht es Interaktionspartnern, die Kennung des aktuell im Kontext konfigurierten kryptografischen Algorithmus abzufragen [SWS_CRYPT_20411]. Konkrete kryptografische Berechnungs- und Transformationskontexte, wie beispielsweise für Hash-, Signatur- oder Verschlüsselungsdienste, dürften im System von CryptoContext abgeleitet werden, um spezifische Algorithmenfunktionalitäten bereitzustellen. Frage Q-203d40209cd355fa (offen)

Lebenszyklus

Der Lebenszyklus von CryptoContext ist von einer eindeutigen Identität und strikten Besitzverhältnissen geprägt. Um unkontrolliertes Duplizieren oder inkonsistente Übertragungen von Kontextzuständen zur Übersetzungszeit zu verhindern, sind semantische Kopiervorgänge vollständig untersagt. Sowohl der Kopierkonstruktor [SWS_CRYPT_41003] als auch der Kopierzuweisungsoperator [SWS_CRYPT_30214] sind explizit als gelöscht deklariert (=delete).

In gleicher Weise unterbindet die Schnittstellendefinition das Verschieben von Kontexten: Sowohl der Verschiebekonstruktor [SWS_CRYPT_41004] als auch der Verschiebezuweisungsoperator [SWS_CRYPT_30215] sind gelöscht (=delete). Instanzen von abgeleiteten Klassen verbleiben daher dauerhaft an ihrem ursprünglichen Speicherort. Die Zerstörung und Ressourcenfreigabe erfolgt deterministisch über den virtuellen Destruktor, der als default und noexcept definiert ist [SWS_CRYPT_20401]. Dies stellt sicher, dass abgeleitete Kontextobjekte sicher und ohne Ressourcenlecks über Zeiger auf die Basisschnittstelle freigegeben werden können.

In Bezug auf die Nebenläufigkeit spezifiziert die Anforderung für GetAlgId() ausdrücklich Thread-Sicherheit [SWS_CRYPT_20411]. Mehrere Threads können somit gleichzeitig und ohne externe Synchronisation den Algorithmusbezeichner desselben Kontexts auslesen.

Nutzungspfad

Da CryptoContext eine rein virtuelle Schnittstelle ist, können Anwendungsentwickler keine direkten Instanzen erzeugen. Instanzen spezialisierter Kontextklassen dürften typischerweise über Factory-Funktionen oder Provider-Komponenten des Krypto-Stacks instanziiert und dem Aufrufer über Zeiger oder Referenzen bereitgestellt werden. Frage Q-728a7b6dd526eb64 (offen) Der typische Nutzungsablauf auf Ebene der Basisschnittstelle umfasst folgende Phasen:

  • Bereitstellung: Ein Aufrufer empfängt eine Referenz oder einen Zeiger auf einen konfigurierten Kontext von einem Krypto-Provider.
  • Algorithmenprüfung: Über den Aufruf von GetAlgId() wird die Algorithmuskennung abgefragt und ausgewertet [SWS_CRYPT_20411], um sicherzustellen, dass der Kontext die geforderten Spezifikationen erfüllt.
  • Operation und Bereinigung: Nach Durchführung der algorithmspezifischen Operationen über die abgeleitete Schnittstelle wird der Kontext über den virtuellen Destruktor automatisch freigegeben [SWS_CRYPT_20401].

Fehlerszenarien

Das Fehlerbehandlungskonzept von CryptoContext folgt dem allgemeinen fehlersicheren Design der AUTOSAR Adaptive Platform und verzichtet auf C++-Ausnahmen. Die Methode GetAlgId() ist als ausnahmesicher (exception safe) spezifiziert und liefert ihr Ergebnis in einem ara::core::Result<ara::crypto::AlgIdString> zurück [SWS_CRYPT_20411]. Tritt bei der Bestimmung der Algorithmus-ID ein Fehler auf, wird dieser im Fehlerkanal des Result-Objekts transportiert.

Gemäß Spezifikation definiert GetAlgId() keine standardisierten Fehlercodes [SWS_CRYPT_20411]. Aufrufer müssen daher primär prüfen, ob das Result einen gültigen Wert enthält, bevor sie auf die Zeichenkette der Algorithmus-ID zugreifen. Beim Abbau des Objekts gewährleistet der mit noexcept deklarierte virtuelle Destruktor, dass während der Zerstörung keine Ausnahmen propagiert werden und die Bereinigung stets zuverlässig abgeschlossen wird [SWS_CRYPT_20401].

Dieser Leitfaden basiert auf der AUTOSAR-Adaptive-Spezifikation R25-11 und wurde durch einen KI-Kurations-Assistenten generiert.

Mitgliederkarte

Konstruktoren und Destruktor

2

Methoden

1

Operatoren

1

Klassendiagramm

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

Detailansicht

Wähle in der Gliederung einen Eintrag aus.

Konstruktoren und Destruktor

CryptoContext function 2

Copy-Constructor.

Überladungen CryptoContext 2
CryptoContext (const CryptoContext &)=delete; SWS_CRYPT_41003
CryptoContext (CryptoContext &&)=delete; SWS_CRYPT_41004

Destructor.

virtual ~CryptoContext () noexcept=default;

Methoden

GetAlgId function

The interface shall return the AlgId of the context.

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

Operatoren

operator= function 2

Copy-assign another CryptoContext to this instance.

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

Dokumentation der Methoden

function 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#8cdfc054
Content hash
8cdfc054
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

function 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#e84c8c58
Content hash
e84c8c58
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

function 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#0505bc8c
Content hash
0505bc8c
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

function 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#7667e777
Content hash
7667e777
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

function 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#e0e202f4
Content hash
e0e202f4
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

function ~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#a3a37bef
Content hash
a3a37bef
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