DEENESPTFRRUARHIKOZHNL

命名空间 apext::com::secoc

用户指南人工智能生成

定义用于安全通信通道的新鲜度值管理和错误处理接口。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 05efd4a1afb9 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

定义用于安全通信通道的新鲜度值管理和错误处理接口。

该命名空间定义了在 AUTOSAR Adaptive Platform Communication Management(SWS Communication Management §C.1 “Header: apext/com/secoc/fvm.h”)的 Secure Onboard Communication(SecOC)框架下用于管理新鲜度值的厂商特定接口。Freshness Value Manager 的生命周期和初始化完全由通信管理控制,通信管理在已配置的发送过程中通过该接口查询新鲜度值([SWS_CM_11272])。当新鲜度值暂时不可用时,会在丢弃错误消息之前进行受控重试,直至达到定义的阈值。此外,该命名空间还为诊断和异常处理提供了专用的错误域和标准化错误代码。

上下文

命名空间 apext::com::secoc 在 AUTOSAR Adaptive Platform(SWS Communication Management §C.1 “Header: apext/com/secoc/fvm.h”)的功能集群 Communication Management(ara::com)内定义了平台扩展规范接口(Platform Extension Interfaces)。这些扩展接口的目的是使 OEM 和协议栈厂商能够提供定制的 Freshness Value Manager(FVM),该管理器生成、管理和验证用于抵御重放攻击的 Secure Onboard Communication(SecOC)所需的新鲜度值。

该命名空间主要与三个角色交互:通信管理(ara::com)、标准化接口定义(FVM)及其数据载体如 FVContainer([SWS_CM_11286]、[SWS_CM_11344]),以及整车厂或协议栈供应商的具体 FVM 实现。理解:假定厂商特定的 FVM 库在系统集成过程中作为静态或动态库进行链接,因为规范定义了功能接口,但具体的集成形式由协议栈特定决定。 问题 Q-256aef3d6698cc3f (未决)

SecOcKontext AraCom Communication Management (ara::com) SecOcExt Platform Extension Interface (apext::com::secoc) AraCom->SecOcExt verwaltet Lebenszyklus ruft FVM::Initialize AraCom->SecOcExt fragt Frische ab (FVM::GetTxFreshness) FvmImpl OEM / Stack-Vendor FVM-Implementierung FvmImpl->SecOcExt implementiert FVM-Interface

上下文图:命名空间 apext::com::secoc 在 Communication Management 与厂商特定 FVM 实现之间的集成。来源:[SWS_CM_11272]、SWS Communication Management §C.1 “Header: apext/com/secoc/fvm.h”。

生命周期

FVM 实现的生命周期管理完全由通信管理 ara::com 控制([SWS_CM_11272])。应用程序和服务实例不直接创建或管理 FVM 组件。

在通信栈初始化期间,通过调用库 API apext::com::secoc::FVM::Initialize([SWS_CM_11273])确定性地完成启动。如果厂商侧无法正确完成初始化,FVM 层会通过定义的错误代码 kFVInitializeFailed([SWS_CM_11342])指示此错误状态。成功执行初始化调用后,Freshness Value Manager 保持在活动运行状态,并响应对发送和接收新鲜度值的同步请求。

使用路径

