DEENESPTFRRUARHIKOZHNL

فئة ara::crypto::cryp::SymmetricKeyWrapperCtx

[SWS_CRYPT_24000] Upstream: RS_CRYPTO_02104, RS_CRYPTO_02208

class SymmetricKeyWrapperCtx :               public CryptoContext {...};

Context of a symmetric key wrap algorithm.

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

دليل المستخدممولَّد بالذكاء الاصطناعي

يتيح تغليف المفاتيح وفك تغليفها بشكل آمن باستخدام تشفير المفاتيح المتماثل.
مُولَّد بالذكاء الاصطناعي غير مُراجَع النموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 16126e8d9692 المصدر أسئلة مفتوحة (1)
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني

يتيح تغليف المفاتيح وفك تغليفها بشكل آمن باستخدام تشفير المفاتيح المتماثل.

يُستخدم السياق SymmetricKeyWrapperCtx للتغليف وفك التغليف التشفيري للمفاتيح باستخدام خوارزميات متماثلة. قبل تنفيذ Wrap أو UnwrapSymmetricKey، يجب تكوين السياق عبر SetKey بمفتاح تشفير مفاتيح (KEK) متوافق [SWS_CRYPT_24018]. تفترض جميع العمليات وجود أذونات الاستخدام المقابلة لكائنات المفاتيح المشاركة وتبلغ عن الأخطاء عبر ara::core::Result بدلالات التراجع [SWS_CRYPT_24014]. الواجهة آمنة من الاستثناءات ومحددة كآمنة للخيوط للتشغيل المتزامن.

السياق

تحدد الفئة SymmetricKeyWrapperCtx الواجهة القياسية لخوارزميات لف المفاتيح المتماثلة (Key Wrapping) ضمن AUTOSAR Adaptive Platform. وتتمثل مسؤوليتها المركزية في الحماية التشفيرية للمفاتيح أثناء التصدير وكذلك استعادة المفاتيح المغلفة للاستخدام الداخلي. تتفاعل الفئة هنا بشكل أساسي مع مفاتيح تشفير المفاتيح (Key Encryption Keys، KEK)، والتي يتم توفيرها إما ككائن مفتاح عابر من النوع SymmetricKey أو بشكل دائم عبر KeySlot [SWS_CRYPT_24018]، [SWS_CRYPT_50034]. عند التغليف، يستقبل السياق CryptoObject عاماً [SWS_CRYPT_24014]، بينما تنشئ عملية فك التغليف كائن SymmetricKey جديداً وجاهزاً للاستخدام وترجعه [SWS_CRYPT_24016].

دورة الحياة

تتم إدارة حالات SymmetricKeyWrapperCtx عبر المؤشر الذكي محدد النوع Sptr (وهو اسم مستعار لـ std::shared_ptr<SymmetricKeyWrapperCtx>) [SWS_CRYPT_24001]. ويُرجح أن يتم الإنشاء الفعلي للكائن عبر مصنع مزود مختص، نظراً لأن الفئة تمثل واجهة مجردة ذات توابع افتراضية بحتة. سؤال Q-7b9a1007da43ddcd (مفتوح) جميع الدوال الأعضاء في الواجهة محددة بأنها آمنة من الاستثناءات (exception safe) وآمنة للخيوط (thread-safe)، مما يتيح الاستخدام الآمن في مكونات برمجية متزامنة [SWS_CRYPT_24014]، [SWS_CRYPT_24016].

يمر السياق في دورة حياته بمرحلتين أساسيتين: يكون في حالة غير مهيأة بعد إنشاء النسخة مباشرة. وخلال هذه المرحلة، تفشل العمليات التشفيرية وحسابات التخزين المؤقت بالخطأ kUninitializedContext [SWS_CRYPT_50035]، [SWS_CRYPT_24014]. ولا ينتقل السياق إلى الحالة الجاهزة للتشغيل، التي يمكن فيها تغليف المفاتيح أو فك تغليفها بأمان، إلا بعد الاستدعاء الناجح لـ SetKey باستخدام KEK أو KeySlot متوافق [SWS_CRYPT_24018]، [SWS_CRYPT_50034].

