DEENESPTFRRUARHIKOZHNL

क्लास ara::crypto::cryp::KeyEncapsulatorPublicCtx

[SWS_CRYPT_21800] Upstream: RS_CRYPTO_02104, RS_CRYPTO_02209

class KeyEncapsulatorPublicCtx :                public CryptoContext {...};

Asymmetric Key Encapsulation Mechanism (KEM) Public key Context interface.

Header-Datei#include "ara/crypto/cryp/key_encapsulator_public_ctx.h"
Forwarding-Header#include "ara/crypto/crypto_fwd.h"
Scopenamespace ara::crypto::cryp
Basisklasse(n)CryptoContext

उपयोगकर्ता गाइडएआई जनित

सार्वजनिक कुंजियों के माध्यम से सममित कुंजियों को असममित रूप से एनकैप्सुलेट करता है या उन्हें एनकैप्सुलेशन प्रक्रिया में उत्पन्न करता है।
एआई-जनित असत्यापित मॉडल: gemini-3.8-flash-medium · प्रयास: medium · तापमान: नियंत्रित नहीं किया जा सकता · प्रॉम्प्ट: f00bc8643d8f उद्गम खुले प्रश्न (2)
जर्मन मार्गदर्शिका से अनूदितgemini-3.8-flash-low · 2026-10-13 · जर्मन मूल

सार्वजनिक कुंजियों के माध्यम से सममित कुंजियों को असममित रूप से एनकैप्सुलेट करता है या उन्हें एनकैप्सुलेशन प्रक्रिया में उत्पन्न करता है।

इंटरफ़ेस ara::crypto::cryp::KeyEncapsulatorPublicCtx सुरक्षित विनिमय के लिए सममित कुंजियों को पैक करने या एनकैप्सुलेशन के दौरान सीधे नई कुंजियां उत्पन्न करने के लिए असममित कुंजी एनकैप्सुलेशन तंत्र (KEM) को सक्षम बनाता है ([SWS_CRYPT_50011])। निष्पादन से पहले, संदर्भ को SetKey के माध्यम से सार्वजनिक कुंजी या स्लॉट के साथ आरंभ किया जाना चाहिए और आवश्यक आउटपुट बफ़र आकार निर्धारित किया जाना चाहिए ([SWS_CRYPT_21815])। आवश्यक सीमांत शर्तों में आवश्यक कुंजी उपयोग फ़्लैग जैसे kAllowKeyWrapping और सभी ऑपरेशनों की पूर्ण थ्रेड-सुरक्षा शामिल है।

संदर्भ

इंटरफ़ेस ara::crypto::cryp::KeyEncapsulatorPublicCtx सार्वजनिक कुंजी का उपयोग करके Key Encapsulation Mechanisms (KEM) के लिए असममित संदर्भ को परिभाषित करता है। AUTOSAR Adaptive के क्रिप्टोग्राफ़ी आर्किटेक्चर के भीतर, क्लास सुरक्षित कुंजी विनिमय और कुंजी परिवहन के लिए कार्य करता है। यह या तो किसी मौजूदा सममित कुंजी को एनकैप्सुलेट करने के लिए ([SWS_CRYPT_21813]) या एनकैप्सुलेशन के दौरान एक नई सममित कुंजी उत्पन्न करने और प्रदान करने के लिए ([SWS_CRYPT_50011]) एक सार्वजनिक असममित कुंजी स्वीकार करता है। कुंजी आधार को सीधे कुंजी ऑब्जेक्ट PublicKey ([SWS_CRYPT_21815]) के रूप में या एक स्थायी स्लॉट KeySlot ([SWS_CRYPT_50012]) के माध्यम से जोड़ा जा सकता है।

diag_kem_kontext Anwendung Anwendung KeyEncapsulatorPublicCtx KeyEncapsulatorPublicCtx Anwendung->KeyEncapsulatorPublicCtx SymmetricKey SymmetricKey KeyEncapsulatorPublicCtx->SymmetricKey PublicKey PublicKey PublicKey->KeyEncapsulatorPublicCtx KeySlot KeySlot KeySlot->KeyEncapsulatorPublicCtx

