फ़ंक्शन 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.
क्लास ara::crypto::cryp::KeyDerivationFunctionCtx की विधि DeriveKey उपलब्ध कुंजी सामग्री के साथ-साथ संदर्भ में संग्रहीत पैरामीटर जैसे सॉल्ट, इनिशियलाइज़ेशन वेक्टर (IV) या पुनरावृत्ति काउंटर (iteration counter) से एक नई सममित कुंजी को सिंक्रोनस रूप से प्राप्त करती है [SWS_CRYPT_21515]।
उपयोग
कॉल करते समय, वांछित क्रिप्टो एल्गोरिदम का पहचानकर्ता targetAlgId के माध्यम से और अनुमत उपयोग फ़्लैग allowedUsage के माध्यम से पास किए जाते हैं [SWS_CRYPT_21515]। रिटर्न मान के रूप में, फ़ंक्शन सिंक्रोनस रूप से एक ara::core::Result<SymmetricKey::Sptr> प्रदान करता है, जो सफल निष्पादन पर उत्पन्न सममित कुंजी ऑब्जेक्ट के लिए एक स्मार्ट पॉइंटर उपलब्ध कराता है [SWS_CRYPT_21515]।
त्रुटि प्रबंधन
यदि कुंजी निर्माण विफल हो जाता है, तो फ़ंक्शन रोलबैक सिमेंटिक्स की गारंटी देता है और ara::core::Result में एक संगत त्रुटि कोड लौटाता है [SWS_CRYPT_21515]:
UnknownIdentifier: तब रिपोर्ट किया जाता है यदिtargetAlgIdके लिए पास किया गया मान समर्थित नहीं है [SWS_CRYPT_21515]।ara::crypto::CryptoErrc::kIncompatibleArguments: तब घटित होता है जबallowedUsageमें परिभाषित उपयोग फ़्लैग लक्ष्य एल्गोरिदम के साथ संगत नहीं होते हैं [SWS_CRYPT_21515]।ara::crypto::CryptoErrc::kUninitializedContext: कुंजी व्युत्पत्ति (key derivation) से पहले संदर्भ को पर्याप्त रूप से प्रारंभ नहीं किया गया था [SWS_CRYPT_21515]।ara::crypto::CryptoErrc::kBusyResource: कुंजी व्युत्पत्ति के लिए आवश्यक संसाधन व्यस्त है [SWS_CRYPT_21515]।ara::crypto::CryptoErrc::kEmptyKeySlot: ऑपरेशन के लिए कॉन्फ़िगर किया गया KeySlot वर्तमान में रिक्त है [SWS_CRYPT_21515]।ara::crypto::CryptoErrc::kUsageViolation: तब घटित होता है जब स्रोत कुंजी के उपयोग अधिकार मेंkAllowKeyDerivationशामिल नहीं होता है या जब लक्ष्यkAllowPlaintextExportकी मांग करता है, लेकिन स्रोतkAllowDerivedPlaintextExportकी अनुमति नहीं देता है [SWS_CRYPT_21515]।
समवर्तीता और निष्पादन संदर्भ
विधि को noexcept के रूप में निर्दिष्ट किया गया है, यह अपवाद सुरक्षा (exception safe) प्रदान करती है और समवर्ती कॉल के लिए थ्रेड-सुरक्षित डिज़ाइन की गई है [SWS_CRYPT_21515]।
यह उपयोग नोट स्वचालित रूप से तैयार किया गया था और विशेष रूप से 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#bdb40f7a- Content hash
bdb40f7a- 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 · जर्मन मूल