DEENESPTFRRUARHIKOZHNL

类 ara::crypto::cryp::WriteableKeySlot

[SWS_CRYPT_50166] Upstream: RS_CRYPTO_02405

class WriteableKeySlot :             public KeySlot {...};

WriteableKeySlot interface representing a writeable storage location for a key in a Crypto Provider.

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

用户指南人工智能生成

用作用于在 Crypto-Provider 中管理和安全擦除密钥的可写接口。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 5dc02afa7972 来源 未决问题(3)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用作用于在 Crypto-Provider 中管理和安全擦除密钥的可写接口。

接口 ara::crypto::cryp::WriteableKeySlot 在 AUTOSAR Adaptive 中用作 Crypto-Provider 中密钥存储位置的可写抽象。实例既不能复制也不能移动([SWS_CRYPT_50170]、[SWS_CRYPT_50168]),而是通过智能指针类型 Sptr 进行引用 [SWS_CRYPT_50172]。通过线程安全的方法 Clear() 清理密钥槽的内容,其中在发生错误(如 kBusyResource 或 kUnsupported)时采用回滚语义 [SWS_CRYPT_30405]。

上下文

接口 ara::crypto::cryp::WriteableKeySlot 在 AUTOSAR Adaptive Platform 内定义了 Crypto-Provider 上下文中加密密钥的可写存储槽。它直接派生自基接口 KeySlot,并提供了一个标准化抽象,用于有针对性地清理受管理的密钥槽并控制其生命周期。加密栈的应用程序作为使用者以及管理与物理或逻辑密钥存储绑定的具体 Crypto-Provider 充当主要交互伙伴。具体实例的创建可能通过上层工厂或提供程序方法进行,因为该接口充当纯抽象基类。 问题 Q-5c3b13bb35c3ff53 (未决)

生命周期

ara::crypto::cryp::WriteableKeySlot 的资源和所有权模型严格防止通过值语义复制密钥引用。为此,复制构造函数 [SWS_CRYPT_50170] 和移动构造函数 [SWS_CRYPT_50171] 均被显式删除(=delete)。同样,复制赋值运算符 [SWS_CRYPT_50168] 和移动赋值运算符 [SWS_CRYPT_50169] 的已删除声明阻止了任何后续赋值。

引用传递和共享管理则通过定义的智能指针类型别名 Sptr 进行,该别名被具体化为 std::shared_ptr<WriteableKeySlot> [SWS_CRYPT_50172]。实例的销毁由默认虚析构函数保障,该析构函数被指定为异常安全(exception safe)且不抛出异常(noexcept=default)[SWS_CRYPT_50167]。这允许通过指向接口的指针进行安全的多态释放。在状态方面,槽可以是占用的或空的。槽的占用可能通过 Crypto-Provider 的单独接口进行,而清空则通过线程安全方法 Clear() 实现 [SWS_CRYPT_30405]。 问题 Q-72dfcb17eb3e2d25 (未决)

keyslot_zustand Leer Leer Leer->Leer Clear() [已为空] Leer->Leer Clear() [kBusyResource / kUnsupported] Belegt Belegt Belegt->Leer Clear() [Erfolg] Belegt->Belegt Clear() [kBusyResource / kUnsupported]

状态图:通过 Clear() 进行的密钥内容状态转换及错误处理。来源:[SWS_CRYPT_30405]

使用路径

核心使用路径集中在对所存储密钥材料的受控重置或擦除上:

  • 引用:调用方通过类型为 WriteableKeySlot::Sptr 的共享指针访问实例 [SWS_CRYPT_50172]。
  • 擦除调用:通过调用纯虚方法 Clear(),触发密钥槽当前内容的擦除过程 [SWS_CRYPT_30405]。由于该方法是线程安全的,因此该调用也可以在并发上下文中进行 [SWS_CRYPT_30405]。
  • 结果检查:该操作返回一个 ara::core::Result<void> [SWS_CRYPT_30405]。如果密钥槽此前已为空或内容已被无误移除,则结果表示带有空值的成功状态 [SWS_CRYPT_30405]。

错误场景

方法 Clear() 被声明为异常安全且为 noexcept;根据 AUTOSAR Adaptive 的错误模型,错误情况通过 ara::core::Result 传递 [SWS_CRYPT_30405]。可能的错误码包括:

  • ara::crypto::CryptoErrc::kUnsupported:当密钥槽的具体实现不支持擦除时发生 [SWS_CRYPT_30405]。对于这种情况,该接口保证回滚语义,从而使状态保持不变 [SWS_CRYPT_30405]。
  • ara::crypto::CryptoErrc::kBusyResource:如果擦除操作暂时无法执行,则返回此错误 [SWS_CRYPT_30405]。这通常可能是由对绑定硬件的存储资源的并发访问引起的。 问题 (未决)在此,回滚语义同样确保不会留下局部修改 [SWS_CRYPT_30405]。

本指南基于针对 crypto 模块的 AUTOSAR Adaptive 规范 R25-11,并且是自动生成的。

成员图

构造函数和析构函数

2

方法

1

运算符

1

类型别名

1

类图

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

G nara__crypto__cryp__WriteableKeySlot529 WriteableKeySlot + WriteableKeySlot() + operator=() + ~WriteableKeySlot() + Clear() nara__crypto__cryp__KeySlot637 KeySlot nara__crypto__cryp__WriteableKeySlot529->nara__crypto__cryp__KeySlot637

详细视图

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

构造函数和析构函数

Copy-Constructor.

重载 WriteableKeySlot 2
WriteableKeySlot (const WriteableKeySlot &)=delete; SWS_CRYPT_50170
WriteableKeySlot (WriteableKeySlot &&)=delete; SWS_CRYPT_50171

Destructor.

