DEENESPTFRRUARHIKOZHNL

类 ara::crypto::x509::X509DN

[SWS_CRYPT_40400] Upstream: RS_CRYPTO_02306

class X509DN : public ara::crypto::Serializable {...};

Interface of X.509 Distinguished Name (DN).

Header-Datei#include "ara/crypto/x509/x509_dn.h"
Forwarding-Header#include "ara/crypto/crypto_fwd.h"
Scopenamespace ara::crypto::x509
Basisklasse(n)ara::crypto::Serializable

用户指南人工智能生成

封装 X.509 Distinguished Name 并将其格式化输出为 RFC 4514 字符串。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: d02e57b4256c 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

封装 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

方法

ToString 函数

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.

virtual ara::core::Result< ara::core::String > ToString () const noexcept=0;

类型别名

Sptrc 类型别名

Const shared smart pointer of the interface.

using Sptrc = std::shared_ptr<const X509DN>;

方法文档

函数 ToString [SWS_CRYPT_40411] Upstream: RS_CRYPTO_02306

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 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

接口 ara::crypto::x509::X509DN 的纯虚方法 ToString 根据 RFC 4514 将完整的可分辨名称(DN)导出为单个格式化字符串 [SWS_CRYPT_40411]。如果 DN 包含非标准化属性,则在字符串中对这些属性使用其对象标识符(OID)代替名称 [SWS_CRYPT_40411]。要使用该函数,必须包含头文件 ara/crypto/x509/x509_dn.h [SWS_CRYPT_40411]。

该调用在常量实例上以同步且无参数的方式执行。ara::core::Result<ara::core::String> 用作返回类型,在成功情况下它提供可分辨名称的完整字符串表示 [SWS_CRYPT_40411]。规范中未为此函数定义特定或标准化的错误码 [SWS_CRYPT_40411]。

对于并发运行环境中的使用,ToString 被归类为线程安全(thread-safe)[SWS_CRYPT_40411]。此外,它还具有异常安全性(exception safe),这由函数签名的 noexcept 规范所支持,从而排除了 C++ 异常的发生 [SWS_CRYPT_40411]。

本使用说明基于 AUTOSAR 规范自动创建。

Header-Datei#include "ara/crypto/x509/x509_dn.h"
Scopeclass ara::crypto::x509::X509DN
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
ara::core::Result<ara::core::String >String of the whole DN string

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_40411
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_40411@rel:R25-11#b315a27d
Content hash
b315a27d
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_40411
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:
Recorded Revisions (8):
  • R25-11rel:R25-11#0a4f449c2026-09-30
  • R19-11rel:R19-11#aa7783f22026-10-14
  • R20-11rel:R20-11#107617f62026-10-14
  • R21-11rel:R21-11#ffe162c32026-10-14
  • R22-11rel:R22-11#c6c8fcc72026-10-14
  • R23-11rel:R23-11#8b07ee3d2026-10-14
  • R24-11rel:R24-11#d26b8a3b2026-10-14
  • R25-11rel:R25-11#027bb18b2026-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

类型别名文档

类型别名 Sptrc [SWS_CRYPT_40401] Upstream: RS_CRYPTO_02306

using Sptrc = std::shared_ptr<const X509DN>;

Const shared smart pointer of the interface.

Header-Datei#include "ara/crypto/x509/x509_dn.h"
Scopeclass ara::crypto::x509::X509DN
SymbolSptrc

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

Record
AUTOSAR/AP/record/SWS_CRYPT_40401
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_40401@rel:R25-11#72514bfa
Content hash
72514bfa
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_40401
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:
Recorded Revisions (8):
  • R25-11rel:R25-11#0b636ab72026-09-30
  • R19-11rel:R19-11#ced209c92026-10-14
  • R20-11rel:R20-11#202479662026-10-14
  • R21-11rel:R21-11#202479662026-10-14
  • R22-11rel:R22-11#c65923232026-10-14
  • R23-11rel:R23-11#7df124232026-10-14
  • R24-11rel:R24-11#7df124232026-10-14
  • R25-11rel:R25-11#a001dc442026-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