DEENESPTFRRUARHIKOZHNL

类 ara::crypto::x509::CertificateValidationCtx

[SWS_CRYPT_50115] Upstream: RS_CRYPTO_02205

class CertificateValidationCtx {...};

Certificate Validation Context.

Header-Datei#include "ara/crypto/x509/certificate_validation_ctx.h"
Forwarding-Header#include "ara/crypto/crypto_fwd.h"
Scopenamespace ara::crypto::x509

用户指南人工智能生成

用于基于配置的信任锚对 X.509 证书和证书链进行路径验证。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: aa16fb2bd5c5 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用于基于配置的信任锚对 X.509 证书和证书链进行路径验证。

类 ara::crypto::x509::CertificateValidationCtx 用于根据 RFC 5280 验证 X.509 证书和完整证书链([SWS_CRYPT_50122])。在执行之前,应用程序通过添加信任锚、可选的中间证书、检查时间点以及检查选项来配置上下文,并在需要时集成用于吊销检查的 OCSP 响应([SWS_CRYPT_50117])。如果注册了 OCSP 响应,则验证选项必须强制定义相应的 OCSP 行为,以避免路径检查期间的不兼容错误。所有接口方法均具备异常安全性,并针对并发访问设计。

上下文

类 ara::crypto::x509::CertificateValidationCtx 定义了根据 RFC 5280 验证 X.509 证书和证书链的标准化接口([SWS_CRYPT_50122],[SWS_CRYPT_50123])。在 AUTOSAR Adaptive Platform 的整个系统中,它承担着证明信任关系、验证证书路径以及在加密证书用于安全关系之前确定其状态的任务。

调用方应用程序作为核心交互伙伴,为上下文提供信任锚([SWS_CRYPT_50117])、不可信的中间证书([SWS_CRYPT_50118])以及采用 OCSP 响应形式的吊销信息([SWS_CRYPT_50124])。验证结果作为 CertificateValidationResult([SWS_CRYPT_50122])提供。

CertificateValidationCtxKontext Anwendung Anwendung CertificateValidationCtx CertificateValidationCtx Anwendung->CertificateValidationCtx 配置并控制 CertificateValidationResult CertificateValidationResult CertificateValidationCtx->CertificateValidationResult 提供检查结果 Certificate Certificate Certificate->CertificateValidationCtx 用作信任锚点或被检对象 OcspResponse OcspResponse OcspResponse->CertificateValidationCtx 提供吊销状态

上下文图:CertificateValidationCtx 在应用程序、输入证书、吊销检查与结果对象之间的集成。来源:[SWS_CRYPT_50117],[SWS_CRYPT_50122],[SWS_CRYPT_50124]。

生命周期

该接口的实例通过类型别名 Sptr([SWS_CRYPT_50116])作为 std::shared_ptr<CertificateValidationCtx> 进行管理,这实现了使用该接口的软件组件的共享所有权和灵活的生命周期控制。由于它是一个纯虚接口类,因此不存在公共构造函数;具体上下文实例的创建推测可能通过加密栈的提供程序实现的相应创建函数来完成。 问题 Q-6ac4ee6766e22994 (未决)

在并发性方面,所有虚成员函数均被指定为线程安全(thread-safe)([SWS_CRYPT_50117],[SWS_CRYPT_50120],[SWS_CRYPT_50122])。此外,所有方法均保证异常安全(exception safe),并声明为 noexcept([SWS_CRYPT_50117],[SWS_CRYPT_50122])。在状态方面,上下文表现为一个可配置的累加器:它接收检查参数、证书和状态响应,并将其保留用于验证步骤。

使用路径

