función 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.
El método DeriveKey de la clase ara::crypto::cryp::KeyDerivationFunctionCtx deriva de forma síncrona una nueva clave simétrica a partir del material de clave existente y de los parámetros almacenados en el contexto, como el vector de inicialización (IV), el salt o el contador de iteraciones [SWS_CRYPT_21515].
usar
En la llamada se pasan el identificador del algoritmo criptográfico deseado a través de targetAlgId y los indicadores de uso permitidos a través de allowedUsage [SWS_CRYPT_21515]. Como valor de retorno, la función proporciona de forma síncrona un ara::core::Result<SymmetricKey::Sptr> que, en caso de ejecución correcta, suministra un puntero inteligente al objeto de clave simétrica generado [SWS_CRYPT_21515].
Manejo de errores
Si la generación de claves falla, la función garantiza una semántica de reversión y devuelve el código de error correspondiente en ara::core::Result [SWS_CRYPT_21515]:
UnknownIdentifier: Se notifica si el valor pasado paratargetAlgIdno es compatible [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kIncompatibleArguments: Se produce cuando los indicadores de uso especificados enallowedUsageno son compatibles con el algoritmo de destino [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kUninitializedContext: El contexto no se inicializó suficientemente antes de la derivación de claves [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kBusyResource: Un recurso necesario para la derivación de claves está ocupado [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kEmptyKeySlot: Un KeySlot configurado para la operación está actualmente vacío [SWS_CRYPT_21515].ara::crypto::CryptoErrc::kUsageViolation: Se produce si la autorización de uso de la clave de origen no contienekAllowKeyDerivationo si el destino requierekAllowPlaintextExport, pero el origen no permitekAllowDerivedPlaintextExport[SWS_CRYPT_21515].
Concurrencia y contexto de ejecución
El método está especificado como noexcept, ofrece seguridad ante excepciones (exception safe) y está diseñado como seguro para subprocesos (thread-safe) para llamadas simultáneas [SWS_CRYPT_21515].
Esta nota de uso se generó automáticamente y se basa exclusivamente en los datos de especificación de 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#f286740e- Content hash
f286740e- 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 en alemán