类 ara::crypto::x509::X509DN
[SWS_CRYPT_40400] Upstream: RS_CRYPTO_02306
class X509DN : public ara::crypto::Serializable {...};
Interface of X.509 Distinguished Name (DN).
用户指南人工智能生成 封装 X.509 Distinguished Name 并将其格式化输出为 RFC 4514 字符串。
AI 生成
未审核
模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: d02e57b4256c
来源
未决问题(2)
摘要 详细
封装 X.509 Distinguished Name 并将其格式化输出为 RFC 4514 字符串。
接口 ara::crypto::x509::X509DN 用于在加密模块内将 X.509 Distinguished Name 封装并作为可序列化数据结构提供。通过别名 Sptrc,将实例的共享且不可变的所有权实现为 std::shared_ptr<const X509DN> [SWS_CRYPT_40401] 。核心方法 ToString() 根据 RFC 4514 格式化完整名称,并且具有线程安全性且无标准化错误码 [SWS_CRYPT_40411] 。调用方接收 ara::core::Result<ara::core::String> 作为结果,在进一步处理之前必须检查其有效性。
更多 ›
上下文
抽象接口 ara::crypto::x509::X509DN 在 AUTOSAR Adaptive Platform 的 crypto 模块中表示符合 X.509 标准的 Distinguished Name(DN)。通过继承自 ara::crypto::Serializable,该类作为可序列化的加密数据结构嵌入到类型层次结构中。该接口的主要任务是在软件侧封装证书、证书持有者(Subject)或证书颁发者(Issuer)的名称结构。其中,提供标准化的文本表示占据核心地位:根据 [SWS_CRYPT_40411] ,方法 ToString() 将完整的 Distinguished Name 按照 RFC 4514 规范导出为字符串。如果底层的 Distinguished Name 包含非标准属性,则针对这些属性采用相应的 Object Identifier(OID)[SWS_CRYPT_40411] 。
生命周期
由于 ara::crypto::x509::X509DN 是具有如 ToString() 等纯虚方法的抽象 C++ 接口,因此不能由应用开发人员直接实例化。负载未指定公共构造函数;具体实例的创建大概率由加密子系统的上层组件或证书解析器进行。 问题 Q-108d7589869c7370 (未决)
为了实现共享和持久访问,该接口定义了类型说明符 Sptrc 作为 std::shared_ptr<const X509DN> [SWS_CRYPT_40401] 的别名。使用常量共享指针(const shared pointer)凸显了所有权与访问设计概念:X509DN 的实例对外是不可变的(immutable)。多个使用者可以安全且无状态地共享同一个专有名称(Distinguished Name)的表示形式,而无需在读访问时产生同步开销。在并发方面,核心方法 ToString() 被明确声明为线程安全(thread-safe)[SWS_CRYPT_40411] 。因此,通过同一共享指针或跨不同线程进行并发调用均无需外部锁即可允许执行。此外,该规范保证了此调用具有完全的异常安全性(exception safe)[SWS_CRYPT_40411] 。
使用路径
典型的使用路径聚焦于读取并进一步处理格式化后的专有名称,以用于日志记录、身份验证或身份校验。应用程序通常会接收一个 ara::crypto::x509::X509DN::Sptrc 类型的指针 [SWS_CRYPT_40401] 。
在该实例上,调用方执行方法 ToString() [SWS_CRYPT_40411] 。该调用为 noexcept 并返回一个 ara::core::Result<ara::core::String> [SWS_CRYPT_40411] 。评估成功时,该 Result 对象包含根据 RFC 4514 格式化的字符串,例如采用标准化的属性值对形式(如 CN=...),或在专有属性中使用 OID [SWS_CRYPT_40411] 。应用程序随后可以提取生成的字符串,并将其进一步用于特定于应用程序的校验、比对或审计日志。
错误场景
在与 ara::crypto::x509::X509DN 交互时,错误处理体现出清晰且极简的设计。尽管 ToString() 使用了返回值类型 ara::core::Result<ara::core::String>,但规范明确规定该函数不定义标准化的错误代码 [SWS_CRYPT_40411] 。这意味着在常规规范上下文中,并未针对序列化过程预设任何业务层面的拒绝原因或校验错误。
由于该函数还被指定为 noexcept 且具有异常安全性(exception safe)[SWS_CRYPT_40411] ,因此排除了同步 C++ 异常。如果返回的 ara::core::Result 内部仍然出现错误状态,则推测可能是由于平台或实现特定的原因所致,例如在分配结果字符串时出现内存不足。 问题 Q-10477dd7d77e3b78 (未决) 因此,调用方在解包该值之前必须始终检查 Result 是包含有效值还是错误,即使 AUTOSAR 未为此提供特定于领域的错误常量。
本指南基于针对 Adaptive Platform 的 AUTOSAR 规范(版本 R25-11,模块 crypto)自动生成。
UML 类图 Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.
G
nara__crypto__x509__X509DN930
X509DN
+ ToString()
nara__crypto__Serializable855
Serializable
nara__crypto__x509__X509DN930->nara__crypto__Serializable855
此版本没有元素数据
方法 Get the whole Distinguished Name (DN) as a single string according to RFC 4514. If the DN contains unstandardized attributes, the attribute’s OID is used.
类型别名 Const shared smart pointer of the interface.
方法文档
virtual ara::core::Result < ara::core::String > ToString () const noexcept=0;
Get the whole Distinguished Name (DN) as a single string according to RFC 4514. If the DN contains unstandardized attributes, the attribute’s OID is used.
用户指南
AI 生成
未审核
模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: d8ee80e25da6
来源
本使用说明基于 AUTOSAR 规范自动创建。
Header-Datei #include "ara/crypto/x509/x509_dn.h" Scope class ara::crypto::x509::X509DN 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#027bb18b
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_40411@rel:R25-11#027bb18b
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#0a4f449c2026-09-30 Inspect R19-11 rel:R19-11#aa7783f22026-10-14 Inspect R20-11 rel:R20-11#107617f62026-10-14 Inspect R21-11 rel:R21-11#ffe162c32026-10-14 Inspect R22-11 rel:R22-11#c6c8fcc72026-10-14 Inspect R23-11 rel:R23-11#8b07ee3d2026-10-14 Inspect R24-11 rel:R24-11#d26b8a3b2026-10-14 Inspect R25-11 rel:R25-11#027bb18b2026-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 Sptrc = std::shared_ptr <const X509DN >;
Const shared smart pointer of the interface.
Status: valid/unmigrated
Version: rel:R25-11#a001dc44
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_40401@rel:R25-11#a001dc44
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#0b636ab72026-09-30 Inspect R19-11 rel:R19-11#ced209c92026-10-14 Inspect R20-11 rel:R20-11#202479662026-10-14 Inspect R21-11 rel:R21-11#202479662026-10-14 Inspect R22-11 rel:R22-11#c65923232026-10-14 Inspect R23-11 rel:R23-11#7df124232026-10-14 Inspect R24-11 rel:R24-11#7df124232026-10-14 Inspect R25-11 rel:R25-11#a001dc442026-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 · 德文原文