फ़ंक्शन 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.
सिंक्रोनस मेथड Encapsulate पास की गई सिमेट्रिक की (key) को एनकैप्सुलेट करती है और परिणाम को आउटपुट बफ़र encapsulatedKey [SWS_CRYPT_21813] में लिखती है। सफल निष्पादन पर, यह ara::core::Result<std::size_t> के माध्यम से एनकैप्सुलेटेड की का बाइट आकार लौटाती है [SWS_CRYPT_21813]।
एरर की स्थिति में, रोलबैक सिमेंटिक्स के साथ एक संबंधित एरर कोड लौटाया जाता है [SWS_CRYPT_21813]। प्रासंगिक एरर कारण हैं:
UninitializedContext: संदर्भ को सार्वजनिक की मान के साथ इनिशियलाइज़ नहीं किया गया था [SWS_CRYPT_21813]।ara::crypto::CryptoErrc::kUsageViolation: एनकैप्सुलेशन की में उपयोगिता फ़्लैगkAllowKeyWrappingअनुपलब्ध है या एनकैप्सुलेट की जाने वाली की मेंkAllowSecuredExportअनुपलब्ध है [SWS_CRYPT_21813]।ara::crypto::CryptoErrc::kIncompatibleObjectयाCryptoErrc::kInvalidInputSize: की ऑब्जेक्ट असंगत है या की का आकार संदर्भ द्वारा समर्थित नहीं है [SWS_CRYPT_21813]।CryptoErrc::kUnsupported: संदर्भ प्रदान की गई कीज़ को एनकैप्सुलेट करने का समर्थन नहीं करता है, क्योंकि यह एनकैप्सुलेशन के दौरान उन्हें स्वयं उत्पन्न करता है [SWS_CRYPT_21813]।ara::crypto::CryptoErrc::kInsufficientCapacity: बफ़रencapsulatedKeyका आकार बहुत छोटा है [SWS_CRYPT_21813]।ara::crypto::CryptoErrc::kBusyResourceयाara::crypto::CryptoErrc::kEmptyKeySlot: कोई संसाधन व्यस्त है या एक कॉन्फ़िगर किया गया KeySlot खाली है [SWS_CRYPT_21813]।
ऑपरेशन को const, noexcept के रूप में घोषित किया गया है तथा thread-safe और exception safe के रूप में निर्दिष्ट किया गया है [SWS_CRYPT_21813]।
मॉड्यूल के साथ अंतःक्रिया में, यह फंक्शन वैकल्पिक ओवरलोड [SWS_CRYPT_50011] से भिन्न है, जो किसी मौजूदा की को स्वीकार नहीं करता है, बल्कि सिमेट्रिक की को गतिशील रूप से पुनर्गठित करता है और एनकैप्सुलेशन परिणाम के साथ लौटाता है [SWS_CRYPT_50011]।
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#ccdc0161- Content hash
ccdc0161- 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 · जर्मन मूल