مسار الاستخدام

يتطلب المسار المعتاد لتغليف مفتاح تسلسلاً منسقاً من التكوين، وفحص التخزين المؤقت، والتنفيذ. في البداية، يقوم التطبيق بتكوين السياق عبر SetKey باستخدام كائن KEK المطلوب [SWS_CRYPT_24018] أو بربط KeySlot مطابق [SWS_CRYPT_50034]. وفي الخطوة الثانية، يحدد التطبيق عبر GetRequiredWrappedKeyBufferSize الحد الأقصى لحجم المخزن المؤقت للإخراج المطلوب للكائن الهدف المراد تغليفه [SWS_CRYPT_50035]. وبعد توفير نطاق ذاكرة ذي أبعاد مناسبة (ReadWriteMemRegion)، يتم استدعاء Wrap، والذي يكتب بيانات المفتاح المسلسلة والمشفرة في المخزن المؤقت ويرجع عدد البايتات الدقيق [SWS_CRYPT_24014].

Symmetrischer Key-Wrapping-AblaufالتطبيقSymmetricKeyWrapperCtxSetKey(kek)ara::core::Result<void>GetRequiredWrappedKeyBufferSize(key)ara::core::Result<std::size_t>Wrap(key, wrappedKey)ara::core::Result<std::size_t>

مخطط تسلسلي: تسلسل الاستدعاء النموذجي لتغليف المفاتيح المتماثل. المصادر: [SWS_CRYPT_24018]، [SWS_CRYPT_50035]، [SWS_CRYPT_24014]

بالنسبة للعملية المكملة المتمثلة في فك التغليف، يمرر التطبيق، بعد التكوين بواسطة SetKey، المخزن المؤقت للإدخال المحتوي على البيانات الملفوفة إلى UnwrapSymmetricKey [SWS_CRYPT_24016]. ويجب عندئذ تحديد معرف الخوارزمية الهدف (targetAlgId) بالإضافة إلى رايات الاستخدام المسموح بها (allowedUsage) للمفتاح المتماثل الجديد المراد إنشاؤه بشكل صريح [SWS_CRYPT_24016].

سيناريوهات الأخطاء

تشير طرائق الفئة إلى الأخطاء عبر نوع الإرجاع ara::core::Result مع دلالات التراجع. وتشمل سيناريوهات الأخطاء المركزية:

  • غياب التهيئة: إذا تم استدعاء GetRequiredWrappedKeyBufferSize أو Wrap أو UnwrapSymmetricKey قبل تعيين ناجح للمفتاح، فإنها تُرجع ara::crypto::CryptoErrc::kUninitializedContext [SWS_CRYPT_50035]، [SWS_CRYPT_24014]، [SWS_CRYPT_24016].
  • انتهاك حقوق الاستخدام: عند تعيين KEK، يجب أن يمتلك على الأقل الإذن kAllowKeyWrapping أو kAllowKeyUnwrapping، وإلا فإن SetKey سيفشل مع ara::crypto::CryptoErrc::kUsageViolation [SWS_CRYPT_24018]. وفي حالة Wrap، يؤدي غياب kAllowKeyWrapping في KEK أو غياب kAllowSecuredExport في الكائن المراد تغليفه أيضاً إلى kUsageViolation [SWS_CRYPT_24014]. وعند فك التغليف، يتم التحقق مما إذا كان KEK يسمح بـ kAllowKeyUnwrapping [SWS_CRYPT_24016].
  • حالات عدم التوافق وأخطاء المخزن المؤقت: إذا كان المخزن المؤقت الهدف لـ Wrap صغيراً جداً، يتم الإبلاغ عن ara::crypto::CryptoErrc::kInsufficientCapacity [SWS_CRYPT_24014]. وتؤدي تنسيقات المفاتيح الخاطئة أو الأنواع غير المتوافقة إلى ara::crypto::CryptoErrc::kInvalidArgument [SWS_CRYPT_24014]، [SWS_CRYPT_24016]. وإذا كان السياق يدعم الفتحات فقط أو كائنات المفاتيح فقط، يبلغ SetKey عن الخطأ kUnsupported [SWS_CRYPT_24018]، [SWS_CRYPT_50034].
  • تعارضات الموارد والفتحات الفارغة: إذا وصلت العملية إلى مورد مشغول، يتم إرجاع ara::crypto::CryptoErrc::kBusyResource؛ وإذا كان KeySlot المشار إليه فارغاً، ينتج عن ذلك ara::crypto::CryptoErrc::kEmptyKeySlot [SWS_CRYPT_24014]، [SWS_CRYPT_24016].