常规使用路径分为消息的发送保护和接收验证:

  • 发送消息:如果一条消息被配置为进行 SecOC 发送,则它将被视为真实消息([SWS_CM_11274])。保护在完成所有 E2E 保护计算后按照固定顺序进行([SWS_CM_11274])。如果服务接口配置具有属性 freshnessValueId,则通信管理将调用 apext::com::secoc::FVM::GetTxFreshness([SWS_CM_11274]、[SWS_CM_11275])。新鲜度值在 FVContainer 结构中提供,该结构在属性 length 中保存位长度,并保存值本身([SWS_CM_11286]、[SWS_CM_11344])。
  • 发送重试机制:对于每条受保护的消息,系统都会维护一个 Authentication Build Counter([SWS_CM_11275])。成功生成后,计数器重置为 0。如果 GetTxFreshness 返回可恢复错误 kFVNotAvailable 或 Authenticator 计算失败,则计数器递增并重试构建([SWS_CM_11275])。如果计数器达到阈值 SecOCAuthenticationBuildAttempts,则丢弃该消息([SWS_CM_11275])。
  • 接收消息:对于启用了验证的传入 SecOC 消息(属性 securedRxVerification 为真或未设置),将提取 Authenticator,并在进行 E2E 检查之前通过重新计算 MAC 来验证该消息([SWS_CM_11276]、SWS Communication Management §8.1 “SecOC secure channel reception”)。相反,如果 securedRxVerification 设置为假,则绕过验证(Bypass)并不经检查直接处理该消息([SWS_CM_11372])。
发送时的报文安全保护流程Communication Management (ara::com)FVM (apext::com::secoc)Use Case: E2E 保护与准备完成 E2E 计算Authentic Message bereitstellenUse Case: Frischewert-AbfrageGetTxFreshness(freshnessValueId, ...)altErfolg返回包含新鲜度值的 FVContainerAuthenticator berechnenSecOC-Nachricht versendenAuthentication Build Counter = 0kFVNotAvailableFehler kFVNotAvailable meldenAuthentication Build Counter inkrementierenWiederholversuch bis Schwellwert

时序图:使用 FVM 保护发送消息时的调用和重试流程。来源:[SWS_CM_11274]、[SWS_CM_11275]。

错误场景

FVM 接口内的错误情况通过类型安全的错误域 ComSecOcFvmErrorDomain 进行处理,其实例可通过 GetComSecOcFvmErrorDomain 获取([SWS_CM_12521])。错误代码在枚举类型 ComSecOcFvmErrc 中定义([SWS_CM_11342]):

  • kFVNotAvailable(代码 1):所需的新鲜度值暂时不可用。这向 Communication Management 指示一个可恢复错误,并根据发送协议触发重试([SWS_CM_11275]、[SWS_CM_11342])。
  • kFVInitializeFailed(代码 2):Freshness Value Manager 的初始化失败([SWS_CM_11342])。

通过辅助函数 MakeErrorCode([SWS_CM_12522]),可以将错误代码与厂商特定的附加数据(SupportDataType)一起封装到常规的 ara::core::ErrorCode 对象中。针对基于异常的环境中失败的同步调用,提供了异常类 ComSecOcFvmException。

本指南基于 AUTOSAR Adaptive Platform R25-11(Communication Management)规范。所有陈述均完全基于指定的规范和文档参考。

主题图

类图

Abgerundete Rahmen = Namespace- bzw. Klassen-Scopes; hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); graue Boxen = namespace-fremde bzw. externe Basisklassen. Klicken öffnet die jeweilige Klassen- bzw. cppreference-Seite.

G cluster_ns apext::com::secoc napext__com__secoc__ComSecOcFvmErrorDomain ComSecOcFvmErrorDomain next_ara__core__ErrorDomain ara::core::ErrorDomain napext__com__secoc__ComSecOcFvmErrorDomain->next_ara__core__ErrorDomain napext__com__secoc__ComSecOcFvmException ComSecOcFvmException next_ara__core__Exception ara::core::Exception napext__com__secoc__ComSecOcFvmException->next_ara__core__Exception napext__com__secoc__FVContainer «struct» FVContainer napext__com__secoc__FVM FVM

详细视图

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

类

Defines a class representing the SecOc Freshness Value Manager error domain

继承自 ara::core::ErrorDomain

Defines a class for exceptions to be thrown by the SecOc Freshness Value Manager

继承自 ara::core::Exception

A container to hold the length of freshness value in bits and the freshness value itself

FVM 类

A freshness value management interface to be implemented by the OEM/stack vendor

函数

Returns a reference to the apext::com::secoc::ComSecOcFvmErrorDomain object