संदर्भ आरेख: एप्लिकेशन, कुंजी स्रोतों और लक्ष्य कुंजियों के बीच KeyEncapsulatorPublicCtx का एकीकरण। स्रोत: [SWS_CRYPT_21813], [SWS_CRYPT_21815], [SWS_CRYPT_50011], [SWS_CRYPT_50012]

जीवनचक्र

KeyEncapsulatorPublicCtx के इंस्टेंस टाइप किए गए स्मार्ट पॉइंटर KeyEncapsulatorPublicCtx::Sptr के माध्यम से प्रबंधित किए जाते हैं, जिसे std::shared_ptr<KeyEncapsulatorPublicCtx> के रूप में परिभाषित किया गया है ([SWS_CRYPT_21801])। वास्तविक ऑब्जेक्ट निर्माण प्लेटफ़ॉर्म के अधीनस्थ प्रदाता फ़ैक्टरी के माध्यम से होने की संभावना है, क्योंकि क्लास एक शुद्ध वर्चुअल इंटरफ़ेस का प्रतिनिधित्व करता है। प्रश्न Q-3551020e7b9c0f0c (खुला)

निर्माण के बाद, संदर्भ अपूर्ण आरंभीकरण की स्थिति में होता है। जब तक संदर्भ को कोई सार्वजनिक कुंजी नहीं सौंपी जाती है, बफ़र आकार गणना ([SWS_CRYPT_50013]) और साथ ही एनकैप्सुलेशन ऑपरेशनों ([SWS_CRYPT_21813], [SWS_CRYPT_50011]) के कॉल त्रुटि CryptoErrc::kUninitializedContext के साथ विफल हो जाते हैं। परिचालन तत्परता SetKey के माध्यम से PublicKey::Sptr ([SWS_CRYPT_21815]) या KeySlot::Sptr ([SWS_CRYPT_50012]) के साथ कॉन्फ़िगरेशन द्वारा स्थापित की जाती है। KeySlot असाइन करते समय, उसमें निहित सार्वजनिक कुंजी को केवल एनकैप्सुलेशन के वास्तविक निष्पादन समय पर गतिशील रूप से पढ़े जाने की संभावना है। प्रश्न Q-ea760070f05941d2 (खुला) संदर्भ के सभी मेथड्स विनिर्देश के अनुसार थ्रेड-सुरक्षित हैं और अपवाद-सुरक्षा की गारंटी देते हैं ([SWS_CRYPT_21813], [SWS_CRYPT_50011], [SWS_CRYPT_50013], [SWS_CRYPT_21815], [SWS_CRYPT_50012])।

उपयोग पथ

संदर्भ का व्यावहारिक उपयोग कुंजी बाइंडिंग, बफ़र आयाम और एनकैप्सुलेशन निष्पादन के एक परिभाषित क्रम का पालन करता है:

  • कुंजी बाइंडिंग: एप्लिकेशन संदर्भ को SetKey के माध्यम से या तो लोड किए गए PublicKey ([SWS_CRYPT_21815]) या KeySlot ([SWS_CRYPT_50012]) के साथ आरंभ करता है।
  • बफ़र का आकार निर्धारित करना: आउटपुट बफ़र प्रदान करने से पहले, एप्लिकेशन इच्छित सममित लक्ष्य एल्गोरिदम के लिए बाइट्स में अधिकतम आवश्यक आउटपुट आकार GetRequiredOutputBufferSize(algId) ([SWS_CRYPT_50013]) के माध्यम से निर्धारित करता है और संबंधित ReadWriteMemRegion आरक्षित करता है।
  • एनकैप्सुलेशन का निष्पादन: उपयोग के उद्देश्य के आधार पर, एप्लिकेशन दो एनकैप्सुलेशन वेरिएंट में से एक का चयन करता है:
    • किसी मौजूदा कुंजी का प्रावधान: Encapsulate(key, encapsulatedKey) पास किए गए SymmetricKey को एनकैप्सुलेट करता है और लिखे गए बाइट्स की संख्या लौटाता है ([SWS_CRYPT_21813])।
    • स्वायत्त जेनरेशन: Encapsulate(algId, allowedUsage, encapsulatedKey) आवश्यक उपयोग फ़्लैग के अनुसार एक नई सममित कुंजी उत्पन्न करता है और बाइट आकार और नए SymmetricKey::Sptr की एक जोड़ी लौटाता है ([SWS_CRYPT_50011])।
