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

用户指南人工智能生成

通过公钥非对称封装对称密钥,或在封装过程中生成对称密钥。
AI 生成 未审核 模型: 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 定义了使用公钥的密钥封装机制(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 的实例通过定义为 std::shared_ptr<KeyEncapsulatorPublicCtx> 的类型化智能指针 KeyEncapsulatorPublicCtx::Sptr 进行管理([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::core::Result 使用来自 ara::crypto::CryptoErrc 的值报告错误,并在发生错误时确保回滚语义。主要错误情况包括:

本指南仅基于 AUTOSAR Adaptive Platform Release R25-11 规范。

成员图

类图

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

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.

AI 生成 未审核 模型: 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#b49a9559
Content hash
b49a9559
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.

AI 生成 未审核 模型: 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:上下文事先未用公钥初始化 [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#5ee97f3c
Content hash
5ee97f3c
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#1c794417
Content hash
1c794417
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.

AI 生成 未审核 模型: 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] 设置密钥。

并发性与限制

该函数被指定为 thread-safe 和 exception safe,并具有 noexcept 保证 [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#4b94af27
Content hash
4b94af27
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.

AI 生成 未审核 模型: 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#126a03e6
Content hash
126a03e6
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#3fa06fbe
Content hash
3fa06fbe
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