función Encapsulate [SWS_CRYPT_21813] Upstream: RS_CRYPTO_02102, RS_CRYPTO_02108, RS_CRYPTO_02115
virtual ara::core::Result< std::size_t > Encapsulate (Symmetric Key::Sptr key, ReadWriteMemRegion encapsulatedKey) const noexcept=0;
Encapsulate the provided symmetric key.
El método síncrono Encapsulate encapsula una clave simétrica transferida (key) y escribe el resultado en el búfer de salida encapsulatedKey [SWS_CRYPT_21813]. En caso de ejecución correcta, devuelve a través de ara::core::Result<std::size_t> el tamaño en bytes de la clave encapsulada [SWS_CRYPT_21813].
En caso de error se devuelve el código de error correspondiente con semántica de reversión [SWS_CRYPT_21813]. Las causas de error relevantes son:
UninitializedContext: El contexto no se inicializó con un valor de clave pública [SWS_CRYPT_21813].ara::crypto::CryptoErrc::kUsageViolation: A la clave de encapsulamiento le falta el flag de usokAllowKeyWrappingo a la clave que se va a encapsular le faltakAllowSecuredExport[SWS_CRYPT_21813].ara::crypto::CryptoErrc::kIncompatibleObjectoCryptoErrc::kInvalidInputSize: El objeto de clave es incompatible o el tamaño de la clave no es admitido por el contexto [SWS_CRYPT_21813].CryptoErrc::kUnsupported: El contexto no admite el encapsulamiento de claves proporcionadas porque las genera él mismo durante el encapsulamiento [SWS_CRYPT_21813].ara::crypto::CryptoErrc::kInsufficientCapacity: El búferencapsulatedKeyestá dimensionado demasiado pequeño [SWS_CRYPT_21813].ara::crypto::CryptoErrc::kBusyResourceoara::crypto::CryptoErrc::kEmptyKeySlot: Un recurso está ocupado o un KeySlot configurado está vacío [SWS_CRYPT_21813].
La operación está declarada como const, noexcept y especificada como thread-safe y exception safe [SWS_CRYPT_21813].
En interacción con el módulo, esta función se diferencia de la sobrecarga alternativa [SWS_CRYPT_50011], la cual no recibe una clave existente, sino que genera dinámicamente de nuevo la clave simétrica y la devuelve junto con el resultado de la encapsulación [SWS_CRYPT_50011].
Nota de uso generada automáticamente sobre la base de AUTOSAR R25-11.
| Header-Datei | #include "ara/crypto/cryp/key_encapsulator_public_ctx.h" |
|---|---|
| Scope | class ara::crypto::cryp::KeyEncapsulatorPublicCtx |
| Exception-Sicherheit | exception safe |
| Thread-Sicherheit | thread-safe CryptoErrc::k rollback_semantics |
Parameter (in)
| Parameter | Beschreibung |
|---|---|
| key | the symmetric key to be encapsulated |
Parameter (out)
| Parameter | Beschreibung |
|---|---|
| encapsulatedKey | an output buffer the encapsulated key is written to |
Rückgabewert
| Typ | Beschreibung |
|---|---|
| ara::core::Result<std::size_t > | a result containing the size of the encapsulated key or an error |
Fehler
| Fehlercode | Beschreibung |
|---|---|
| UninitializedContext | if the context was not initialized by a public key value |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics if the allowed usage of the encapsulation key does not include k AllowKeyWrapping or if the allowed usage of the encapsulated key does not include kAllowSecuredExport |
| ara::crypto::CryptoErrc::kIncompatibleObject | rollback_semantics if the provided encapsulated key object is incompatible with this context |
| CryptoErrc::kInvalidInputSize | rollback_semantics if this context does not support the size of the encapsulated key |
| CryptoErrc::kUnsupported | rollback_semantics if this context does not support setting the encapsulated key, because it generates the key during encapsulation |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics if the output buffer is too small |
| 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 key does not include kAllowKeyWrapping |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_CRYPT_21813- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_CRYPT_21813@rel:R25-11#a0bd9102- Content hash
a0bd9102- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_21813
Status: valid/unmigrated
Version: rel:R25-11#5f08acc8
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_21813@rel:R25-11#5f08acc8
Recorded Revisions (8):
- R25-11
rel:R25-11#b3c8ad102026-09-30 - R19-11
rel:R19-11#5df6f2a12026-10-14 - R20-11
rel:R20-11#bc53d66f2026-10-14 - R21-11
rel:R21-11#a093fad52026-10-14 - R22-11
rel:R22-11#9a52ca012026-10-14 - R23-11
rel:R23-11#dadd77c62026-10-14 - R24-11
rel:R24-11#2cf84d842026-10-14 - R25-11
rel:R25-11#5f08acc82026-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