تم إنشاء هذا الدليل بواسطة ذكاء اصطناعي ويستند حصرياً إلى مواصفات AUTOSAR.

خريطة الأعضاء

أسماء الأنواع البديلة

1

مخطط الفئة

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

G nara__crypto__cryp__SymmetricKeyWrapperCtx465 SymmetricKeyWrapperCtx + GetRequiredWrappedKeyBufferSize() + SetKey() + UnwrapSymmetricKey() + Wrap() nara__crypto__cryp__CryptoContext85 CryptoContext nara__crypto__cryp__SymmetricKeyWrapperCtx465->nara__crypto__cryp__CryptoContext85

عرض التفاصيل

اختر عنصرًا من المخطط.

الدوال الأعضاء

Calculate the maximum required size of the wrapped key output buffer depending on the key to be wrapped.

virtual ara::core::Result< std::size_t > GetRequiredWrappedKeyBuffer Size (const CryptoObject &key) const noexcept;
SetKey دالة 2

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

التحميلات الزائدة SetKey 2
virtual ara::core::Result< void > SetKey (SymmetricKey::Sptr key) noexcept=0; SWS_CRYPT_24018
virtual ara::core::Result< void > SetKey (KeySlot::Sptr keySlot) noexcept=0; SWS_CRYPT_50034

Unwrap a wrapped key using the previously set key encryption key and return an SymmetricKey.

virtual ara::core::Result< SymmetricKey::Sptr > UnwrapSymmetricKey (ReadOnlyMemRegion wrappedKey, AlgId targetAlgId, AllowedUsageFlags allowedUsage) const noexcept=0;
Wrap دالة

Wrap the provided key using the previously set key encryption key.

virtual ara::core::Result< std::size_t > Wrap (CryptoObject::Sptr key, ReadWriteMemRegion wrappedKey) const noexcept=0;

أسماء الأنواع البديلة

Sptr اسم نوع بديل

Smart pointer of the interface.

توثيق الدوال

دالة GetRequiredWrappedKeyBufferSize [SWS_CRYPT_50035] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > GetRequiredWrappedKeyBuffer Size (const CryptoObject &key) const noexcept;

Calculate the maximum required size of the wrapped key output buffer depending on the key to be wrapped.

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

Parameter (in)

ParameterBeschreibung
keykey to be wrapped

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_50035
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50035@rel:R25-11#787dbdfa
Content hash
787dbdfa
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50035
Status: valid/unmigrated Version: rel:R25-11#79bcf3cd 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_50035@rel:R25-11#79bcf3cd
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_24018] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

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

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

مُولَّد بالذكاء الاصطناعي غير مُراجَع النموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: d0a83598653d المصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني

الاستخدام والدلالات

تُهيئ دالة العضو المتزامنة SetKey مثيلاً من ara::crypto::cryp::SymmetricKeyWrapperCtx بحيث يُستخدم الكائن المُمرَّر SymmetricKey::Sptr كـ Key Encryption Key (KEK) لعمليات المفاتيح اللاحقة [SWS_CRYPT_24018]. حُددت الدالة كدالة افتراضية صرفة مع noexcept وتُرجع ara::core::Result<void> فارغًا إذا كان التعيين ناجحًا [SWS_CRYPT_24018].

