function DeriveKey [SWS_CRYPT_21515] Upstream: RS_CRYPTO_02102, RS_CRYPTO_02107, RS_CRYPTO_02108, RS_CRYPTO_02111, RS_CRYPTO_02115
virtual ara::core::Result< SymmetricKey::Sptr > DeriveKey (AlgId targetAlgId, AllowedUsageFlags allowedUsage) const noexcept=0;
Derive a symmetric key from the provided key material and provided context configuration, e.g., salt, context, IV, iteration count.
Die Methode DeriveKey der Klasse ara::crypto::cryp::KeyDerivationFunctionCtx leitet synchron einen neuen symmetrischen Schlüssel aus dem vorhandenen Schlüsselmaterial sowie den im Kontext hinterlegten Parametern wie Salt, Initialisierungsvektor (IV) oder Iterationszähler ab [SWS_CRYPT_21515].
Verwendung
Beim Aufruf werden der Bezeichner des gewünschten Kryptoalgorithmus über targetAlgId sowie die erlaubten Nutzungsflags über allowedUsage übergeben [SWS_CRYPT_21515]. Als Rückgabewert liefert die Funktion synchron ein ara::core::Result<SymmetricKey::Sptr>, das bei erfolgreicher Ausführung einen Smart Pointer auf das erzeugte symmetrische Schlüsselobjekt bereitstellt [SWS_CRYPT_21515].
Fehlerbehandlung
Schlägt die Schlüsselerzeugung fehl, garantiert die Funktion Rollback-Semantik und gibt einen entsprechenden Fehlercode im ara::core::Result zurück [SWS_CRYPT_21515]:
UnknownIdentifier: Wird gemeldet, falls der übergebene Wert fürtargetAlgIdnicht unterstützt wird [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kIncompatibleArguments: Tritt auf, wenn die inallowedUsagefestgelegten Nutzungsflags nicht mit dem Zielalgorithmus kompatibel sind [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kUninitializedContext: Der Kontext wurde vor der Schlüsselableitung nicht hinreichend initialisiert [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kBusyResource: Eine für die Schlüsselableitung erforderliche Ressource ist belegt [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kEmptyKeySlot: Ein für die Operation konfigurierter KeySlot ist gegenwärtig leer [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kUsageViolation: Tritt auf, wenn die Nutzungsberechtigung des QuellschlüsselskAllowKeyDerivationnicht enthält oder wenn das ZielkAllowPlaintextExportfordert, die Quelle jedoch keinkAllowDerivedPlaintextExportgestattet [SWS_CRYPT_21515].
Nebenläufigkeit und Ausführungskontext
Die Methode ist als noexcept spezifiziert, bietet Ausnahmesicherheit (exception safe) und ist thread-safe für den gleichzeitigen Aufruf ausgelegt [SWS_CRYPT_21515].
Dieser Nutzungshinweis wurde automatisch generiert und basiert ausschließlich auf den Spezifikationsdaten von AUTOSAR R25-11.
| Header-Datei | #include "ara/crypto/cryp/key_derivation_function_ctx.h" |
|---|---|
| Scope | class ara::crypto::cryp::KeyDerivationFunctionCtx |
| Exception-Sicherheit | exception safe |
| Thread-Sicherheit | thread-safe ara::crypto::CryptoErrc::k rollback_semantics |
Parameter (in)
| Parameter | Beschreibung |
|---|---|
| targetAlgId | the identifier of the target symmetric crypto algorithm |
| allowedUsage | the flags that define a list of allowed usages in which the target key can be used. |
Rückgabewert
| Typ | Beschreibung |
|---|---|
| ara::core::Result<SymmetricKey::Sptr > | result containing a shared pointer to the created symmetric key object or an error |
Fehler
| Fehlercode | Beschreibung |
|---|---|
| UnknownIdentifier | if targetAlgId has an unsupported value |
| ara::crypto::CryptoErrc::kIncompatibleArguments | rollback_semantics if the allowedUsage of the derived key is incompatible with the targetAlgId. |
| ara::crypto::CryptoErrc::kUninitializedContext | rollback_semantics if the context has not been sufficiently initialized |
| ara::crypto::CryptoErrc::kBusyResource | rollback_semantics a required resource is busy |
| ara::crypto::CryptoErrc::kEmptyKeySlot | rollback_semantics if a KeySlot was configured that is currently is empty |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics if the allowed usage of the source key does not include kAllowKey Derivation |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics if the allowedUsage of the target key includes kAllowPlaintext Export but the allowed usage of the source key does not include k AllowDerivedPlaintextExport |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_CRYPT_21515- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_CRYPT_21515@rel:R25-11#4792442a- Content hash
4792442a- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_21515
Status: valid/unmigrated
Version: rel:R25-11#9b38f620
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_21515@rel:R25-11#9b38f620
Recorded Revisions (8):
- R25-11
rel:R25-11#4792442a2026-09-30 - R19-11
rel:R19-11#d747dcdf2026-10-14 - R20-11
rel:R20-11#20ca9f5b2026-10-14 - R21-11
rel:R21-11#4e7c875e2026-10-14 - R22-11
rel:R22-11#1edafd582026-10-14 - R23-11
rel:R23-11#09e184cc2026-10-14 - R24-11
rel:R24-11#f4962bb42026-10-14 - R25-11
rel:R25-11#9b38f6202026-10-14 active
Requirement Text as-of this release:
Curation Decisions:
Reachable Artifacts & Dependents:
| Date | Actor | Transition | Reason / Rationale | Campaign |
|---|---|---|---|---|
| 2026-08-13 | tool | none → valid/unmigrated | mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record | 2026-08-13-status-backfill |
gemini-3.8-flash-medium· 2026-10-13