验证上下文的典型用法分为由配置步骤和随后的验证执行构成的结构化序列:

  1. 存储信任锚:通过 AddTrustedCertificate([SWS_CRYPT_50117])添加一个或多个受信任的证书作为路径验证的起点。额外的不可信中间证书可以通过 AddUntrustedCertificate([SWS_CRYPT_50118])提供。
  2. 配置验证规则和参考时间:通过 SetValidationOptions([SWS_CRYPT_50120])传递一个位掩码以控制检查行为。使用 SetCurrentTime([SWS_CRYPT_50121])可以为有效性检查定义显式的时间点;如果省略此调用,上下文将自动采用系统时间([SWS_CRYPT_50121])。如果要从检查中排除特定的不受支持的关键扩展,则可以通过 IgnoreCriticalExtension([SWS_CRYPT_50119])注册其 OID。如果设置了选项 kIgnoreUnknownCriticalExtensions,则此操作无效([SWS_CRYPT_50119])。
  3. 补充吊销信息:可以通过 AddOcspResponse([SWS_CRYPT_50124])添加一个或多个 OCSP 响应。OCSP 响应的颁发者必须此前已作为证书存储在上下文中、具有同一 CA 的扩展密钥用法属性 id-kp-OCSPSigning,或者通过可选参数 trustedOcspIssuerCertificate 传递([SWS_CRYPT_50124])。
  4. 执行验证:ValidateCertificate([SWS_CRYPT_50122])用于检查目标证书。或者,ValidateCertificateChain([SWS_CRYPT_50123])验证有序证书链,从位置 0 处的叶证书开始。在此过程中,先前通过 AddUntrustedCertificate 注册的证书将被忽略,仅针对受信任证书检查所传递的链([SWS_CRYPT_50123])。
证书验证流程应用CertificateValidationCtxAddTrustedCertificate(caCert)Result<void>SetValidationOptions(options)Result<void>optOCSP 检查AddOcspResponse(ocspResp, issuerCert)Result<CertificateValidationStatus>ValidateCertificate(targetCert)Result<CertificateValidationResult::Sptrc>

时序图:用于配置和验证证书的典型调用顺序。来源:[SWS_CRYPT_50117],[SWS_CRYPT_50120],[SWS_CRYPT_50122],[SWS_CRYPT_50124]。

错误场景

错误处理通过 ara::core::Result 一致进行,不使用 C++ 异常:

  • 无效的配置选项:如果使用非法的位掩码调用 SetValidationOptions,则调用失败并返回具有回滚语义的错误代码 ara::crypto::CryptoErrc::kInvalidArgument([SWS_CRYPT_50120])。
  • 相互矛盾的 OCSP 配置:如果已通过 AddOcspResponse 存储了至少一个 OCSP 响应,而未在 CertificateValidationOptions 中指定 OCSP 的行为,则 ValidateCertificate([SWS_CRYPT_50122])和 ValidateCertificateChain([SWS_CRYPT_50123])均返回具有回滚语义的错误 ara::crypto::CryptoErrc::kIncompatibleArguments。
  • OCSP 验证失败:如果在 AddOcspResponse([SWS_CRYPT_50124])中无法根据定义的准则验证 OCSP 响应的签名或来源,则该函数返回相应的状态码 CertificateValidationStatus 或特定于实现的错误,而不是 kValid。
  • 特定于实现的错误:如果加密库发生内部问题,诸如 AddTrustedCertificate([SWS_CRYPT_50117])或 IgnoreCriticalExtension([SWS_CRYPT_50119])之类的方法可能会在结果对象中报告特定于实现的错误代码。

本指南基于 AUTOSAR Adaptive Platform R25-11 规范的要求。

成员图

类图

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

G nara__crypto__x509__CertificateValidationCtx565 CertificateValidationCtx + AddOcspResponse() + AddTrustedCertificate() + AddUntrustedCertificate() + IgnoreCriticalExtension() + SetCurrentTime() + SetValidationOptions() + ValidateCertificate() + ValidateCertificateChain()

详细视图

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

方法

Validate and add an OCSP response to be used during certificate validation to the set of previously added OCSP responses. Multiple OCSP responses may be added to one context. In order to validate the OCSP response, the issuer of the OCSP response must have been a) set as a trusted or untrusted certificate in this context previously, or b) the CRL must have been signed by another certificate that has the id-kp-OCSPSigning extended key usage set issued by the same CA, or c) the CRL must be signed by a trusted CA passed to this function using the optional trustedOcspIssuerCertificate parameter.