معالجة الأخطاء والتراجع (Rollback)

إذا حدث خطأ أثناء التكوين، تُطبق دلالات تراجع إلزامية، بحيث تظل حالة السياق دون تغيير [SWS_CRYPT_24018]. وتُمثَّل أسباب الأخطاء المحتملة عبر رموز أخطاء من ara::crypto::CryptoErrc:

  • kIncompatibleObject: كائن المفتاح المُمرَّر غير متوافق مع السياق المتماثل [SWS_CRYPT_24018].
  • kUsageViolation: الاستخدام المسموح به للمفتاح لا يتضمن kAllowKeyWrapping ولا kAllowKeyUnwrapping [SWS_CRYPT_24018].
  • kUnsupported: يدعم تنفيذ السياق حصريًا تعيين مفتاح عبر KeySlot [SWS_CRYPT_24018].

التزامن والتفاعل

حُددت الدالة على أنها thread-safe وآمنة من الاستثناءات (exception safe) [SWS_CRYPT_24018]. وإذا كانت المفاتيح تُدار عبر فتحات أو كان السياق يدعم KeySlots حصريًا، فيوجد لسياق التغليف نفسه التحميل الزائد البديل SetKey مع KeySlot::Sptr [SWS_CRYPT_50034]. ويقوم هذا التحميل بتهيئة السياق لتحميل المفتاح المخزن في الفتحة في وقت تنفيذ عملية تغليف المفتاح [SWS_CRYPT_50034].

تستند ملاحظة الاستخدام هذه إلى مواصفة AUTOSAR Adaptive Platform الإصدار R25-11.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

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

Parameter (in)

ParameterBeschreibung
keythe the key encryption key (KEK) object

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 symmetric key context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the key does not include kAllowKey Wrapping or kAllowKeyUnwrapping
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_24018
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_24018@rel:R25-11#44478ce7
Content hash
44478ce7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_24018
Status: valid/unmigrated Version: rel:R25-11#5ba8abd5 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_24018@rel:R25-11#5ba8abd5
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#07e640252026-09-30
  • R20-11rel:R20-11#dc67c1dc2026-10-14
  • R21-11rel:R21-11#34c85a1a2026-10-14
  • R22-11rel:R22-11#4ead34ac2026-10-14
  • R23-11rel:R23-11#9ca31f482026-10-14
  • R24-11rel:R24-11#bb17e6102026-10-14
  • R25-11rel:R25-11#5ba8abd52026-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_50034] 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 wrapping is performed.

مُولَّد بالذكاء الاصطناعي غير مُراجَع النموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 30d79040bb46 المصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني

الاستخدام

تقوم الطريقة الافتراضية SetKey بتهيئة السياق ara::crypto::cryp::SymmetricKeyWrapperCtx بحيث يُستخدم المفتاح المخزن في KeySlot المقدم بمجرد تنفيذ تغليف المفاتيح [SWS_CRYPT_50034]. يتوقع الاستدعاء كمعامل keySlot عنصر KeySlot::Sptr يحتوي على مفتاح متماثل [SWS_CRYPT_50034]. يتم استدعاء الدالة بشكل متزامن، وهي معلنة بـ noexcept وتُرجع ara::core::Result<void> [SWS_CRYPT_50034].

معالجة الأخطاء

في حالة حدوث خطأ، تضمن الطريقة دلالات التراجع (Rollback) وتُرجع إحدى نتائج الخطأ التالية [SWS_CRYPT_50034]:

  • ara::crypto::CryptoErrc::kIncompatibleObject: عنصر keySlot الممرر غير متوافق مع هذا السياق [SWS_CRYPT_50034].
  • ara::crypto::CryptoErrc::kUnsupported: يدعم السياق فقط تعيين SymmetricKey مباشر [SWS_CRYPT_50034].

التزامن

العملية آمنة من حيث خيوط التنفيذ (thread-safe) وتوفر أمان استثناءات مضمونًا (exception safe) [SWS_CRYPT_50034].

تفاعل