कुंजी कैप्सुलेशन का अनुक्रमएप्लिकेशनKeyEncapsulatorPublicCtxUse Case: कैप्सुलेशन कुंजी का कॉन्फ़िगरेशनSetKey(key / keySlot)Result<void>Use Case: बफ़र आकार जाँचGetRequiredOutputBufferSize(algId)Result<std::size_t>Use Case: Kapselungaltमौजूदा कुंजीEncapsulate(key, memRegion)Result<std::size_t>नई कुंजी जनरेट की जाती हैEncapsulate(algId, usage, memRegion)Result<std::pair<std::size_t, SymmetricKey::Sptr>>

अनुक्रम आरेख: कुंजी असाइनमेंट से लेकर बफ़र गणना और कुंजी एनकैप्सुलेशन तक का विशिष्ट कॉल अनुक्रम। स्रोत: [SWS_CRYPT_21813], [SWS_CRYPT_21815], [SWS_CRYPT_50011], [SWS_CRYPT_50013]

त्रुटि परिदृश्य

KeyEncapsulatorPublicCtx के मेथड्स ara::crypto::CryptoErrc के मानों के साथ ara::core::Result के माध्यम से त्रुटियों की रिपोर्ट करते हैं और त्रुटि की स्थिति में रोलबैक सिमेंटिक्स सुनिश्चित करते हैं। मुख्य त्रुटि स्थितियों में शामिल हैं:

  • CryptoErrc::kUninitializedContext: तब होता है जब SetKey का उपयोग करके पूर्व सफल कॉन्फ़िगरेशन के बिना GetRequiredOutputBufferSize ([SWS_CRYPT_50013]) या Encapsulate ([SWS_CRYPT_21813], [SWS_CRYPT_50011]) को कॉल किया जाता है।
  • CryptoErrc::kUsageViolation: अमान्य कुंजी उपयोगों को संकेत करता है। यह तब होता है जब एनकैप्सुलेशन कुंजी में kAllowKeyWrapping फ़्लैग अनुपलब्ध होता है ([SWS_CRYPT_21815], [SWS_CRYPT_21813], [SWS_CRYPT_50011]) या जब एनकैप्सुलेट की जाने वाली सममित कुंजी kAllowSecuredExport के माध्यम से सुरक्षित निर्यात के लिए सक्षम नहीं होती है ([SWS_CRYPT_21813])।
  • CryptoErrc::kIncompatibleObject: यह इंगित करता है कि पास की गई कुंजी (key) या स्लॉट संदर्भ के एल्गोरिदम के साथ संगत नहीं है ([SWS_CRYPT_21815], [SWS_CRYPT_50012], [SWS_CRYPT_21813])।
  • CryptoErrc::kInsufficientCapacity और CryptoErrc::kInvalidInputSize: तब ट्रिगर होते हैं, यदि पास किए गए ReadWriteMemRegion में आवश्यक बफ़र क्षमता नहीं है या कुंजी का इनपुट आकार समर्थित नहीं है ([SWS_CRYPT_21813], [SWS_CRYPT_50011])।
  • CryptoErrc::kEmptyKeySlot और CryptoErrc::kBusyResource: तब उत्पन्न होते हैं, जब SetKey के माध्यम से बाउंड किया गया KeySlot एनकैप्सुलेशन के निष्पादन समय पर रिक्त हो या इसमें शामिल हार्डवेयर संसाधन व्यस्त हो ([SWS_CRYPT_21813], [SWS_CRYPT_50011])।
  • CryptoErrc::kUnsupported: तब लौटाया जाता है, जब संदर्भ कार्यान्वयन या तो स्लॉट के बजाय केवल कुंजी ऑब्जेक्ट्स का समर्थन करता है ([SWS_CRYPT_50012]) या इसके विपरीत ([SWS_CRYPT_21815]), अथवा यदि संदर्भ में बाहरी कुंजियों को सेट करना या स्वायत्त कुंजी निर्माण समर्थित नहीं है ([SWS_CRYPT_21813], [SWS_CRYPT_50011])।