virtual ara::core::Result< CertificateValidationStatus > AddOcsp Response (OcspResponse::Sptrc ocspResponse, ara::core::Optional< Certificate::Sptrc > trustedOcspIssuerCertificate) noexcept=0;

Add a trusted certificates to be used during certificate path validation to the set of previously added trusted certificates.

virtual ara::core::Result< void > AddTrustedCertificate ( Certificate::Sptrc trustedCertificate) noexcept=0;

Add an untrusted certificate to be used during certificate path validation to the set of previously added untrusted certificates.

virtual ara::core::Result< void > AddUntrustedCertificate ( Certificate::Sptrc untrustedCertificate) noexcept=0;

Configure the context to ignore an extension during validation of certificates and OCSP responses, even if the extension is marked as critical and the validation context does not support the extension. It is the responsibility of the application to validate such extensions. Multiple invocations of this function lead to ignoring all passed extensions. This function has no effect if the kIgnoreUnknownCriticalExtensions validation option is set.

virtual ara::core::Result< void > IgnoreCriticalExtension (ara::core::StringView ignoredExtensionOid) noexcept=0;

Set the reference time point to be used as the current time during certificate validation. If this function is not called, the system time will be used during certificate validation.

virtual ara::core::Result< void > SetCurrentTime (Timestamp current Time) noexcept=0;

Set validation options to be used during certificate validation.

virtual ara::core::Result< void > SetValidationOptions (Certificate ValidationOptions CertificateValidationOptions) noexcept=0;

Performs certificate path validation according to RFC 5280 and according to the previous configuration of the context.

virtual ara::core::Result< CertificateValidationResult::Sptrc > ValidateCertificate (Certificate::Sptrc certificate) noexcept=0;

Performs certificate path validation according to RFC 5280 and according to the previous configuration of the context. The function ignores any certificates added to the context via Add UntrustedCertificate. Instead, the function validates the provided chain against any trusted certificate that has been set using the function AddTrustedCertificate.

virtual ara::core::Result< CertificateValidationResult::Sptrc > ValidateCertificateChain (const ara::core::Span< Certificate::Sptrc > certificateChain) noexcept=0;

类型别名

Sptr 类型别名

Smart pointer of the interface.

方法文档

函数 AddOcspResponse [SWS_CRYPT_50124] Upstream: RS_CRYPTO_02306

virtual ara::core::Result< CertificateValidationStatus > AddOcsp Response (OcspResponse::Sptrc ocspResponse, ara::core::Optional< Certificate::Sptrc > trustedOcspIssuerCertificate) noexcept=0;

Validate and add an OCSP response to be used during certificate validation to the set of previously added OCSP responses. Multiple OCSP responses may be added to one context. In order to validate the OCSP response, the issuer of the OCSP response must have been a) set as a trusted or untrusted certificate in this context previously, or b) the CRL must have been signed by another certificate that has the id-kp-OCSPSigning extended key usage set issued by the same CA, or c) the CRL must be signed by a trusted CA passed to this function using the optional trustedOcspIssuerCertificate parameter.

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

使用

类 ara::crypto::x509::CertificateValidationCtx 的方法 AddOcspResponse 验证传入的 OCSP 响应(ocspResponse),并在有效时将其添加到验证上下文中已存储的 OCSP 响应集中 [SWS_CRYPT_50124]。可以向一个上下文中添加多个响应 [SWS_CRYPT_50124]。通过可选参数 trustedOcspIssuerCertificate 可以传入特定证书,该证书在检查 OCSP 响应时被视为受信任;如果省略此参数,验证将采用先前通过 AddTrustedCertificate 配置的证书 [SWS_CRYPT_50124]。

同步调用返回一个 ara::core::Result<CertificateValidationStatus>,其在成功接收时包含状态 kValid,或在其他情况下反映 OCSP 验证的结果或错误 [SWS_CRYPT_50124]。

错误处理

规范未为此调用定义标准化的错误码 [SWS_CRYPT_50124]。如果操作失败,则要么在结果中传递相应的验证状态,要么通过 Result 对象指示特定于实现的错误 [SWS_CRYPT_50124]。

并发性与限制