تمثل الواجهة داخل SymmetricKeyWrapperCtx النظير المعتمد على الفتحات للتحميل الزائد SetKey مع SymmetricKey::Sptr، والذي يربط مفتاحًا مباشرة كمفتاح تشفير المفاتيح (KEK) [SWS_CRYPT_24018]. وتُستخدم دوال تهيئة مماثلة معتمدة على الفتحات أيضًا في سياقات تشفير ذات صلة مثل KeyDerivationFunctionCtx [SWS_CRYPT_50010]، وKeyEncapsulatorPublicCtx [SWS_CRYPT_50012]، وVerifierPublicCtx [SWS_CRYPT_50018]، وMessageAuthnCodeCtx [SWS_CRYPT_50026]، وSignerPrivateCtx [SWS_CRYPT_50036].

تم توليد إشعار الاستخدام هذا آليًا استنادًا إلى مواصفة AUTOSAR Adaptive R25-11.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

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

Parameter (in)

ParameterBeschreibung
keySlota keyslot containing a symmetric 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 SymmetricKey

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50034
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50034@rel:R25-11#b8769d5e
Content hash
b8769d5e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50034
Status: valid/unmigrated Version: rel:R25-11#c06f6729 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_50034@rel:R25-11#c06f6729
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

دالة UnwrapSymmetricKey [SWS_CRYPT_24016] Upstream: RS_CRYPTO_02115

virtual ara::core::Result< SymmetricKey::Sptr > UnwrapSymmetricKey (ReadOnlyMemRegion wrappedKey, AlgId targetAlgId, AllowedUsageFlags allowedUsage) const noexcept=0;

Unwrap a wrapped key using the previously set key encryption key and return an SymmetricKey.

مُولَّد بالذكاء الاصطناعي غير مُراجَع النموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: fe87df5f5eae المصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني

تفك الطريقة UnwrapSymmetricKey للواجهة ara::crypto::cryp::SymmetricKeyWrapperCtx تشفير مفتاح مغلف باستخدام مفتاح تشفير المفاتيح (KEK) الذي تم تعيينه مسبقًا، وتُرجع كائن SymmetricKey جديدًا [SWS_CRYPT_24016]. وتستقبل الدالة المتزامنة كمعلمات كلاً من مخزن الإدخال المؤقت المحتوي على بيانات المفتاح المحمية (wrappedKey)، ومعرّف الخوارزمية للمفتاح الهدف (targetAlgId)، بالإضافة إلى رايات البت لأنواع التحويل المسموح بها الخاصة به (allowedUsage) [SWS_CRYPT_24016].

تحتوي قيمة الإرجاع ara::core::Result<SymmetricKey::Sptr> عند التنفيذ الناجح على مؤشر ذكي إلى المفتاح المُنشأ أو تشير إلى خطأ مع أسلوب دلالي للتراجع [SWS_CRYPT_24016]. وأسباب الخطأ المحتملة هي:

  • InvalidArgument: لا يمكن فك تغليف بيانات المفتاح الممررة في wrappedKey، لسبب مثل التنسيق غير الصالح أو الحجم الخاطئ للمخزن المؤقت [SWS_CRYPT_24016].
  • ara::crypto::CryptoErrc::kUninitializedContext: لم تتم تهيئة سياق أداة التغليف بعد باستخدام KEK مناسب [SWS_CRYPT_24016].
  • ara::crypto::CryptoErrc::kUsageViolation: قيود استخدام الـ KEK تمنع فك التغليف (غياب kAllowKeyUnwrapping) [SWS_CRYPT_24016].
  • ara::crypto::CryptoErrc::kUnknownIdentifier: القيمة الممررة لـ targetAlgId غير معروفة أو غير مدعومة [SWS_CRYPT_24016].
  • ara::crypto::CryptoErrc::kIncompatibleArguments: رايات allowedUsage المحددة غير متوافقة مع targetAlgId أو مع نوع المفتاح [SWS_CRYPT_24016].
  • ara::crypto::CryptoErrc::kBusyResource: يوجد مورد نظام مطلوب للعملية قيد الاستخدام حاليًا [SWS_CRYPT_24016].
  • ara::crypto::CryptoErrc::kEmptyKeySlot: يوجد KeySlot تم تكوينه للعملية وهو فارغ [SWS_CRYPT_24016].