यह मार्गदर्शिका विशेष रूप से AUTOSAR Adaptive Platform रिलीज़ R25-11 के विनिर्देशों पर आधारित है।

सदस्य मानचित्र

टाइप उपनाम

1

क्लास आरेख

Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.

G nara__crypto__cryp__KeyEncapsulatorPublicCtx699 KeyEncapsulatorPublicCtx + Encapsulate() + GetRequiredOutputBufferSize() + SetKey() nara__crypto__cryp__CryptoContext85 CryptoContext nara__crypto__cryp__KeyEncapsulatorPublicCtx699->nara__crypto__cryp__CryptoContext85

विवरण दृश्य

रूपरेखा में कोई प्रविष्टि चुनें।

मेथड

Encapsulate फ़ंक्शन 2

Encapsulate the provided symmetric key.

ओवरलोड Encapsulate 2
virtual ara::core::Result< std::size_t > Encapsulate (Symmetric Key::Sptr key, ReadWriteMemRegion encapsulatedKey) const noexcept=0; SWS_CRYPT_21813
virtual ara::core::Result< std::pair< std::size_t, SymmetricKey::Sptr > > Encapsulate (AlgId algId, AllowedUsageFlags allowedUsage, Read WriteMemRegion encapsulatedKey) const noexcept=0; SWS_CRYPT_50011
GetRequiredOutputBufferSize फ़ंक्शन

Calculate the maximum required size of the output buffer depending on the input size in the current state of the context.

virtual ara::core::Result< std::size_t > GetRequiredOutputBufferSize (AlgId algId) const noexcept;
SetKey फ़ंक्शन 2

Configure the context to use the provided key as encapsulation key.

ओवरलोड SetKey 2
virtual ara::core::Result< void > SetKey (PublicKey::Sptr key) noexcept=0; SWS_CRYPT_21815
virtual ara::core::Result< void > SetKey (KeySlot::Sptr keySlot) noexcept=0; SWS_CRYPT_50012

टाइप उपनाम

Sptr टाइप उपनाम

Smart pointer of the interface.

मेथड का प्रलेखन

फ़ंक्शन 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.

एआई-जनित असत्यापित मॉडल: gemini-3.8-flash-medium · प्रयास: medium · तापमान: नियंत्रित नहीं किया जा सकता · प्रॉम्प्ट: 998c7d355307 उद्गम
जर्मन मार्गदर्शिका से अनूदितgemini-3.8-flash-low · 2026-10-13 · जर्मन मूल

सिंक्रोनस मेथड 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"
Scopeclass ara::crypto::cryp::KeyEncapsulatorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe CryptoErrc::k rollback_semantics

Parameter (in)

ParameterBeschreibung
keythe symmetric key to be encapsulated

Parameter (out)

ParameterBeschreibung
encapsulatedKeyan output buffer the encapsulated key is written to

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the size of the encapsulated key or an error

Fehler

FehlercodeBeschreibung
UninitializedContextif the context was not initialized by a public key value
ara::crypto::CryptoErrc::kUsageViolationrollback_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::kIncompatibleObjectrollback_semantics if the provided encapsulated key object is incompatible with this context
CryptoErrc::kInvalidInputSizerollback_semantics if this context does not support the size of the encapsulated key
CryptoErrc::kUnsupportedrollback_semantics if this context does not support setting the encapsulated key, because it generates the key during encapsulation
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_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
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#b3c8ad102026-09-30
  • R19-11rel:R19-11#5df6f2a12026-10-14
  • R20-11rel:R20-11#bc53d66f2026-10-14
  • R21-11rel:R21-11#a093fad52026-10-14
  • R22-11rel:R22-11#9a52ca012026-10-14
  • R23-11rel:R23-11#dadd77c62026-10-14
  • R24-11rel:R24-11#2cf84d842026-10-14
  • R25-11rel:R25-11#5f08acc82026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