该操作被指定为线程安全且异常安全 [SWS_CRYPT_50124]。为了使 OCSP 响应的验证成功,必须满足以下条件之一 [SWS_CRYPT_50124]:

  • 签发者之前已作为受信任或不受信任的证书存储在上下文中 [SWS_CRYPT_50124]。
  • 签名来自同一证书颁发机构(CA)且设置了扩展 id-kp-OCSPSigning 的证书 [SWS_CRYPT_50124]。
  • 签名来自直接通过 trustedOcspIssuerCertificate 传入的受信任 CA [SWS_CRYPT_50124]。

相互作用

已注册的 OCSP 响应会进入后续的验证检查中,正如 [SWS_CRYPT_50122](ValidateCertificate)和 [SWS_CRYPT_50123](ValidateCertificateChain)所执行的那样。解释:OCSP 响应大概率需要在路径验证启动之前添加,以便能够考虑证书的吊销状态。 问题 Q-fbb0711617fd7895 (未决)

本文本由 AI 基于规范数据生成。

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

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

Parameter (in)

ParameterBeschreibung
ocspResponseThe OCSP response to be used during certificate validation.
trustedOcspIssuerCertificateIf provided, the certificate to be considered trusted during validation of the OCSP response. If not provided, the certificates added via AddTrustedCertificate are considered trusted.

Rückgabewert

TypBeschreibung
ara::core::Result<CertificateValidationStatus >a result containing kValid if the response was added, or the result of the OCSP response validation, or an implementation specific error otherwise.

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_50124
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50124@rel:R25-11#1f4c1ea2
Content hash
1f4c1ea2
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50124
Status: valid/unmigrated Version: rel:R25-11#802cfd8b 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_50124@rel:R25-11#802cfd8b
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

函数 AddTrustedCertificate [SWS_CRYPT_50117] Upstream: RS_CRYPTO_02306

virtual ara::core::Result< void > AddTrustedCertificate ( Certificate::Sptrc trustedCertificate) noexcept=0;

Add a trusted certificates to be used during certificate path validation to the set of previously added trusted certificates.

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

类 ara::crypto::x509::CertificateValidationCtx 的方法 AddTrustedCertificate 将又一个证书补充到用于后续验证的受信任证书集合中 [SWS_CRYPT_50117]。

使用

调用通过 ara/crypto/x509/certificate_validation_ctx.h 中的接口进行。作为参数传递类型为 Certificate::Sptrc 的 trustedCertificate,该证书在证书路径验证中被视为受信任 [SWS_CRYPT_50117]。该函数在成功执行后返回一个空的 ara::core::Result<void> [SWS_CRYPT_50117]。

错误处理

规范未为此函数定义标准化的错误代码 [SWS_CRYPT_50117]。如果在处理过程中发生错误,将通过 ara::core::Result 报告实现特定的错误 [SWS_CRYPT_50117]。

并发性与限制

该方法被声明为 noexcept=0,被视为异常安全(exception safe),并被明确规范定义为线程安全(thread-safe)[SWS_CRYPT_50117]。

相互作用

已注册的受信任证书与验证上下文的其他功能协同工作:

  • 在 ValidateCertificateChain 中,根据 RFC 5280 针对此前通过 AddTrustedCertificate 存放的受信任证书验证证书链,同时忽略不受信任的证书 [SWS_CRYPT_50123]。
  • 在 AddOcspResponse 中,此前在上下文中设置的受信任证书可用作签发者,以检查 OCSP 响应的有效性 [SWS_CRYPT_50124]。

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

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

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

Parameter (in)

ParameterBeschreibung
trustedCertificatea certificate to be considered trusted during certificate path validation.

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result on success, or an implementation specific error.

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_50117
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50117@rel:R25-11#e153d47b
Content hash
e153d47b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50117
Status: valid/unmigrated Version: rel:R25-11#d31aab33 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_50117@rel:R25-11#d31aab33
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

函数 AddUntrustedCertificate [SWS_CRYPT_50118] Upstream: RS_CRYPTO_02306

virtual ara::core::Result< void > AddUntrustedCertificate ( Certificate::Sptrc untrustedCertificate) noexcept=0;

