fonction 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.
La méthode DeriveKey de la classe ara::crypto::cryp::KeyDerivationFunctionCtx dérive de manière synchrone une nouvelle clé symétrique à partir du matériel de clé existant ainsi que des paramètres stockés dans le contexte tels que le sel, le vecteur d'initialisation (IV) ou le compteur d'itérations [SWS_CRYPT_21515].
Utilisation
Lors de l'appel, l'identifiant de l'algorithme cryptographique souhaité est transmis via targetAlgId et les drapeaux d'utilisation autorisés via allowedUsage [SWS_CRYPT_21515]. Comme valeur de retour, la fonction fournit de manière synchrone un ara::core::Result<SymmetricKey::Sptr> qui met à disposition, en cas d'exécution réussie, un pointeur intelligent vers l'objet de clé symétrique généré [SWS_CRYPT_21515].
Gestion des erreurs
Si la génération de clé échoue, la fonction garantit une sémantique de rollback et retourne un code d'erreur correspondant dans le ara::core::Result [SWS_CRYPT_21515] :
UnknownIdentifier: Signalé si la valeur transmise pourtargetAlgIdn'est pas prise en charge [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kIncompatibleArguments: Se produit lorsque les drapeaux d'utilisation définis dansallowedUsagene sont pas compatibles avec l'algorithme cible [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kUninitializedContext: Le contexte n'a pas été suffisamment initialisé avant la dérivation de clé [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kBusyResource: Une ressource nécessaire à la dérivation de clé est occupée [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kEmptyKeySlot: Un KeySlot configuré pour l'opération est actuellement vide [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kUsageViolation: Se produit lorsque l'autorisation d'utilisation de la clé source ne contient paskAllowKeyDerivationou lorsque la cible exigekAllowPlaintextExportalors que la source n'autorise aucunkAllowDerivedPlaintextExport[SWS_CRYPT_21515].
Concurrence et contexte d'exécution
La méthode est spécifiée comme noexcept, offre une sécurité vis-à-vis des exceptions (exception safe) et est conçue pour être thread-safe en cas d'appels simultanés [SWS_CRYPT_21515].
Cette note d’utilisation a été générée automatiquement et se base exclusivement sur les données de spécification d’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#0717463d- Content hash
0717463d- 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-low· 2026-10-13 · Original allemand