फ़ंक्शन Encapsulate [SWS_CRYPT_50011] Upstream: RS_CRYPTO_02102, RS_CRYPTO_02108, RS_CRYPTO_02115

virtual ara::core::Result< std::pair< std::size_t, SymmetricKey::Sptr > > Encapsulate (AlgId algId, AllowedUsageFlags allowedUsage, Read WriteMemRegion encapsulatedKey) const noexcept=0;

Generate new a symmetric key and encapsulate it. Optionally store the generated key.

एआई-जनित असत्यापित मॉडल: gemini-3.8-flash-medium · प्रयास: medium · तापमान: नियंत्रित नहीं किया जा सकता · प्रॉम्प्ट: 68e8fc3273e7 उद्गम
जर्मन मार्गदर्शिका से अनूदितgemini-3.8-flash-low · 2026-10-13 · जर्मन मूल

उपयोग और सिमेंटिक्स

तुल्यकालिक विधि Encapsulate आंतरिक रूप से एक नई सममित कुंजी उत्पन्न करती है और संदर्भ [SWS_CRYPT_50011] का उपयोग करके इसे संपुटित करती है। इनपुट पैरामीटर के रूप में उत्पन्न कुंजी के लिए लक्षित एल्गोरिदम algId तथा अनुमत उपयोग फ़्लैग allowedUsage निर्दिष्ट किए जाते हैं [SWS_CRYPT_50011]। कुंजी का सिफ़रटेक्स्ट आउटपुट बफ़र encapsulatedKey में लिखा जाता है [SWS_CRYPT_50011]। वापसी मान सफलता पर संपुटित कुंजी के वास्तविक बाइट आकार और एक ara::core::Result के भीतर उत्पन्न कुंजी ऑब्जेक्ट (std::pair<std::size_t, SymmetricKey::Sptr>) के लिए एक स्मार्ट पॉइंटर की जोड़ी को संपुटित करता है [SWS_CRYPT_50011]।

त्रुटि प्रबंधन और सुरक्षा

त्रुटि की स्थिति में, वापसी मान मुख्य रूप से रोलबैक सिमेंटिक्स रखते हैं [SWS_CRYPT_50011]। संभावित त्रुटि कारणों में शामिल हैं:

  • UninitializedContext: संदर्भ को पहले किसी सार्वजनिक कुंजी (public key) के साथ आरंभ नहीं किया गया था [SWS_CRYPT_50011]।
  • CryptoErrc::kUsageViolation: संपुटन कुंजी में फ़्लैग kAllowKeyWrapping का अभाव है या लक्षित कुंजी में kAllowSecuredExport का अभाव है [SWS_CRYPT_50011]।
  • CryptoErrc::kInsufficientCapacity: आउटपुट बफ़र encapsulatedKey पर्याप्त क्षमता प्रदान नहीं करता है [SWS_CRYPT_50011]।
  • CryptoErrc::kUnknownIdentifier या CryptoErrc::kUnsupported: algId अज्ञात है या संपुटन के दौरान जनरेशन समर्थित नहीं है [SWS_CRYPT_50011]।
  • CryptoErrc::kEmptyKeySlot या CryptoErrc::kBusyResource: एक कॉन्फ़िगर किया गया KeySlot रिक्त है या एक आवश्यक संसाधन व्यस्त है [SWS_CRYPT_50011]।

समवर्तीता और परस्पर क्रिया