Add an untrusted certificate to be used during certificate path validation to the set of previously added untrusted certificates.

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

上下文类型 ara::crypto::x509::CertificateValidationCtx 的方法 AddUntrustedCertificate 将不可信证书添加到先前注册的证书集中,以便在证书路径验证期间予以考虑 [SWS_CRYPT_50118]。通过头文件 #include "ara/crypto/x509/certificate_validation_ctx.h" 进行包含 [SWS_CRYPT_50118]。作为参数,传入指向待考虑证书的智能指针(Certificate::Sptrc untrustedCertificate)[SWS_CRYPT_50118]。由于该方法直接返回一个 ara::core::Result<void>,注册过程可能是同步处理的 [SWS_CRYPT_50118]。 问题 Q-879b384ff6efe687 (未决)

在错误处理方面,AUTOSAR 没有为此接口指定标准化的错误代码 [SWS_CRYPT_50118]。在成功的情况下,返回的 ara::core::Result 不包含任何值(void);在错误的情况下,它提供一个实现特定的错误代码 [SWS_CRYPT_50118]。因此,调用方在进一步使用验证上下文之前,必须检查 Result 对象是否存在错误。该方法被声明为 noexcept 并归类为异常安全(exception safe),从而不会跨越接口边界传播 C++ 异常 [SWS_CRYPT_50118]。

该操作被明确声明为线程安全(thread-safe)[SWS_CRYPT_50118]。因此,多个线程可以并发地将证书引入同一个验证上下文中。该调用在路径验证开始之前执行是合理的,以确保验证算法所需的所有证书均已就绪 [SWS_CRYPT_50118]。

此使用说明由 AI 生成,基于 AUTOSAR R25-11 规范版本。

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

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

Parameter (in)

ParameterBeschreibung
untrustedCertificatea certificate to be considered untrusted during certificate path validation.

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result on success, or an implementation specific error.

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_50118
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50118@rel:R25-11#9af31610
Content hash
9af31610
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50118
Status: valid/unmigrated Version: rel:R25-11#6956d0c9 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_50118@rel:R25-11#6956d0c9
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

函数 IgnoreCriticalExtension [SWS_CRYPT_50119] Upstream: RS_CRYPTO_02306

virtual ara::core::Result< void > IgnoreCriticalExtension (ara::core::StringView ignoredExtensionOid) noexcept=0;

Configure the context to ignore an extension during validation of certificates and OCSP responses, even if the extension is marked as critical and the validation context does not support the extension. It is the responsibility of the application to validate such extensions. Multiple invocations of this function lead to ignoring all passed extensions. This function has no effect if the kIgnoreUnknownCriticalExtensions validation option is set.

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

使用

[SWS_CRYPT_50119] 上的方法 IgnoreCriticalExtension 配置 ara::crypto::x509::CertificateValidationCtx 的实例,以便在检查证书以及 OCSP 响应时忽略特定证书扩展。即使该扩展被标记为关键且原本不受验证上下文支持,此规则同样适用。参数 ignoredExtensionOid 作为 ara::core::StringView 接收待忽略扩展的 OID。多次调用会导致所有传入的扩展 OID 都被忽略。执行同步进行,并被声明为 noexcept。

错误处理与并发

该函数未指定标准化的错误代码;在成功的情况下,它返回一个空的 ara::core::Result<void>,而在错误的情况下,包含一个实现特定的错误代码 [SWS_CRYPT_50119]。在并发性方面,该接口被指定为线程安全(thread-safe)和异常安全(exception safe)。

限制与交互

如果忽略了关键扩展,则该扩展的业务验证完全由应用程序负责 [SWS_CRYPT_50119]。如果设置了验证选项 kIgnoreUnknownCriticalExtensions,则该调用不会产生额外效果。忽略不支持的关键扩展可能有助于防止 [SWS_CRYPT_40203] 范围内的后续路径检查(例如在确定 CertificateValidationStatus 时)失败。 问题 Q-a087c9a9543c092a (未决)

本文本由人工智能生成。

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

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

Parameter (in)