constexpr const ara::core::ErrorDomain & GetComSecOcFvmErrorDomain () noexcept;

Creates an instance of ara::core::ErrorCode

constexpr ara::core::ErrorCode MakeErrorCode (apext::com::secoc::Com SecOcFvmErrc errorCode, ara::core::ErrorDomain::SupportDataType data) noexcept;

类型与常量

Defines the error codes for the apext::com::secoc::ComSecOcFvmErrorDomain

enum class ComSecOcFvmErrc : ara::core::ErrorDomain::CodeType {...};

枚举

枚举 ComSecOcFvmErrc [SWS_CM_11342] Upstream: RS_AP_00130

enum class ComSecOcFvmErrc :          ara::core::ErrorDomain::CodeType {...};

Defines the error codes for the apext::com::secoc::ComSecOcFvmErrorDomain

Header-Datei#include "apext/com/secoc/fvm_error_domain.h"
Forwarding-Header#include "apext/com/com_fwd.h"
Scopenamespace apext::com::secoc
SymbolComSecOcFvmErrc
Basistypara::core::ErrorDomain::CodeType

Werte

EnumeratorBeschreibung
kFVNotAvailable=1 Freshness Value not available
kFVInitializeFailed=2 Initialization of Freshness Value Manager failed

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

Record
AUTOSAR/AP/record/SWS_CM_11342
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11342@rel:R25-11#2fb1dd8e
Content hash
2fb1dd8e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11342
Status: valid/unmigrated Version: rel:R25-11#7146e1f4 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_CM_11342@rel:R25-11#7146e1f4
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#50596d252026-09-30
  • R20-11rel:R20-11#9e1f02d92026-10-14
  • R21-11rel:R21-11#9e1f02d92026-10-14
  • R22-11rel:R22-11#e70607272026-10-14
  • R23-11rel:R23-11#0578ae272026-10-14
  • R24-11rel:R24-11#0c1f38782026-10-14
  • R25-11rel:R25-11#7146e1f42026-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

自由函数文档

函数 GetComSecOcFvmErrorDomain [SWS_CM_12521] Upstream: RS_AP_00120, RS_AP_00130

constexpr const ara::core::ErrorDomain & GetComSecOcFvmErrorDomain () noexcept;

Returns a reference to the apext::com::secoc::ComSecOcFvmErrorDomain object

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

使用

非成员函数 GetComSecOcFvmErrorDomain 用于根据 [SWS_CM_12521] 获取对 SecOC 的 Freshness Value Management (FVM) 错误域对象的引用。该函数定义在命名空间 apext::com::secoc 中,并通过头文件 apext/com/secoc/fvm_error_domain.h 包含(AUTOSAR_AP_SWS_CommunicationManagement §C.2.2.1.1 “GetComSecOcFvmErrorDomain”)。它不接受任何参数,并同步返回指向单例对象 apext::com::secoc::ComSecOcFvmErrorDomain 的类型为 const ara::core::ErrorDomain & 的常量引用。

错误处理

该函数声明为 noexcept,并被指定为完全异常安全 (exception safe) [SWS_CM_12521]。调用时不会发生运行时错误,既不抛出异常也不生成错误码。返回的错误域更多是为开发者提供一个引用,以便在 SecOC 的错误处理中明确比对 FVM 特定的错误码。

并发性与限制

作为一个无副作用且无状态的 constexpr 函数,其调用大概率完全支持并发和可重入。 问题 Q-16d96e7f64bca93f (未决)根据规范,不存在关于调用上下文的顺序条件或限制 [SWS_CM_12521]。

相互作用

该定义基于需求 RS_AP_00120 以及 RS_AP_00130 [SWS_CM_12521]。虽然规范主要规定了命名空间 apext::com::secoc,但在其他地方也能找到 ara::com::secoc::GetComSecOcFvmErrorDomain(AUTOSAR_AP_SWS_CommunicationManagement 第598页)的表述;这可能是 Adaptive 扩展背景下的编辑性变体。 问题 Q-b49307e7cc69a94b (未决)