virtual ~WriteableKeySlot () noexcept=default;

方法

Clear 函数

The interface shall delete the current content of the KeySlot.

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

运算符

operator= 函数 2

Copy-assign another WriteableKeySlot to this instance.

重载 = 2
WriteableKeySlot & operator= (const WriteableKeySlot &other)=delete; SWS_CRYPT_50168
WriteableKeySlot & operator= (WriteableKeySlot &&other)=delete; SWS_CRYPT_50169

类型别名

Sptr 类型别名

Smart pointer of the interface.

方法文档

函数 Clear [SWS_CRYPT_30405] Upstream: RS_CRYPTO_02009

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

The interface shall delete the current content of the KeySlot.

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

用法与语义

接口 ara::crypto::cryp::WriteableKeySlot 的方法 Clear() 用于擦除所引用密钥存储的当前内容 [SWS_CRYPT_30405]。该函数通过头文件 ara/crypto/cryp/writeable_keyslot.h 声明,作为无参数的常量操作调用 [SWS_CRYPT_30405]。当 KeySlot 成功清空或在调用前已为空时,它同步返回空的 ara::core::Result<void> [SWS_CRYPT_30405]。

错误处理与并发

该接口定义为 noexcept,并在并发调用时保证异常安全性和线程安全性 [SWS_CRYPT_30405]。发生错误时,回滚语义生效,使 KeySlot 的状态保持不变 [SWS_CRYPT_30405]。结果中可能出现以下错误码 [SWS_CRYPT_30405]:

  • ara::crypto::CryptoErrc::kUnsupported:在具体 KeySlot 不支持擦除时发生,具有回滚语义 [SWS_CRYPT_30405]。
  • ara::crypto::CryptoErrc::kBusyResource:在操作因资源临时被占用而当前无法执行时报告 [SWS_CRYPT_30405]。

相互作用

该函数直接作用于 ara::crypto::cryp::WriteableKeySlot 的实例以清理加密密钥 [SWS_CRYPT_30405]。与之区分的是 ara::crypto::x509::X509Provider 中的证书管理,其中证书槽位的清理是通过方法 ClearCertificateSlot() 在指定 InstanceSpecifier 的情况下进行的 [SWS_CRYPT_40622]。

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

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

Rückgabewert

TypBeschreibung
ara::core::Result< void >an empty result if the keyslot was already empty or successfully cleared

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the KeySlot does not support clearing
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics if the operation temporarily cannot be performed

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

Record
AUTOSAR/AP/record/SWS_CRYPT_30405
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_30405@rel:R25-11#741b1af8
Content hash
741b1af8
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_30405
Status: valid/unmigrated Version: rel:R25-11#f254660d 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_30405@rel:R25-11#f254660d
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#3b03ed2b2026-09-30
  • R20-11rel:R20-11#9d3696442026-10-14
  • R21-11rel:R21-11#bda76d622026-10-14
  • R22-11rel:R22-11#006988182026-10-14
  • R23-11rel:R23-11#e7cea4b12026-10-14
  • R24-11rel:R24-11#490dfcff2026-10-14
  • R25-11rel:R25-11#f254660d2026-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

函数 WriteableKeySlot [SWS_CRYPT_50170] Upstream: RS_CRYPTO_02004

WriteableKeySlot (const WriteableKeySlot &)=delete;

Copy-Constructor.

Header-Datei#include "ara/crypto/cryp/writeable_keyslot.h"
Scopeclass ara::crypto::cryp::WriteableKeySlot

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50170
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50170@rel:R25-11#8147cb2f
Content hash
8147cb2f
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50170
Status: valid/unmigrated Version: rel:R25-11#9a69e3b3 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_50170@rel:R25-11#9a69e3b3
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

函数 WriteableKeySlot [SWS_CRYPT_50171] Upstream: RS_CRYPTO_02004

WriteableKeySlot (WriteableKeySlot &&)=delete;

Move-Constructor.

Header-Datei#include "ara/crypto/cryp/writeable_keyslot.h"
Scopeclass ara::crypto::cryp::WriteableKeySlot

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

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

函数 operator= [SWS_CRYPT_50168] Upstream: RS_CRYPTO_02004

WriteableKeySlot & operator= (const WriteableKeySlot &other)=delete;

Copy-assign another WriteableKeySlot to this instance.

Header-Datei#include "ara/crypto/cryp/writeable_keyslot.h"
Scopeclass ara::crypto::cryp::WriteableKeySlot

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

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

函数 operator= [SWS_CRYPT_50169] Upstream: RS_CRYPTO_02004

WriteableKeySlot & operator= (WriteableKeySlot &&other)=delete;

Move-assign another WriteableKeySlot to this instance.

Header-Datei#include "ara/crypto/cryp/writeable_keyslot.h"
Scopeclass ara::crypto::cryp::WriteableKeySlot

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

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

函数 ~WriteableKeySlot [SWS_CRYPT_50167] Upstream: RS_CRYPTO_02405

virtual ~WriteableKeySlot () noexcept=default;

Destructor.

Header-Datei#include "ara/crypto/cryp/writeable_keyslot.h"
Scopeclass ara::crypto::cryp::WriteableKeySlot
Exception-Sicherheitexception safe

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50167
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50167@rel:R25-11#a8a98d70
Content hash
a8a98d70
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50167
Status: valid/unmigrated Version: rel:R25-11#651255bc 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_50167@rel:R25-11#651255bc
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_50172] Upstream: RS_CRYPTO_02405

using Sptr = std::shared_ptr<WriteableKeySlot>;

Smart pointer of the interface.

Header-Datei#include "ara/crypto/cryp/writeable_keyslot.h"
Scopeclass ara::crypto::cryp::WriteableKeySlot
SymbolSptr

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

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