ऑपरेशन को const, noexcept, thread-safe तथा exception-safe के रूप में निर्दिष्ट किया गया है [SWS_CRYPT_50011]। ओवरलोड [SWS_CRYPT_21813] की तुलना में, जिसे एक मौजूदा कुंजी पास की जाती है और जो केवल उसके आकार को लौटाता है, यह विधि एक ही चरण में कुंजी जनरेशन और संपुटन निष्पादित करती है [SWS_CRYPT_50011]।

यह पाठ विनिर्देश के आधार पर एक AI द्वारा तैयार किया गया था।

Header-Datei#include "ara/crypto/cryp/key_encapsulator_public_ctx.h"
Scopeclass ara::crypto::cryp::KeyEncapsulatorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe CryptoErrc::k rollback_semantics

Parameter (in)

ParameterBeschreibung
algIdthe identifier of the target symmetric crypto algorithm
allowedUsagethe flags that define a list of allowed transformations’ types in which the target key can be used

Parameter (out)

ParameterBeschreibung
encapsulatedKeyan output buffer the encapsulated key is written to

Rückgabewert

TypBeschreibung
ara::core::Result<std::pair< std::size_t, SymmetricKey::Sptr > >a result containing a pair of the size of the encapsulated key and the generated symmetric key or an error

Fehler

FehlercodeBeschreibung
UninitializedContextif the context was not initialized by a public key value
ara::crypto::CryptoErrc::kUsageViolationrollback_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
CryptoErrc::kInvalidInputSizerollback_semantics if this context does not support the size of the encapsulated key
CryptoErrc::kUnsupportedrollback_semantics if this context does not support generating the encapsulated key during encapsulation
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics if algId has an unsupported value
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics if a KeySlot was configured via SetKey that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_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_50011
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50011@rel:R25-11#14f24ea7
Content hash
14f24ea7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50011
Status: valid/unmigrated Version: rel:R25-11#7f7fdb0c Versionshistorie & Revisions (1 transition)
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_50011@rel:R25-11#7f7fdb0c
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

फ़ंक्शन GetRequiredOutputBufferSize [SWS_CRYPT_50013] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > GetRequiredOutputBufferSize (AlgId algId) const noexcept;

Calculate the maximum required size of the output buffer depending on the input size in the current state of the context.

Header-Datei#include "ara/crypto/cryp/key_encapsulator_public_ctx.h"
Scopeclass ara::crypto::cryp::KeyEncapsulatorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
algIdthe algId of the key to encapsulate

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the required capacity of the output buffer in bytes or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics if the context was not initialized by deploying a key

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_50013
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50013@rel:R25-11#ae68fe17
Content hash
ae68fe17
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50013
Status: valid/unmigrated Version: rel:R25-11#8834a17a Versionshistorie & Revisions (1 transition)
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_50013@rel:R25-11#8834a17a
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

फ़ंक्शन SetKey [SWS_CRYPT_21815] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

virtual ara::core::Result< void > SetKey (PublicKey::Sptr key) noexcept=0;

Configure the context to use the provided key as encapsulation key.

एआई-जनित असत्यापित मॉडल: gemini-3.8-flash-medium · प्रयास: medium · तापमान: नियंत्रित नहीं किया जा सकता · प्रॉम्प्ट: 4803853a1afa उद्गम
जर्मन मार्गदर्शिका से अनूदितgemini-3.8-flash-low · 2026-10-13 · जर्मन मूल

उपयोग

विधि SetKey ara::crypto::cryp::KeyEncapsulatorPublicCtx के इंस्टेंस को इस तरह कॉन्फ़िगर करती है कि पास किए गए कुंजी ऑब्जेक्ट का उपयोग एनकैप्सुलेशन कुंजी के रूप में किया जाता है [SWS_CRYPT_21815]। प्रकार PublicKey::Sptr का key पैरामीटर के रूप में कार्य करता है [SWS_CRYPT_21815]। कॉल सिंक्रोनस रूप से होता है और रिटर्न मान के रूप में एक ara::core::Result<void> लौटाता है, जो सफलता की स्थिति में खाली होता है या एक त्रुटि कोड वहन करता है [SWS_CRYPT_21815]।

त्रुटि प्रबंधन