本使用说明由 AI 生成,基于 AUTOSAR Adaptive R25-11 规范状态。

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

Header-Datei#include "apext/com/secoc/fvm_error_domain.h"
Scopenamespace apext::com::secoc
Exception-Sicherheitexception safe

Rückgabewert

TypBeschreibung
const ara::core::ErrorDomain &Reference to the apext::com::secoc:: ComSecOcFvmErrorDomain object

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

Record
AUTOSAR/AP/record/SWS_CM_12521
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_12521@rel:R25-11#6a9763a5
Content hash
6a9763a5
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_12521
Status: valid/unmigrated Version: rel:R25-11#8e770345 Versionshistorie & Revisions (1 transition, 5 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_CM_12521@rel:R25-11#8e770345
Point-in-Time History:
Recorded Revisions (5):
  • R25-11rel:R25-11#61e04edc2026-09-30
  • R22-11rel:R22-11#149eb8902026-10-14
  • R23-11rel:R23-11#2dfcc3f12026-10-14
  • R24-11rel:R24-11#40d4bc762026-10-14
  • R25-11rel:R25-11#8e7703452026-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

函数 MakeErrorCode [SWS_CM_12522] Upstream: RS_AP_00120, RS_AP_00121, RS_AP_00130

constexpr ara::core::ErrorCode MakeErrorCode (apext::com::secoc::Com SecOcFvmErrc errorCode, ara::core::ErrorDomain::SupportDataType data) noexcept;

Creates an instance of ara::core::ErrorCode

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

使用

函数 apext::com::secoc::MakeErrorCode 用于根据 [SWS_CM_12522](AUTOSAR_AP_SWS_CommunicationManagement §C.2.2.1.2 “MakeErrorCode”)为 Freshness Value Management(SecOC)的错误域创建 ara::core::ErrorCode 的实例。该调用同步进行。作为参数,该函数需要一个类型为 apext::com::secoc::ComSecOcFvmErrc 的错误代码 errorCode 以及类型为 ara::core::ErrorDomain::SupportDataType 的厂商自定义附加数据 data [SWS_CM_12522]。它返回完全初始化的 ara::core::ErrorCode 对象 [SWS_CM_12522]。

错误处理与并发

该函数被指定为 noexcept 和 exception safe,因此保证调用不会引发异常 [SWS_CM_12522]。未为此构造函数定义特定运行时错误消息(如 DET 或 DEM)[SWS_CM_12522]。由于具有 constexpr 限定,在传递常量表达式时,错误代码的创建可能在编译时即可完成。 问题 Q-a96337508ba6ecdd (未决)

相互作用

该函数通过命名空间 apext::com::secoc 中的头文件 apext/com/secoc/fvm_error_domain.h 提供 [SWS_CM_12522]。其结构与通信管理的相关错误代码工厂相对应:

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

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

Header-Datei#include "apext/com/secoc/fvm_error_domain.h"
Scopenamespace apext::com::secoc
Exception-Sicherheitexception safe

Parameter (in)

ParameterBeschreibung
errorCodeError code number.
dataVendor defined data associated with the error

Rückgabewert

TypBeschreibung
ara::core::ErrorCodeAn ara::core::ErrorCode object.

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

Record
AUTOSAR/AP/record/SWS_CM_12522
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_12522@rel:R25-11#9a7fb1c5
Content hash
9a7fb1c5
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_12522
Status: valid/unmigrated Version: rel:R25-11#12f48f61 Versionshistorie & Revisions (1 transition, 5 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_CM_12522@rel:R25-11#12f48f61
Point-in-Time History:
Recorded Revisions (5):
  • R25-11rel:R25-11#208bfd1b2026-09-30
  • R22-11rel:R22-11#fd00e04d2026-10-14
  • R23-11rel:R23-11#5a8150df2026-10-14
  • R24-11rel:R24-11#2565df5c2026-10-14
  • R25-11rel:R25-11#12f48f612026-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