ParameterBeschreibung
ignoredExtensionOidthe OID of the extension to be ignored during certificate and OCSP response validation

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result on success, or an implementation specific error.

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_50119
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50119@rel:R25-11#88941c5c
Content hash
88941c5c
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50119
Status: valid/unmigrated Version: rel:R25-11#fedabb0a 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_50119@rel:R25-11#fedabb0a
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

函数 SetCurrentTime [SWS_CRYPT_50121] Upstream: RS_CRYPTO_02306

virtual ara::core::Result< void > SetCurrentTime (Timestamp current Time) noexcept=0;

Set the reference time point to be used as the current time during certificate validation. If this function is not called, the system time will be used during certificate validation.

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

Parameter (in)

ParameterBeschreibung
currentTimeThe time point to be used as the current time during certificate validation.

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result on success, or an implementation specific error.

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_50121
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50121@rel:R25-11#2f4eeea2
Content hash
2f4eeea2
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50121
Status: valid/unmigrated Version: rel:R25-11#9a207572 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_50121@rel:R25-11#9a207572
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

函数 SetValidationOptions [SWS_CRYPT_50120] Upstream: RS_CRYPTO_02306

virtual ara::core::Result< void > SetValidationOptions (Certificate ValidationOptions CertificateValidationOptions) noexcept=0;

Set validation options to be used during certificate validation.

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

使用

类 ara::crypto::x509::CertificateValidationCtx 的方法 SetValidationOptions 根据 [SWS_CRYPT_50120] 用于设定执行证书验证的选项。作为参数,纯虚函数需要 CertificateValidationOptions,即用于标识所需验证选项的位掩码。该调用通过头文件 ara/crypto/x509/certificate_validation_ctx.h 提供。

错误处理

根据 [SWS_CRYPT_50120],该接口返回一个 ara::core::Result<void>。成功执行后,结果不包含任何值(空结果)。如果为选项传递了无效值,则操作失败并返回错误代码 ara::crypto::CryptoErrc::kInvalidArgument。此时应用回滚语义。如果发生其他错误,可以返回实现特定的错误代码。

并发性与限制

根据 [SWS_CRYPT_50120],该方法被规范定义为线程安全(thread-safe),并允许并发调用。它还被声明为异常安全(exception safe)以及带有 noexcept,因此不允许跨接口边界抛出异常。

本文字由人工智能基于 AUTOSAR R25-11 生成。

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

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

Parameter (in)

ParameterBeschreibung
CertificateValidationOptionsA bitmask identifying validation options. The semantics of each option is specified in the CertificateValidationOptions type.

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result on success, or an implementation specific error.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics an invalid CertificateValidationOptions has been provided

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50120
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50120@rel:R25-11#801ec299
Content hash
801ec299
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50120
Status: valid/unmigrated Version: rel:R25-11#ffc647e8 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_50120@rel:R25-11#ffc647e8
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

函数 ValidateCertificate [SWS_CRYPT_50122] Upstream: RS_CRYPTO_02306

virtual ara::core::Result< CertificateValidationResult::Sptrc > ValidateCertificate (Certificate::Sptrc certificate) noexcept=0;

Performs certificate path validation according to RFC 5280 and according to the previous configuration of the context.

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

来自头文件 ara/crypto/x509/certificate_validation_ctx.h 中类 ara::crypto::x509::CertificateValidationCtx 的方法 ValidateCertificate 执行符合 RFC 5280 的同步证书路径验证 [SWS_CRYPT_50122]。验证检查基于实例上下文的先前配置进行。作为唯一的输入参数,待验证证书通过类型为 Certificate::Sptrc 的指针 certificate 传入 [SWS_CRYPT_50122]。

返回类型为 ara::core::Result<CertificateValidationResult::Sptrc>,其在成功时包含指向验证结果的指针,或在出错时提供错误码 [SWS_CRYPT_50122]。除特定于实现的错误外,还可能出现特定错误码 ara::crypto::CryptoErrc::kIncompatibleArguments [SWS_CRYPT_50122]。该错误码具有回滚语义,并且在通过 AddOcspResponse 存储了 OCSP 响应但配置的 CertificateValidationOptions 未指定任何 OCSP 行为时返回。