त्रुटि की स्थिति में, रिपोर्ट किए गए सभी त्रुटि कोड में रोलबैक सिमेंटिक्स होते हैं [SWS_CRYPT_21815]:

  • ara::crypto::CryptoErrc::kIncompatibleObject: प्रदान किया गया कुंजी ऑब्जेक्ट संदर्भ के साथ असंगत है [SWS_CRYPT_21815]।
  • ara::crypto::CryptoErrc::kUsageViolation: कुंजी के अनुमत उपयोग में फ़्लैग kAllowKeyWrapping शामिल नहीं है [SWS_CRYPT_21815]।
  • ara::crypto::CryptoErrc::kUnsupported: संदर्भ केवल KeySlot के माध्यम से कुंजी सेट करने का समर्थन करता है [SWS_CRYPT_21815]।

समवर्तीता और प्रतिबंध

फ़ंक्शन को noexcept गारंटी के साथ thread-safe और exception safe के रूप में निर्दिष्ट किया गया है [SWS_CRYPT_21815]।

इंटरैक्शन

कुंजी के कॉन्फ़िगरेशन द्वारा, संदर्भ को कुंजी एनकैप्सुलेशन के लिए तैयार किया जाता है, जो विधि Encapsulate के माध्यम से किया जाता है [SWS_CRYPT_50011]। यदि संदर्भ प्रत्यक्ष कुंजी असाइनमेंट का समर्थन नहीं करता है या कुंजी को किसी मेमोरी क्षेत्र से प्राप्त किया जाना है, तो विकल्प के रूप में KeySlot::Sptr के साथ SetKey का ओवरलोड उपलब्ध है [SWS_CRYPT_50012]।

यह उपयोग संबंधी निर्देश एक AI द्वारा तैयार किया गया था और रिलीज़ R25-11 के विनिर्देशों पर आधारित है।

इम्प्लीमेंटर गाइड जल्द आएगी (जटिलता I2)

Header-Datei#include "ara/crypto/cryp/key_encapsulator_public_ctx.h"
Scopeclass ara::crypto::cryp::KeyEncapsulatorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
keythe key encapsulation key

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if the provided key object is incompatible with this context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the key does not include kAllowKeyWrapping
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context only supports setting a KeySlot

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_21815
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_21815@rel:R25-11#79bc46f8
Content hash
79bc46f8
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_21815
Status: valid/unmigrated Version: rel:R25-11#135664c1 Versionshistorie & Revisions (1 transition, 7 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_21815@rel:R25-11#135664c1
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#97afebd22026-09-30
  • R20-11rel:R20-11#3e034d832026-10-14
  • R21-11rel:R21-11#14e868c82026-10-14
  • R22-11rel:R22-11#c056496f2026-10-14
  • R23-11rel:R23-11#4a9295802026-10-14
  • R24-11rel:R24-11#6638cae22026-10-14
  • R25-11rel:R25-11#135664c12026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

फ़ंक्शन SetKey [SWS_CRYPT_50012] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

virtual ara::core::Result< void > SetKey (KeySlot::Sptr keySlot) noexcept=0;

Configure the context to use the key stored in the provided KeySlot at the time the key encapsulation is performed.

एआई-जनित असत्यापित मॉडल: gemini-3.8-flash-medium · प्रयास: medium · तापमान: नियंत्रित नहीं किया जा सकता · प्रॉम्प्ट: c951ff682a31 उद्गम खुले प्रश्न (1)
जर्मन मार्गदर्शिका से अनूदितgemini-3.8-flash-low · 2026-10-13 · जर्मन मूल

क्लास ara::crypto::cryp::KeyEncapsulatorPublicCtx की विधि SetKey संदर्भ को इस प्रकार कॉन्फ़िगर करती है कि पास किए गए कुंजी स्लॉट (KeySlot) में संग्रहीत सार्वजनिक कुंजी का उपयोग कुंजी एनकैप्सुलेशन के समय किया जाता है [SWS_CRYPT_50012]।

उपयोग

