फ़ंक्शन AgreeKey [SWS_CRYPT_21312] Upstream: RS_CRYPTO_02115
virtual ara::core::Result< SymmetricKey::Sptr > AgreeKey (Public Key::Sptr otherSideKey, AlgId targetAlgId, AllowedUsageFlags allowed Usage) const noexcept=0;
Produce a common symmetric key via execution of the key-agreement algorithm using a private key and a public key of another side.
क्लास ara::crypto::cryp::KeyAgreementPrivateCtx की विधि AgreeKey एक साझा सममित कुंजी उत्पन्न करने के लिए एक निजी कुंजी और समकक्ष की सार्वजनिक कुंजी का उपयोग करके एक कुंजी समझौता एल्गोरिदम निष्पादित करती है [SWS_CRYPT_21312]। पैरामीटर के रूप में, समकक्ष की सार्वजनिक कुंजी (otherSideKey), लक्ष्य सममित एल्गोरिदम का पहचानकर्ता (targetAlgId) और अनुमत उपयोग फ़्लैग (allowedUsage) पास किए जाते हैं [SWS_CRYPT_21312]। सफल निष्पादन पर, SymmetricKey::Sptr युक्त एक ara::core::Result लौटाया जाता है, जिसमें परिकलित साझा रहस्य होता है [SWS_CRYPT_21312]। व्याख्या: चूँकि रिटर्न सीधे Result के रूप में होता है न कि किसी एसिंक्रोनस Future प्रकार के माध्यम से, कुंजी गणना संभवतः सिंक्रोनस रूप से निष्पादित होती है। प्रश्न Q-ab31a8a62bb1c583 (खुला)
विधि को thread-safe और exception safe (noexcept) के रूप में परिभाषित किया गया है [SWS_CRYPT_21312]। त्रुटि की स्थिति में, रोलबैक सिमेंटिक्स लागू होते हैं और एक संगत त्रुटि कोड लौटाया जाता है [SWS_CRYPT_21312]:
UninitializedContext: संदर्भ को अभी तक कोई कुंजी प्रदान करके प्रारंभ नहीं किया गया है या आवश्यक पैरामीटर पहलेSetParameter()के माध्यम से सेट नहीं किए गए हैं [SWS_CRYPT_21312]।CryptoErrc::kIncompatibleObject: सार्वजनिक कुंजी वर्तमान संदर्भ के साथ असंगत है [SWS_CRYPT_21312]।CryptoErrc::kUsageViolation: निजी या सार्वजनिक कुंजी के उपयोग प्रतिबंधों मेंkAllowKeyAgreementशामिल नहीं है [SWS_CRYPT_21312]।CryptoErrc::kInvalidArgument: पास किए गएallowedUsageफ़्लैग किसी सममित कुंजी के लिए अमान्य हैं [SWS_CRYPT_21312]।ara::crypto::CryptoErrc::kUnknownIdentifier: पहचानकर्ताtargetAlgIdमें एक असमर्थित मान शामिल है [SWS_CRYPT_21312]।CryptoErrc::kBusyResourceयाCryptoErrc::kEmptyKeySlot: एक आवश्यक संसाधन व्यस्त है या एक कॉन्फ़िगर किया गया KeySlot रिक्त है [SWS_CRYPT_21312]।
यह पाठ एक AI द्वारा जनरेट किया गया था और यह तकनीकी मार्गदर्शन के लिए कार्य करता है।
| Header-Datei | #include "ara/crypto/cryp/key_agreement_private_ctx.h" |
|---|---|
| Scope | class ara::crypto::cryp::KeyAgreementPrivateCtx |
| Exception-Sicherheit | exception safe |
| Thread-Sicherheit | thread-safe CryptoErrc::k rollback_semantics |
Parameter (in)
| Parameter | Beschreibung |
|---|---|
| otherSideKey | the public key of the other side of the Key-Agreement |
| targetAlgId | identifier of the symmetric target algorithm |
| allowedUsage | the allowed usage of the target key |
Rückgabewert
| Typ | Beschreibung |
|---|---|
| ara::core::Result<SymmetricKey::Sptr > | a result containing either a unique pointer to the SymmetricKey object, which contains the computed shared secret produced by the Key-Agreement algorithm or an error |
Fehler
| Fehlercode | Beschreibung |
|---|---|
| UninitializedContext | if the context was not initialized by deploying a key or not all required parameters have been set via SetParameter() |
| CryptoErrc::kIncompatibleObject | rollback_semantics if the public key is not compatible to this context |
| CryptoErrc::kInvalidArgument | rollback_semantics if the allowed usage flags are invalid for a symmetric key |
| CryptoErrc::kBusyResource | rollback_semantics a required resource is busy |
| CryptoErrc::kEmptyKeySlot | rollback_semantics if a KeySlot was configured that is currently is empty |
| CryptoErrc::kUsageViolation | rollback_semantics if the allowed usage of the private or public key do not include k AllowKeyAgreement |
| ara::crypto::CryptoErrc::kUnknownIdentifier | rollback_semantics if targetAlgId has an unsupported value |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_CRYPT_21312- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_CRYPT_21312@rel:R25-11#c305dc8c- Content hash
c305dc8c- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_21312
Status: valid/unmigrated
Version: rel:R25-11#26c80425
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_21312@rel:R25-11#26c80425
Recorded Revisions (8):
- R25-11
rel:R25-11#4f58d41f2026-09-30 - R19-11
rel:R19-11#3975d40e2026-10-14 - R20-11
rel:R20-11#340c62732026-10-14 - R21-11
rel:R21-11#633195382026-10-14 - R22-11
rel:R22-11#418b5aab2026-10-14 - R23-11
rel:R23-11#28812de12026-10-14 - R24-11
rel:R24-11#c610b1882026-10-14 - R25-11
rel:R25-11#26c804252026-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 · जर्मन मूल