تم التصريح عن الطريقة كـ const وكذلك noexcept، وتضمن الأمان من الاستثناءات، وهي آمنة خيطيًا (thread-safe) للاستدعاء المتزامن وفقًا للمواصفة [SWS_CRYPT_24016].

تم إنشاء هذا النص بواسطة ذكاء اصطناعي وهو بمثابة دليل توجيهي. المرجع الأساسي هو المواصفة.

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

Parameter (in)

ParameterBeschreibung
wrappedKeyan input buffer that contains the wrapped key
targetAlgIdthe algId of the to be created unwrapped key
allowedUsagebit-flags that define a list of allowed transformations’ types in which the unwrapped key can be used

Rückgabewert

TypBeschreibung
ara::core::Result<SymmetricKey::Sptr >a result containing the unwrapped SymmetricKey object or an error

Fehler

FehlercodeBeschreibung
InvalidArgumentif the wrapped key data cannot be unwrapped (e.g., invalid format or size)
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics if the context was not initialized by a key value
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the KEK does not include kAllowKey Unwrapping
ara::crypto::CryptoErrc::kUnknownIdentifierrollback_semantics if targetAlgId has an unsupported value
ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics if the allowedUsage is incompatible with the targetAlgId or the key type
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 KEK does not include kAllowKey Unwrapping

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

Record
AUTOSAR/AP/record/SWS_CRYPT_24016
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_24016@rel:R25-11#75f32f57
Content hash
75f32f57
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_24016
Status: valid/unmigrated Version: rel:R25-11#7d151daa 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_24016@rel:R25-11#7d151daa
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#74bd38af2026-09-30
  • R19-11rel:R19-11#8ec5b1a02026-10-14
  • R20-11rel:R20-11#496f81ad2026-10-14
  • R21-11rel:R21-11#354b26632026-10-14
  • R22-11rel:R22-11#767017ac2026-10-14
  • R23-11rel:R23-11#624822262026-10-14
  • R24-11rel:R24-11#9c4b80db2026-10-14
  • R25-11rel:R25-11#7d151daa2026-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

دالة Wrap [SWS_CRYPT_24014] Upstream: RS_CRYPTO_02201

virtual ara::core::Result< std::size_t > Wrap (CryptoObject::Sptr key, ReadWriteMemRegion wrappedKey) const noexcept=0;

Wrap the provided key using the previously set key encryption key.

مُولَّد بالذكاء الاصطناعي غير مُراجَع النموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 8e6ff8198c9d المصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني

الاستخدام

تغلف الطريقة Wrap للفئة ara::crypto::cryp::SymmetricKeyWrapperCtx (ملف الترويسة ara/crypto/cryp/symmetric_key_wrapper_ctx.h) مفتاحًا تم توفيره باستخدام مفتاح تشفير المفاتيح (Key Encryption Key) الذي تم تعيينه مسبقًا [SWS_CRYPT_24014].

تتوقع الدالة المتزامنة المعلمات التالية [SWS_CRYPT_24014]:

  • key (CryptoObject::Sptr): المفتاح المراد تغليفه.
  • wrappedKey (ReadWriteMemRegion): مخزن مؤقت للإخراج يُكتب فيه المفتاح المغلف.

كقيمة إرجاع، تقدم العملية ara::core::Result<std::size_t>، والذي يحتوي في حالة النجاح على عدد البايتات المكتوبة في المخزن المؤقت للمفتاح المغلف [SWS_CRYPT_24014].

معالجة الأخطاء والدلالة