कॉल सिंक्रोनस रूप से की जाती है और इसे noexcept तथा exception safe के रूप में निर्दिष्ट किया गया है [SWS_CRYPT_50012]। KeySlot::Sptr प्रकार का keySlot पैरामीटर के रूप में कार्य करता है, जिसमें एक सार्वजनिक कुंजी होनी चाहिए [SWS_CRYPT_50012]। रिटर्न मान एक ara::core::Result<void> है, जिसमें सफलता की स्थिति में कोई मान नहीं होता है [SWS_CRYPT_50012]।

त्रुटि प्रबंधन

त्रुटि की स्थिति में, रोलबैक सिमेंटिक्स के साथ एक त्रुटि कोड लौटाया जाता है [SWS_CRYPT_50012]:

  • ara::crypto::CryptoErrc::kIncompatibleObject: पास किया गया keySlot इस संदर्भ के साथ असंगत है [SWS_CRYPT_50012]।
  • ara::crypto::CryptoErrc::kUnsupported: संदर्भ विशेष रूप से PublicKey ऑब्जेक्ट सेट करने का समर्थन करता है [SWS_CRYPT_50012]।

समवर्तीता और परस्पर क्रिया

फ़ंक्शन को thread-safe के रूप में परिभाषित किया गया है [SWS_CRYPT_50012]। कुंजी स्लॉट के माध्यम से असाइनमेंट के अलावा, PublicKey::Sptr [SWS_CRYPT_21815] को सीधे पास करने के लिए एक वैकल्पिक ओवरलोड मौजूद है। कॉन्फ़िगर की गई कुंजी का उपयोग तब किया जाता है जब Encapsulate [SWS_CRYPT_50011] के माध्यम से कुंजी एनकैप्सुलेशन किया जाता है। निष्पादन क्रम के संबंध में, संदर्भ के आरंभ होने के लिए संभवतः Encapsulate को कॉल करने से पहले SetKey को निष्पादित किया जाना चाहिए। प्रश्न Q-769923d4fb9a3d1e (खुला)

यह उपयोग नोट AUTOSAR Adaptive R25-11 के विनिर्देश के आधार पर स्वचालित रूप से जनरेट किया गया था।

इम्प्लीमेंटर गाइड जल्द आएगी (जटिलता I2)

Header-Datei#include "ara/crypto/cryp/key_encapsulator_public_ctx.h"
Scopeclass ara::crypto::cryp::KeyEncapsulatorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
keySlota keyslot containing a public key

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if the provided keySlot is incompatible with this context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context only supports setting a PublicKey

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_50012
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50012@rel:R25-11#a7c59bdb
Content hash
a7c59bdb
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50012
Status: valid/unmigrated Version: rel:R25-11#b5e332fa Versionshistorie & Revisions (1 transition)
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_50012@rel:R25-11#b5e332fa
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

टाइप उपनामों का प्रलेखन

टाइप उपनाम Sptr [SWS_CRYPT_21801] Upstream: RS_CRYPTO_02209

using Sptr = std::shared_ptr<KeyEncapsulatorPublicCtx>;

Smart pointer of the interface.

Header-Datei#include "ara/crypto/cryp/key_encapsulator_public_ctx.h"
Scopeclass ara::crypto::cryp::KeyEncapsulatorPublicCtx
SymbolSptr

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_21801
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_21801@rel:R25-11#dcffd244
Content hash
dcffd244
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_21801
Status: valid/unmigrated Version: rel:R25-11#6c7506e9 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_21801@rel:R25-11#6c7506e9
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#d5df06eb2026-09-30
  • R19-11rel:R19-11#3a23dd282026-10-14
  • R20-11rel:R20-11#b2bfbd8b2026-10-14
  • R21-11rel:R21-11#b2bfbd8b2026-10-14
  • R22-11rel:R22-11#1b749d9b2026-10-14
  • R23-11rel:R23-11#7bb57d5b2026-10-14
  • R24-11rel:R24-11#7bb57d5b2026-10-14
  • R25-11rel:R25-11#6c7506e92026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill