DEENESPTFRRUARHIKOZHNL

类 ara::crypto::cryp::DecryptorPrivateCtx

[SWS_CRYPT_50155] Upstream: RS_CRYPTO_02201

class DecryptorPrivateCtx :             public CryptoContext {...};

Interface for asymmetric decryption.

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

用户指南人工智能生成

支持使用私钥通过单次调用或数据流对数据进行非对称解密。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 80609e0a7ac2 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

支持使用私钥通过单次调用或数据流对数据进行非对称解密。

接口 ara::crypto::cryp::DecryptorPrivateCtx 用于在 AUTOSAR Adaptive Platform 中对密文进行非对称解密([SWS_CRYPT_50070])。在执行之前,必须向上下文传递具有解密使用权限的私钥([SWS_CRYPT_50157])。处理可以根据需要在单次调用中进行,或者通过 Start、Update 和 Finish 阶段作为多段数据流进行。该接口的所有方法均实现了线程安全和异常安全。

上下文

接口 ara::crypto::cryp::DecryptorPrivateCtx 用于 AUTOSAR Adaptive Platform 加密模块中密文的非对称解密。作为 CryptoContext 的特化,它提供加密转换功能,利用私钥将密文还原为明文。核心交互伙伴包括调用应用程序以及作为 PrivateKey 或通过 KeySlot 提供的密钥对象。该接口的实例通常通过类型化智能指针 Sptr([SWS_CRYPT_50156])进行管理。

生命周期

DecryptorPrivateCtx 的管理通过别名 ara::crypto::cryp::DecryptorPrivateCtx::Sptr 进行,该别名映射到 std::shared_ptr<DecryptorPrivateCtx>([SWS_CRYPT_50156])。解释:由于该类是具有纯虚方法的接口,因此具体创建通常由加密驱动程序的工厂执行。 问题 Q-6130603fcaf29ef9 (未决)

在实例化之后,上下文立即处于未初始化状态。在此状态下,操作性转换调用会导致错误。为了激活,必须分配一个私钥。这可以通过使用 SetKey()([SWS_CRYPT_50157])传递 PrivateKey::Sptr,或者通过封装该密钥的 KeySlot::Sptr([SWS_CRYPT_50066])来完成。

一旦使用有效密钥配置了上下文,它就会转换为 Initialized 状态。在此状态下,该上下文既可以直接用于单次解密,也可以通过 Start()([SWS_CRYPT_50067])转换为 Streaming 处理状态。在流式传输期间,Update()([SWS_CRYPT_50158])接收密文片段。该序列通过 Finish()([SWS_CRYPT_50068])完成,或通过 Cancel()([SWS_CRYPT_50069])中止,随后上下文再次准备好执行新操作。所有接口方法均被指定为线程安全和异常安全([SWS_CRYPT_50066]、[SWS_CRYPT_50067]、[SWS_CRYPT_50070])。

StateMachine Uninitialized Uninitialized Initialized Initialized Uninitialized->Initialized SetKey() Initialized->Initialized SetKey() / Decrypt() Streaming Streaming Initialized->Streaming Start() Streaming->Initialized Finish() / Cancel() Streaming->Streaming Update()

状态图:上下文从密钥绑定到流式传输直至终止的生命周期状态。来源:[SWS_CRYPT_50066]、[SWS_CRYPT_50157]、[SWS_CRYPT_50067]、[SWS_CRYPT_50158]、[SWS_CRYPT_50068]、[SWS_CRYPT_50069]、[SWS_CRYPT_50070]。

使用路径

解密有两种不同的流程可用:无状态单次解密和多步骤流式处理。在传递数据之前,调用应用程序可以使用 GetMinimumChunkSize()([SWS_CRYPT_50160])和 GetMaximumChunkSize()([SWS_CRYPT_50071])查询密文的允许输入限制。通过 GetRequiredOutputBufferSize()([SWS_CRYPT_50159])可以预先确定 Update()、Finish() 或 Decrypt() 所需的输出缓冲区大小。

对于较小的数据量,在配置密钥后直接通过 Decrypt()([SWS_CRYPT_50070])执行解密。密文在一个步骤中完成转换,并返回实际解密的字节数。

较大或分段传入的密文通过流式传输路径进行处理:

  1. 密钥分配:通过 SetKey() 使用 PrivateKey([SWS_CRYPT_50157])或 KeySlot([SWS_CRYPT_50066])配置上下文。
  2. 初始化:调用 Start()([SWS_CRYPT_50067])以准备内部处理状态。
  3. 分块处理:针对连续的密文块重复调用 Update()([SWS_CRYPT_50158])。
  4. 最终化:调用 Finish()([SWS_CRYPT_50068])以处理最终块并终止数据流。或者,可以通过 Cancel()([SWS_CRYPT_50069])提前中止操作。
流式解密的流程应用DecryptorPrivateCtxSetKey(key)Result<void>Start()Result<void>loopSolange Chunks vorhandenUpdate(in, out)Result<std::size_t>Finish(in, out)Result<std::size_t>

时序图:多段流式解密的典型调用序列。来源:[SWS_CRYPT_50157]、[SWS_CRYPT_50067]、[SWS_CRYPT_50158]、[SWS_CRYPT_50068]。

错误场景

DecryptorPrivateCtx 的方法通过 ara::core::Result 返回带有来自 ara::crypto::CryptoErrc 的代码的错误,并遵循回滚语义:

本指南由 AI 基于 AUTOSAR 规范 R25-11 生成。

成员图

类图

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

G nara__crypto__cryp__DecryptorPrivateCtx616 DecryptorPrivateCtx + Cancel() + Decrypt() + Finish() + GetMaximumChunkSize() + GetMinimumChunkSize() + GetRequiredOutputBufferSize() + SetKey() + Start() + Update() nara__crypto__cryp__CryptoContext85 CryptoContext nara__crypto__cryp__DecryptorPrivateCtx616->nara__crypto__cryp__CryptoContext85

详细视图

请在大纲中选择一个条目。

方法

Cancel 函数

Cancel the ongoing streaming operation that has been initiated by Start() and has not yet been finished.

virtual ara::core::Result< void > Cancel () noexcept=0;
Decrypt 函数

Decrypt data in a single-call.

virtual ara::core::Result< std::size_t > Decrypt (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;
Finish 函数

Finalize the decryption.

virtual ara::core::Result< std::size_t > Finish (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;

Get the maximum input buffer size supported for processing in single calls to Update(), Finish(), or Decrypt() by this context.

virtual ara::core::Result< std::size_t > GetMaximumChunkSize () const noexcept=0;

Get the minimum input buffer size supported for processing in single calls to Update(), Finish(), or Decrypt() by this context.

virtual ara::core::Result< std::size_t > GetMinimumChunkSize () const noexcept=0;

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 (std::size_t inputSize, bool isFinal) const noexcept;
SetKey 函数 2

Configure the context to use the key stored in the provided KeySlot at the time the decryption is started.

重载 SetKey 2
virtual ara::core::Result< void > SetKey (KeySlot::Sptr keySlot) noexcept=0; SWS_CRYPT_50066
virtual ara::core::Result< void > SetKey (PrivateKey::Sptr key) noexcept=0; SWS_CRYPT_50157
Start 函数

Initialize the context for a new decryption.

virtual ara::core::Result< void > Start () noexcept=0;
Update 函数

Decrypt a data buffer.

virtual ara::core::Result< std::size_t > Update (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;

类型别名

Sptr 类型别名

Smart pointer of the interface.

方法文档

函数 Cancel [SWS_CRYPT_50069] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< void > Cancel () noexcept=0;

Cancel the ongoing streaming operation that has been initiated by Start() and has not yet been finished.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 1601c28db7a4 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

在 ara/crypto/cryp/decryptor_private_ctx.h 中定义的类 ara::crypto::cryp::DecryptorPrivateCtx 的方法 Cancel 中止正在运行的流操作,该操作先前通过 Start() 启动且尚未完成 [SWS_CRYPT_50069]。该调用不接收任何传入参数,并返回 ara::core::Result<void> 作为返回值 [SWS_CRYPT_50069]。如果中止流处理成功,则该对象包含一个空 Result;否则它传递发生的错误 [SWS_CRYPT_50069]。该纯虚接口声明为 noexcept,具有完全的异常安全性,并被指明为并发访问线程安全 [SWS_CRYPT_50069]。

在错误处理和前置条件方面必须注意严格的顺序:如果此前未通过调用方法 Start() 启动数据处理,则操作失败并返回具有回滚语义的特定错误码 ara::crypto::CryptoErrc::kProcessingNotStarted [SWS_CRYPT_50069]。因此调用方必须确保在中止之前已存在活动操作,以避免这种错误状态 [SWS_CRYPT_50069]。

在与 crypt 的整个模块架构的交互中,Cancel 遵循用于有状态流式处理过程的标准化设计模式。相关的加密上下文 ara::crypto::cryp::VerifierPublicCtx [SWS_CRYPT_50023]、ara::crypto::cryp::MessageAuthnCodeCtx [SWS_CRYPT_50027]、ara::crypto::cryp::SignerPrivateCtx [SWS_CRYPT_50041]、ara::crypto::cryp::SymmetricCipherCtx [SWS_CRYPT_50046]、ara::crypto::cryp::HashFunctionCtx [SWS_CRYPT_50058]、ara::crypto::cryp::AuthCipherCtx [SWS_CRYPT_50077] 以及 ara::crypto::cryp::EncryptorPublicCtx [SWS_CRYPT_50089] 共享相同的签名、返回语义和错误处理。

本使用说明基于 AUTOSAR 规范 R25-11 自动生成。

实现者指南即将推出(复杂度 I1)

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

Rückgabewert

TypBeschreibung
ara::core::Result< void >an empty result if the ongoing streaming operation was cancelled successfully, or a result containing an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics if data processing was not started by a call of the Start() method

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

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

函数 Decrypt [SWS_CRYPT_50070] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > Decrypt (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;

Decrypt data in a single-call.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 5c22ada69166 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步方法 Decrypt 在单步操作中解密密文数据([SWS_CRYPT_50070])。输入缓冲区 in 将密文作为 ReadOnlyMemRegion 传递,而类型为 ReadWriteMemRegion 的输出缓冲区 out 接收明文([SWS_CRYPT_50070])。成功解密后,函数通过 ara::core::Result<std::size_t> 返回写入的实际字节数,该字节数可以小于 out 的总容量([SWS_CRYPT_50070])。

该接口被指定为线程安全以及异常安全([SWS_CRYPT_50070])。调用前必须已通过分配密钥对上下文进行了初始化;否则函数失败并返回 UninitializedContext,或者在 KeySlot 为空时返回 ara::crypto::CryptoErrc::kEmptyKeySlot([SWS_CRYPT_50070])。密钥必须与转换算法兼容(否则返回 kIncompatibleObject),并且包含权限 kAllowDataDecryption(否则返回 kUsageViolation)([SWS_CRYPT_50070])。

为防止缓冲区溢出,可在指定 isFinal = true 的情况下预先使用 GetRequiredOutputBufferSize 查询输出缓冲区所需的最大容量([SWS_CRYPT_50159])。如果 out 的容量不足,该方法将中止并返回 ara::crypto::CryptoErrc::kInsufficientCapacity([SWS_CRYPT_50070])。此外,输入缓冲区 in 的大小必须介于 GetMinimumChunkSize([SWS_CRYPT_50160])和 GetMaximumChunkSize([SWS_CRYPT_50071])之间,否则返回 ara::crypto::CryptoErrc::kInvalidInputSize([SWS_CRYPT_50070])。其他具有回滚语义的指定错误包括 kUnsupported、kInvalidArgument 以及 kBusyResource([SWS_CRYPT_50070])。

本使用说明基于规范自动生成。

实现者指南即将推出(复杂度 I1)

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

Parameter (in)

ParameterBeschreibung
inan input data buffer containing the ciphertext

Parameter (out)

ParameterBeschreibung
outan output data buffer that the decrypted data is written to

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.

Fehler

FehlercodeBeschreibung
UninitializedContextif the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if single-call decryption is not supported
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics if the provided input data contains invalid data
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 kAllowData Decryption
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if type of the key is incompatible to the transformation

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50070
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50070@rel:R25-11#93b8b7e6
Content hash
93b8b7e6
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50070
Status: valid/unmigrated Version: rel:R25-11#42aea752 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_50070@rel:R25-11#42aea752
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

函数 Finish [SWS_CRYPT_50068] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > Finish (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;

Finalize the decryption.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: e259e05ea644 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

方法 Finish 在 ara::crypto::cryp::DecryptorPrivateCtx 的上下文中同步完成解密过程 [SWS_CRYPT_50068]。它通过输入缓冲区 in(ReadOnlyMemRegion)处理最后一个密文段,并将生成的明文数据写入输出缓冲区 out(ReadWriteMemRegion)[SWS_CRYPT_50068]。实际写入的字节数作为 ara::core::Result<std::size_t> 返回,并且可以小于目标缓冲区 out 的总容量 [SWS_CRYPT_50068]。

在调用之前,数据处理必须已通过 Start() 启动,否则将报告错误 CryptoErrc::kProcessingNotStarted [SWS_CRYPT_50068]。in 的最大允许块大小可以通过 GetMaximumChunkSize() 确定 [SWS_CRYPT_50071];如果输入长度不合适,调用将失败并返回 CryptoErrc::kInvalidInputSize [SWS_CRYPT_50068]。如果 out 太小,则会导致 CryptoErrc::kInsufficientCapacity,其中所需缓冲区大小可以通过 GetRequiredOutputBufferSize() 查询 [SWS_CRYPT_50068]。其他可能的错误包括在密文数据无效时的 CryptoErrc::kInvalidArgument,以及如果上下文中不支持流处理时的 CryptoErrc::kUnsupported [SWS_CRYPT_50068]。

该操作被规范定义为 thread-safe 以及 exception safe [SWS_CRYPT_50068]。得益于明确指定的回滚语义,在发生缓冲区错误时处理状态应当保持不变,从而在扩大缓冲区后应当可以重试。 问题 Q-e2562509449aa32c (未决)

本使用说明基于 ara::crypto 规范(AUTOSAR R25-11)自动生成。

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

Parameter (in)

ParameterBeschreibung
inan input data buffer containing a part of the ciphertext

Parameter (out)

ParameterBeschreibung
outan output data buffer that contains decrypted data. The required size of this buffer can be queried using GetRequiredOutputBuffer Size()

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.

Fehler

FehlercodeBeschreibung
ProcessingNotStartedif data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics if the provided input data contains invalid data
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if stream processing is not supported by the context

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

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

函数 GetMaximumChunkSize [SWS_CRYPT_50071] Upstream: RS_CRYPTO_02309

virtual ara::core::Result< std::size_t > GetMaximumChunkSize () const noexcept=0;

Get the maximum input buffer size supported for processing in single calls to Update(), Finish(), or Decrypt() by this context.

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

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >the maximum buffer size in bytes

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.

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

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

函数 GetMinimumChunkSize [SWS_CRYPT_50160] Upstream: RS_CRYPTO_02309

virtual ara::core::Result< std::size_t > GetMinimumChunkSize () const noexcept=0;

Get the minimum input buffer size supported for processing in single calls to Update(), Finish(), or Decrypt() by this context.

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

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >the minimum buffer size in bytes

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50160
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50160@rel:R25-11#d542a8db
Content hash
d542a8db
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50160
Status: valid/unmigrated Version: rel:R25-11#840ff3d7 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_50160@rel:R25-11#840ff3d7
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_50159] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > GetRequiredOutputBufferSize (std::size_t inputSize, bool isFinal) 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/decryptor_private_ctx.h"
Scopeclass ara::crypto::cryp::DecryptorPrivateCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
inputSizesize of input data
isFinalif true, calculate maximum required output buffer size for Finish() or Decrypt(), otherwise for Update()

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 and setting the transformation direction

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50159
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50159@rel:R25-11#088761f7
Content hash
088761f7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50159
Status: valid/unmigrated Version: rel:R25-11#34d4f358 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_50159@rel:R25-11#34d4f358
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_50066] 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 decryption is started.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: ee8ecbdc71ea 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

方法 SetKey 配置 ara::crypto::cryp::DecryptorPrivateCtx 的实例以使用存储在传入 KeySlot 中的密钥[SWS_CRYPT_50066]。传入一个 KeySlot::Sptr 作为参数,其必须包含一个 PrivateKey[SWS_CRYPT_50066]。实际密钥仅在解密操作启动的时间点才会被提取[SWS_CRYPT_50066]。该函数同步工作,并通过 ara::core::Result<void> 返回结果[SWS_CRYPT_50066]。

错误处理

发生错误时,将在 ara::core::Result 中返回相应的错误码,并适用回滚语义[SWS_CRYPT_50066]:

  • ara::crypto::CryptoErrc::kIncompatibleObject:提供的 KeySlot 与上下文不兼容[SWS_CRYPT_50066]。
  • ara::crypto::CryptoErrc::kUnsupported:上下文仅支持直接设置 PrivateKey,不支持 KeySlot[SWS_CRYPT_50066]。

并发性与交互

该接口被声明为线程安全(thread-safe)和异常安全(exception safe)[SWS_CRYPT_50066]。由于密钥的评估仅在解密开始时发生,因此在此启动时间点之前更新槽内容应当会生效。 问题 Q-ec258ea8b5a1d1c2 (未决)尽管其他加密上下文部分直接将密钥作为实例接收(例如 SignerPrivateCtx [SWS_CRYPT_23515]),但该方法遵循通过密钥槽延迟绑定的模式,正如其同样应用于 VerifierPublicCtx [SWS_CRYPT_50018] 和 KeyDerivationFunctionCtx [SWS_CRYPT_50010] 等之中。

本文由人工智能生成,用作 AUTOSAR 标准的参考指南。

实现者指南即将推出(复杂度 I2)

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

Parameter (in)

ParameterBeschreibung
keySlota keyslot containing a PrivateKey.

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 PrivateKey

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50066
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50066@rel:R25-11#22d83b82
Content hash
22d83b82
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50066
Status: valid/unmigrated Version: rel:R25-11#a48ca2e4 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_50066@rel:R25-11#a48ca2e4
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_50157] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

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

Configure the context to use the provided key.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 18619bf054a3 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

方法 SetKey 配置 ara::crypto::cryp::DecryptorPrivateCtx 的实例以使用特定私钥进行数据解密 [SWS_CRYPT_50157]。作为参数,通过 PrivateKey::Sptr key 传入一个实例。返回值是 ara::core::Result<void>,由此确认成功分配或返回错误。该调用可能同步执行(解释:接口阻塞直到接收密钥,且不返回异步 Future 对象)。 问题 Q-b8e9b5cb4174e2b2 (未决)

错误处理

在错误情况下,实现保证回滚语义,以便在发生错误时上下文状态保持不变 [SWS_CRYPT_50157]。可能出现以下错误代码:

  • ara::crypto::CryptoErrc::kIncompatibleObject:传入的密钥对象与此上下文不兼容 [SWS_CRYPT_50157]。
  • ara::crypto::CryptoErrc::kUsageViolation:密钥的允许用途不包括数据解密(kAllowData Decryption)[SWS_CRYPT_50157]。
  • ara::crypto::CryptoErrc::kUnsupported:当上下文仅设计为通过 KeySlot 占用时,该上下文不支持直接设置密钥对象 [SWS_CRYPT_50157]。

并发性与限制

该接口明确指定为thread-safe和exception safe[SWS_CRYPT_50157]。它保证在并发环境下的安全执行,并且不抛出 C++ 异常(noexcept=0)。

相互作用

通过SetKey分配密钥的过程在 Adaptive Platform 中跨不同加密上下文统一应用:相关的非对称上下文如KeyAgreementPrivateCtx[SWS_CRYPT_21313]、KeyDecapsulatorPrivateCtx[SWS_CRYPT_21413]和SignerPrivateCtx[SWS_CRYPT_23515]同样使用PrivateKey::Sptr,而在其他上下文如KeyDerivationFunctionCtx[SWS_CRYPT_50010]或VerifierPublicCtx[SWS_CRYPT_50018]中,则存在带有KeySlot::Sptr的备选变体。

本使用说明基于 AUTOSAR Adaptive R25-11 规范自动生成。

实现者指南即将推出(复杂度 I2)

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

Parameter (in)

ParameterBeschreibung
keythe PrivateKey to be used for decryption

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context only supports setting a KeySlot
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 kAllowData Decryption

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

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

函数 Start [SWS_CRYPT_50067] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< void > Start () noexcept=0;

Initialize the context for a new decryption.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 990da83b573b 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

类 ara::crypto::cryp::DecryptorPrivateCtx([SWS_CRYPT_50067])的成员函数 Start 同步初始化上下文以进行新的解密。该调用不接收参数,不抛出异常(noexcept),并返回一个在成功情况下为空的 ara::core::Result<void>([SWS_CRYPT_50067])。对于并发访问,该方法被指定为线程安全([SWS_CRYPT_50067])。

在执行之前必须已存储兼容的密钥,因为 Start 会检查其状态和权限([SWS_CRYPT_50067])。如果操作失败,则适用回滚语义([SWS_CRYPT_50067])。相关的错误码包括:

  • ara::crypto::CryptoErrc::kUninitializedContext:尚未为上下文分配密钥([SWS_CRYPT_50067])。
  • ara::crypto::CryptoErrc::kEmptyKeySlot:配置的 KeySlot 当前为空([SWS_CRYPT_50067])。
  • ara::crypto::CryptoErrc::kUsageViolation:密钥的权限不允许数据解密([SWS_CRYPT_50067])。
  • ara::crypto::CryptoErrc::kIncompatibleObject:密钥类型与转换不兼容([SWS_CRYPT_50067])。
  • ara::crypto::CryptoErrc::kBusyResource:所需资源被占用([SWS_CRYPT_50067])。
  • ara::crypto::CryptoErrc::kUnsupported:上下文不支持流式处理([SWS_CRYPT_50067])。

在整个系统中,该方法对应于自适应加密上下文的标准生命周期,类似于签名验证([SWS_CRYPT_50019])、签名生成([SWS_CRYPT_50037])或 MAC 计算([SWS_CRYPT_22111])中所使用的生命周期。解释:可能必须在进一步的处理步骤之前调用 Start,以使解密器处于定义的初始状态。 问题 Q-7d5a95305eb4626a (未决)

本文由 AI 基于 AUTOSAR 规范 R25-11 生成。

实现者指南即将推出(复杂度 I1)

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

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics if the context was not initialized by deploying a key
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 kAllowData Decryption
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if type of the key is incompatible to the transformation
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if stream processing is not supported by the context

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50067
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50067@rel:R25-11#2806db3f
Content hash
2806db3f
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50067
Status: valid/unmigrated Version: rel:R25-11#0df0233a 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_50067@rel:R25-11#0df0233a
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

函数 Update [SWS_CRYPT_50158] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > Update (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;

Decrypt a data buffer.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 8e10846a241b 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

方法Update用于在ara::crypto::cryp::DecryptorPrivateCtx的上下文中解密数据缓冲区[SWS_CRYPT_50158]。该同步调用在参数in(ReadOnlyMemRegion)中接收密文分段,并将解密后的数据写入缓冲区out(ReadWriteMemRegion)[SWS_CRYPT_50158]。作为结果返回一个ara::core::Result<std::size_t>,其中包含实际写入的字节数;该值可能小于out的总容量[SWS_CRYPT_50158]。

交互与缓冲区大小确定

在执行Update之前,必须强制通过调用Start()来启动数据处理[SWS_CRYPT_50158]。out所需的最小大小可通过GetRequiredOutputBufferSize()查询[SWS_CRYPT_50158]。此外,单次Update调用可处理的最大输入大小可通过GetMaximumChunkSize()确定[SWS_CRYPT_50071]。

错误处理与并发

该接口被指定为线程安全且异常安全[SWS_CRYPT_50158]。所有故障情况均具备回滚语义,并在ara::core::Result中返回特定错误代码[SWS_CRYPT_50158]:

  • ara::crypto::CryptoErrc::kProcessingNotStarted:处理此前未通过Start()启动[SWS_CRYPT_50158]。
  • ara::crypto::CryptoErrc::kInsufficientCapacity:输出缓冲区out尺寸过小[SWS_CRYPT_50158]。
  • ara::crypto::CryptoErrc::kInvalidInputSize:传入的输入缓冲区大小无效[SWS_CRYPT_50158]。
  • ara::crypto::CryptoErrc::kUnsupported:上下文不支持流处理[SWS_CRYPT_50158]。

本使用说明基于规范自动生成。

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

Parameter (in)

ParameterBeschreibung
inan input data buffer containing a part of the ciphertext

Parameter (out)

ParameterBeschreibung
outan output data buffer that the decrypted data will be written into. The required size of this buffer can be queried using GetRequired OutputBufferSize()

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics if data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of the input buffer is invalid
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if stream processing is not supported by the context

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50158
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50158@rel:R25-11#dc97b515
Content hash
dc97b515
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50158
Status: valid/unmigrated Version: rel:R25-11#ad98aa1d 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_50158@rel:R25-11#ad98aa1d
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_50156] Upstream: RS_CRYPTO_02201

using Sptr = std::shared_ptr<DecryptorPrivateCtx>;

Smart pointer of the interface.

Header-Datei#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scopeclass ara::crypto::cryp::DecryptorPrivateCtx
SymbolSptr

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

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