تُعرَّف الطريقة كـ exception safe وتطبق أسلوبًا دلاليًا صارمًا للتراجع في حالات الخطأ [SWS_CRYPT_24014]. ويمكن الإبلاغ عن حالات الخطأ التالية [SWS_CRYPT_24014]:

  • InvalidArgument: لا يمكن تغليف كائن المفتاح (على سبيل المثال بسبب حجم غير صالح أو نوع خاطئ).
  • ara::crypto::CryptoErrc::kUninitializedContext: لم تتم تهيئة السياق بعد بقيمة مفتاح.
  • ara::crypto::CryptoErrc::kUsageViolation: الاستخدام المسموح به للـ KEK لا يتضمن kAllowKeyWrapping، أو أن الاستخدام الخاص بالكائن لا يتضمن kAllowSecuredExport.
  • ara::crypto::CryptoErrc::kInsufficientCapacity: المخزن المؤقت للإخراج wrappedKey صغير جدًا.
  • ara::crypto::CryptoErrc::kBusyResource: يوجد مورد مطلوب قيد الاستخدام.
  • ara::crypto::CryptoErrc::kEmptyKeySlot: إن KeySlot الذي تم تكوينه فارغ حاليًا.

التزامن والقيود

تم تحديد الواجهة كـ thread-safe [SWS_CRYPT_24014]. ويُعد وجود سياق مهيأ مسبقًا بالإضافة إلى سمات استخدام مناسبة للمفاتيح المعنية شرطًا أساسيًا للتنفيذ [SWS_CRYPT_24014].

تم توليد إشعار الاستخدام هذا تلقائيًا استنادًا إلى مواصفة AUTOSAR Adaptive R25-11.

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

Parameter (in)

ParameterBeschreibung
keythe key to be wrapped

Parameter (out)

ParameterBeschreibung
wrappedKeyan output buffer that the wrapped key will be written to

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing either a the number of bytes of the wrapped key or an error

Fehler

FehlercodeBeschreibung
InvalidArgumentif the key object cannot be wrapped (e.g., invalid size or type)
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics if the context was not initialized by a key value
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the KEK does not include kAllowKey Wrapping or the allowed usage of the object does not include k AllowSecuredExport
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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_24014
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_24014@rel:R25-11#2437675f
Content hash
2437675f
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_24014
Status: valid/unmigrated Version: rel:R25-11#d59df6cf 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_24014@rel:R25-11#d59df6cf
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#ac935a362026-09-30
  • R19-11rel:R19-11#b94a246e2026-10-14
  • R20-11rel:R20-11#999104362026-10-14
  • R21-11rel:R21-11#d51795ed2026-10-14
  • R22-11rel:R22-11#f7dabf992026-10-14
  • R23-11rel:R23-11#5c3c2d942026-10-14
  • R24-11rel:R24-11#90cde3442026-10-14
  • R25-11rel:R25-11#d59df6cf2026-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

توثيق أسماء الأنواع البديلة

اسم نوع بديل Sptr [SWS_CRYPT_24001] Upstream: RS_CRYPTO_02201

using Sptr = std::shared_ptr<SymmetricKeyWrapperCtx>;

Smart pointer of the interface.

Header-Datei#include "ara/crypto/cryp/symmetric_key_wrapper_ctx.h"
Scopeclass ara::crypto::cryp::SymmetricKeyWrapperCtx
SymbolSptr

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

Record
AUTOSAR/AP/record/SWS_CRYPT_24001
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_24001@rel:R25-11#52eed008
Content hash
52eed008
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_24001
Status: valid/unmigrated Version: rel:R25-11#aef6197c 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_24001@rel:R25-11#aef6197c
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#10e154c52026-09-30
  • R19-11rel:R19-11#521f46bb2026-10-14
  • R20-11rel:R20-11#0ab69c592026-10-14
  • R21-11rel:R21-11#8d463cfa2026-10-14
  • R22-11rel:R22-11#7a7fa6972026-10-14
  • R23-11rel:R23-11#4b170d372026-10-14
  • R24-11rel:R24-11#4b170d372026-10-14
  • R25-11rel:R25-11#aef6197c2026-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