类 ara::crypto::cryp::CryptoObject
[SWS_CRYPT_20500] Upstream: RS_CRYPTO_02005
class CryptoObject : public ara::crypto::Serializable {...};
A common interface for all cryptographic objects recognizable by the Crypto Provider.
用户指南人工智能生成 用作对加密对象进行线程安全检查和持久存储的通用接口。
AI 生成
未审核
模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 156a618ba987
来源
未决问题(2)
摘要 详细
用作对加密对象进行线程安全检查和持久存储的通用接口。
上下文
接口 ara::crypto::cryp::CryptoObject 构成了可由 Crypto-Provider 识别和管理的所有加密对象的通用抽象。该类继承自 ara::crypto::Serializable,并定义了基本属性,如算法识别、使用限制以及用于持久存储的机制。典型的交互方包括发起调用的应用程序、提供服务的 Crypto-Provider 以及 WriteableKeySlot 实例形式的目标存储。
生命周期
在平台内部,加密对象主要通过共享所有权进行管理。为此,该类将规范的智能指针别名 ara::crypto::cryp::CryptoObject::Sptr 定义为 std::shared_ptr<CryptoObject> [SWS_CRYPT_20501] 。具体实例应该由 Crypto-Provider 的专用工厂和加载例程实例化,并通过此指针类型提供给调用者。 问题 Q-36e2bd12d7dc8b98 (未决) 该接口声明的所有方法均被指定为线程安全和异常安全的 (exception safe, noexcept),从而确保了跨多个线程的安全并发读取和存储访问 [SWS_CRYPT_20505] , [SWS_CRYPT_50092] , [SWS_CRYPT_20517] 。一旦最后一个 Sptr 引用失效,该对象及关联密钥材料的释放就会自动进行。
使用路径
典型使用路径包括识别对象的加密属性及其随后的持久存储。首先,应用程序通过 GetAlgId() 将对象的算法标识符作为 ara::crypto::AlgIdString 查询 [SWS_CRYPT_20505] 。随后,通过 GetAllowedUsage() 确定允许的使用标志 (AllowedUsageFlags) [SWS_CRYPT_50092] ,以确保该对象已被授权用于预期的操作。为了进行持久保存,应用程序将可写的密钥槽传递给方法 Save() [SWS_CRYPT_20517] 。密钥材料及相关元数据随后保存在目标槽中,槽中原有的数据将被覆盖 [SWS_CRYPT_20517] 。
CryptoObject 的检查与持久化 应用 CryptoObject WriteableKeySlot GetAlgId() AlgIdString GetAllowedUsage() AllowedUsageFlags (kAllowPersist) Save(keyslot) 写入密钥材料和元数据 Speicherquittung Result<void>
时序图:在 KeySlot 中检查和持久化加密对象的典型流程。来源:[SWS_CRYPT_20505] , [SWS_CRYPT_50092] , [SWS_CRYPT_20517] 。
错误场景
虽然 GetAlgId() [SWS_CRYPT_20505] 和 GetAllowedUsage() [SWS_CRYPT_50092] 未标明标准化错误码并在成功时将各自结果在 ara::core::Result 中返回,但持久化操作 Save() 定义了具有强制回滚语义的具体错误条件 [SWS_CRYPT_20517] :
ara::crypto::CryptoErrc::kIncompatibleObject:当对象与传入的 WriteableKeySlot 不兼容时发生,例如因为算法标识符 (AlgId) 互不相同或密钥槽属于不同的 Crypto-Provider [SWS_CRYPT_20517] 。
ara::crypto::CryptoErrc::kUsageViolation:如果通过 GetAllowedUsage() 声明的密钥使用标志不包含持久化权限 (kAllowPersist),则发出非法使用信号 [SWS_CRYPT_50092] , [SWS_CRYPT_20517] 。
ara::crypto::CryptoErrc::kBusyResource:当底层存储资源被临时占用且操作无法立即执行时返回 [SWS_CRYPT_20517] 。
借助回滚语义,在发生上述任何错误时,WriteableKeySlot 的状态均保持完好,因此不会在存储中残留部分写入或损坏的密钥数据 [SWS_CRYPT_20517] 。
本指南基于 AUTOSAR Adaptive R25-11 规范,总结了对接口 ara::crypto::cryp::CryptoObject 的要求。
分组依据 类别 历史
成员图 类图 Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.
G
nara__crypto__cryp__CryptoObject679
CryptoObject
+ GetAlgId()
+ GetAllowedUsage()
+ Save()
nara__crypto__Serializable855
Serializable
nara__crypto__cryp__CryptoObject679->nara__crypto__Serializable855
nara__crypto__cryp__PrivateKey762
PrivateKey
nara__crypto__cryp__PrivateKey762->nara__crypto__cryp__CryptoObject679
nara__crypto__cryp__PublicKey940
PublicKey
nara__crypto__cryp__PublicKey940->nara__crypto__cryp__CryptoObject679
nara__crypto__cryp__SymmetricKey111
SymmetricKey
nara__crypto__cryp__SymmetricKey111->nara__crypto__cryp__CryptoObject679
详细视图 此版本没有元素数据
方法 The interface shall return the AlgId of this CryptoObject.
The interface shall return the allowed usage of the key.
The interface shall persistently store the key-material and its meta-data in the provided WriteableKeySlot. Data previously stored in keyslot shall be overwritten.
类型别名 Smart pointer of the interface.
点击条目以查看其关系。
基类 派生类 使用 被使用于 继承 自此版本起移除 用于 此类中无关联 函数 AI 评注 打开类页面 无法加载类页面。 调整顺序 调整宽度 调整大纲宽度 章节 阅读时间 SWS 引用 图表 放回中间 调整顺序或拖到标题栏 取消停靠 – 在内容中显示 移到中间栏 作为标签停靠到标题栏 元素 AI 模型 打开审计档案 档案 打开简短版本 打开中等版本 打开完整版本 恢复默认视图 已恢复默认视图 撤销 关闭详细视图 签名 基本信息 值 截至所选版本的最后一次更改 之后的下一次更改 单击:选择版本 无法放在此处:拖到标题栏可停靠,拖到中间栏可取消停靠。 新增 已更改 未更改 已移除 未包含 更改 内容无变化 首次出现于 移除于 没有可用的版本数据。 正在加载版本数据 … 文本 此版本未收录措辞 悬停或单击单元格:与所选版本比较 · 单击版本标题:选择版本 选择版本 属性 版本 元素 只有一个版本有措辞 PDF 中存在,原文尚未导入 首次采集原文 自 {rel} 起未更改 版本颜色 最早版本 最新版本
方法文档
virtual ara::core::Result < ara::crypto::AlgIdString > GetAlgId () const noexcept=0;
The interface shall return the AlgId of this CryptoObject.
Header-Datei #include "ara/crypto/cryp/cryobj/crypto_object.h" Scope class ara::crypto::cryp::CryptoObject Exception-Sicherheit exception safe Thread-Sicherheit thread-safe
Rückgabewert
Fehler
Fehlercode Beschreibung This function does not specify any standardized errors.
Status: valid/unmigrated
Version: rel:R25-11#974298db
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_20505@rel:R25-11#974298db
Point-in-Time History:
Release:
R25-11 (Current / Active) R20-11 R21-11 R22-11 R23-11 R24-11 R19-11
View Snapshot
Recorded Revisions (7):
R25-11 rel:R25-11#fa5364ac2026-09-30 Inspect R20-11 rel:R20-11#3073d8c92026-10-14 Inspect R21-11 rel:R21-11#3073d8c92026-10-14 Inspect R22-11 rel:R22-11#131cf8662026-10-14 Inspect R23-11 rel:R23-11#b34bd5a42026-10-14 Inspect R24-11 rel:R24-11#36c55a302026-10-14 Inspect R25-11 rel:R25-11#974298db2026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
virtual ara::core::Result < AllowedUsageFlags > GetAllowedUsage () const noexcept=0;
The interface shall return the allowed usage of the key.
Header-Datei #include "ara/crypto/cryp/cryobj/crypto_object.h" Scope class ara::crypto::cryp::CryptoObject Exception-Sicherheit exception safe Thread-Sicherheit thread-safe
Rückgabewert
Typ Beschreibung ara::core::Result <AllowedUsageFlags >A result containing the allowed usage of the key
Fehler
Fehlercode Beschreibung This function does not specify any standardized errors.
Status: valid/unmigrated
Version: rel:R25-11#eb9b3394
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_50092@rel:R25-11#eb9b3394
Point-in-Time History:
Release:
R25-11 (Current / Active) R20-11 R19-11
View Snapshot
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
virtual ara::core::Result < void > Save (WriteableKeySlot ::Sptr keyslot) const noexcept=0;
The interface shall persistently store the key-material and its meta-data in the provided WriteableKeySlot. Data previously stored in keyslot shall be overwritten.
用户指南
AI 生成
未审核
模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 0aae854cf6a9
来源
本使用说明由 AI 基于 AUTOSAR R25-11 规范生成。
实现者指南即将推出(复杂度 I1)
Header-Datei #include "ara/crypto/cryp/cryobj/crypto_object.h" Scope class ara::crypto::cryp::CryptoObject Exception-Sicherheit exception safe Thread-Sicherheit thread-safe
Parameter (in)
Parameter Beschreibung keyslot KeySlot representing the underlying storage
Rückgabewert
Fehler
Status: valid/unmigrated
Version: rel:R25-11#27ad83e4
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_20517@rel:R25-11#27ad83e4
Point-in-Time History:
Release:
R25-11 (Current / Active) R19-11 R20-11 R21-11 R22-11 R23-11 R24-11
View Snapshot
Recorded Revisions (8):
R25-11 rel:R25-11#401495a62026-09-30 Inspect R19-11 rel:R19-11#12df20182026-10-14 Inspect R20-11 rel:R20-11#74dce1282026-10-14 Inspect R21-11 rel:R21-11#9fdecde72026-10-14 Inspect R22-11 rel:R22-11#4e577c772026-10-14 Inspect R23-11 rel:R23-11#302bac292026-10-14 Inspect R24-11 rel:R24-11#7745263b2026-10-14 Inspect R25-11 rel:R25-11#27ad83e42026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
类型别名文档
using Sptr = std::shared_ptr <CryptoObject >;
Smart pointer of the interface.
Status: valid/unmigrated
Version: rel:R25-11#4816c7c1
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_20501@rel:R25-11#4816c7c1
Point-in-Time History:
Release:
R25-11 (Current / Active) R19-11 R20-11 R21-11 R22-11 R23-11 R24-11
View Snapshot
Recorded Revisions (8):
R25-11 rel:R25-11#2f0be81f2026-09-30 Inspect R19-11 rel:R19-11#b83af8272026-10-14 Inspect R20-11 rel:R20-11#eb73b7d72026-10-14 Inspect R21-11 rel:R21-11#eb73b7d72026-10-14 Inspect R22-11 rel:R22-11#cc06a6ac2026-10-14 Inspect R23-11 rel:R23-11#0db32e6b2026-10-14 Inspect R24-11 rel:R24-11#0db32e6b2026-10-14 Inspect R25-11 rel:R25-11#4816c7c12026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically 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 · 德文原文