关于执行安全性和并发性,该方法被指定为线程安全(thread-safe)以及异常安全(exception safe),并且不引发异常(noexcept)[SWS_CRYPT_50122]。作为顺序条件需要注意的是,验证上下文必须事先初始化和配置,因为检查直接建立在其预设配置之上 [SWS_CRYPT_50122]。

此使用说明基于 AUTOSAR Adaptive Platform R25-11 规范。

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

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

Parameter (in)

ParameterBeschreibung
certificateThe certificate to be validated.

Rückgabewert

TypBeschreibung
ara::core::Result<CertificateValidationResult::Sptrc >The result of the certificate validation, or an implementation specific error.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics if an OCSP response has been set via AddOcspResponse, but the CertificateValidationOptions do not specify the OCSP behavior.

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

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

函数 ValidateCertificateChain [SWS_CRYPT_50123] Upstream: RS_CRYPTO_02306

virtual ara::core::Result< CertificateValidationResult::Sptrc > ValidateCertificateChain (const ara::core::Span< Certificate::Sptrc > certificateChain) noexcept=0;

Performs certificate path validation according to RFC 5280 and according to the previous configuration of the context. The function ignores any certificates added to the context via Add UntrustedCertificate. Instead, the function validates the provided chain against any trusted certificate that has been set using the function AddTrustedCertificate.

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

上下文 ara::crypto::x509::CertificateValidationCtx 中的方法 ValidateCertificateChain 根据 RFC 5280 对证书链执行同步路径验证 [SWS_CRYPT_50123]。

用法与参数

作为输入,该函数通过参数 certificateChain 期望一个类型为 ara::core::Span<Certificate::Sptrc> 的链。其中元素 0 代表叶证书(Leaf Certificate),而每个后续元素必须包含紧邻前一个证书的签发者 [SWS_CRYPT_50123]。该函数忽略先前通过 AddUntrustedCertificate 注册的证书,并仅针对通过 AddTrustedCertificate 配置的信任锚验证传入的链 [SWS_CRYPT_50123]。

错误处理

结果封装为 ara::core::Result<CertificateValidationResult::Sptrc> 提供,其中包含指向验证结果的指针或错误码 [SWS_CRYPT_50123]。如果先前通过 AddOcspResponse 设置了 OCSP 响应,但当前的 CertificateValidationOptions 未定义 OCSP 行为,则错误 ara::crypto::CryptoErrc::kIncompatibleArguments 会以回滚语义发生 [SWS_CRYPT_50123]。其他错误原因作为具体实现特定的错误码返回 [SWS_CRYPT_50123]。

并发性与执行安全性

该接口被声明为 noexcept,被视为异常安全(exception safe),并被归类为支持并发访问的线程安全(thread-safe) [SWS_CRYPT_50123]。

本文由 AI 生成,用于技术指导。

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

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

Parameter (in)

ParameterBeschreibung
certificateChainThe certificate chain to be validated. Element 0 contains the leaf certificate and each subsequent certificate contains the issuer of the previous certificate.

Rückgabewert

TypBeschreibung
ara::core::Result<CertificateValidationResult::Sptrc >The result of the certificate validation, or an implementation specific error.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kIncompatibleArgumentsrollback_semantics if an OCSP response has been set via AddOcspResponse, but the CertificateValidationOptions do not specify the OCSP behavior.

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50123
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50123@rel:R25-11#b1d69fda
Content hash
b1d69fda
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50123
Status: valid/unmigrated Version: rel:R25-11#2fc9935e 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_50123@rel:R25-11#2fc9935e
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_50116] Upstream: RS_CRYPTO_02205

using Sptr = std::shared_ptr<CertificateValidationCtx>;

Smart pointer of the interface.

Header-Datei#include "ara/crypto/x509/certificate_validation_ctx.h"
Scopeclass ara::crypto::x509::CertificateValidationCtx
SymbolSptr

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50116
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50116@rel:R25-11#3e5fd2f9
Content hash
3e5fd2f9
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50116
Status: valid/unmigrated Version: rel:R25-11#57ba261f 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_50116@rel:R25-11#57ba261f
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