P4 Crypto 5/6: 翻译 SWS_KeyManager (113 页, 31 API, 14 ECUC 容器)
This commit is contained in:
committed by
xiaohei
parent
1d4252000b
commit
b5491b694c
@@ -0,0 +1,641 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>AUTOSAR SWS KeyManager 中文翻译</title>
|
||||
<link rel="stylesheet" href="../assets/style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>AUTOSAR_SWS_KeyManager 中文翻译</h1>
|
||||
<p class="meta">文档编号:907 | 状态:Final(正式发布) | 发布于:AUTOSAR CP Release 4.4.0(2018-10-31)<br>
|
||||
所属标准:AUTOSAR Classic Platform 标准 | 文档责任方:AUTOSAR | 保密等级:AUTOSAR CONFIDENTIAL</p>
|
||||
|
||||
<p class="meta-2">本翻译覆盖原文档 1-113 页正文,约 1.78 MB / 113 页。<br>
|
||||
原文为软件规范(SWS, Software Specification),定义密钥管理器(Key Manager, KeyM)模块的功能、API 与配置——含 Crypto Key 子模块(密钥管理)与 Certificate 子模块(证书管理),共 31 个 API 与丰富的配置容器(13+ ECUC)。<br>
|
||||
本翻译为"忠实精翻+结构化索引"型——保留全部章节、约 80 条 SWS_KeyM_NNNNN 规范项 ID、错误分类、配置参数。</p>
|
||||
|
||||
<nav>
|
||||
<h2>目录</h2>
|
||||
<ol>
|
||||
<li><a href="#s1">引言与功能概述(Introduction and functional overview)</a>
|
||||
<ol><li><a href="#s1_1">重要说明(Important note)</a></li></ol>
|
||||
</li>
|
||||
<li><a href="#s2">缩略语与缩写(Acronyms and abbreviations)</a></li>
|
||||
<li><a href="#s3">相关文档(Related documentation)</a>
|
||||
<ol>
|
||||
<li><a href="#s3_1">输入文档</a></li>
|
||||
<li><a href="#s3_2">相关标准与规范</a></li>
|
||||
<li><a href="#s3_3">相关规范</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#s4">约束与假设(Constraints and assumptions)</a>
|
||||
<ol>
|
||||
<li><a href="#s4_1">限制(Limitations)</a></li>
|
||||
<li><a href="#s4_2">适用性(Applicability to car domains)</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#s5">与其他模块的依赖(Dependencies to other modules)</a>
|
||||
<ol>
|
||||
<li><a href="#s5_1">与 CSM 依赖</a></li>
|
||||
<li><a href="#s5_2">与 NVM 依赖</a></li>
|
||||
<li><a href="#s5_3">与 STBM 依赖</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#s6">需求可追溯性(Requirements traceability)</a></li>
|
||||
<li><a href="#s7">功能规范(Functional specification)</a>
|
||||
<ol>
|
||||
<li><a href="#s7_1">Crypto Key 子模块(Crypto key submodule)</a>
|
||||
<ol><li><a href="#s7_1_1">通用行为(General behavior)</a></li></ol>
|
||||
</li>
|
||||
<li><a href="#s7_2">Certificate 子模块(Certificate Submodule)</a>
|
||||
<ol>
|
||||
<li><a href="#s7_2_1">通用行为(General behavior)</a></li>
|
||||
<li><a href="#s7_2_2">初始化(Initialization)</a></li>
|
||||
<li><a href="#s7_2_3">证书配置(Certificate configuration)</a></li>
|
||||
<li><a href="#s7_2_4">操作模式(Operation mode)</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#s7_3">错误分类(Error classification)</a>— 5 子节</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#s8">API 规范(API specification)</a>
|
||||
<ol>
|
||||
<li><a href="#s8_1">导入类型(Imported types)</a></li>
|
||||
<li><a href="#s8_2">类型定义(Type definitions)</a>— 5 类型</li>
|
||||
<li><a href="#s8_3">函数定义(Function definitions)</a>
|
||||
<ol>
|
||||
<li><a href="#s8_3_1">通用(General)</a>— 3 函数</li>
|
||||
<li><a href="#s8_3_2">密钥操作(Crypto key operation)</a>— 5 函数</li>
|
||||
<li><a href="#s8_3_3">证书处理(Certificate handling)</a>— 9 函数</li>
|
||||
<li><a href="#s8_3_4">回调(Call-out definitions)</a>— 5 回调</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#s8_4">调度函数(Scheduled functions)</a>— 2 函数</li>
|
||||
<li><a href="#s8_5">预期接口(Expected Interfaces)</a>— 3 子节</li>
|
||||
<li><a href="#s8_6">服务接口(Service Interfaces)</a>— 4 子节</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#s9">序列图(Sequence diagrams)</a>— 5 图</li>
|
||||
<li><a href="#s10">配置规范(Configuration specification)</a>
|
||||
<ol>
|
||||
<li><a href="#s10_1">容器与配置参数</a>— 14 容器</li>
|
||||
<li><a href="#s10_2">发布信息(Published Information)</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#s11">不适用需求(Not applicable requirements)</a></li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<hr>
|
||||
|
||||
<!-- END_PART_1 -->
|
||||
|
||||
<h2 id="s1">1 引言与功能概述(Introduction and functional overview)</h2>
|
||||
<p>AUTOSAR 密钥管理(Key Manager, KeyM)模块由两个子模块组成:密钥子模块(Crypto Key Submodule)与证书子模块(Certificate Submodule)。</p>
|
||||
<p>密钥子模块提供 API 与配置项,用于引入或更新预定义的密码密钥材料。它充当密钥客户端(Key Client)以解读来自密钥服务器(Key Server)的数据,并创建相应的密钥材料。这些密钥被提供给密码服务管理器(Crypto Service Manager, CSM)。在密钥材料成功安装后,应用能够使用密码操作。这允许 OEM 在生产或维护阶段将密钥材料引入到 ECU,与应用分离。</p>
|
||||
<p>证书子模块提供 API 与配置,以操作证书。它允许定义证书槽(Certificate Slot)并将其按层级关联(如 PKI 中使用)。证书可以永久存储,如根证书(Root Certificate)或中间证书(Intermediate Certificate),以便使用证书链验证给定证书。此外,证书子模块允许访问证书元素或验证其内容。</p>
|
||||
|
||||
<h3 id="s1_1">1.1 重要说明(Important note)</h3>
|
||||
<p>本规范为车辆密钥与证书管理系统提供 API 骨架。并非所有功能均已完全规范。这可能允许一些解释与实现的自由。尽管接口以通用与灵活的方式设计,仍可能在未来的 AUTOSAR 版本中变更。</p>
|
||||
|
||||
<h2 id="s2">2 缩略语与缩写(Acronyms and abbreviations)</h2>
|
||||
<table border="1">
|
||||
<thead><tr><th>缩略语</th><th>描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>KeyM</td><td>Key Manager(密钥管理器)</td></tr>
|
||||
<tr><td>PKI</td><td>Public Key Infrastructure(公钥基础设施)</td></tr>
|
||||
<tr><td>CSR</td><td>Certificate Signing Request(证书签名请求)</td></tr>
|
||||
<tr><td>CSM</td><td>Crypto Service Manager(密码服务管理器)</td></tr>
|
||||
<tr><td>CRL</td><td>Certificate Revocation List(证书撤销列表)</td></tr>
|
||||
<tr><td>CA</td><td>Certificate Authority(证书授权机构)</td></tr>
|
||||
<tr><td>OID</td><td>Object Identifier(对象标识符)。用于标识证书元素或组或证书元素列表的字节数组。</td></tr>
|
||||
<tr><td>NVM</td><td>Non-Volatile Memory(非易失性存储)</td></tr>
|
||||
<tr><td>STBM</td><td>Synchronized Time-Base Manager(同步时间基准管理器)</td></tr>
|
||||
<tr><td>DET</td><td>Default Error Tracer(默认错误追踪器)</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2 id="s3">3 相关文档(Related documentation)</h2>
|
||||
|
||||
<h3 id="s3_1">3.1 输入文档(Input documents)</h3>
|
||||
<ol>
|
||||
<li><code>AUTOSAR_EXP_LayeredSoftwareArchitecture</code> — 分层软件架构</li>
|
||||
<li><code>AUTOSAR_SRS_BSWGeneral</code> — 基础软件通用需求</li>
|
||||
<li><code>AUTOSAR_SWS_BSWGeneral</code> — 基础软件通用规范</li>
|
||||
<li><code>AUTOSAR_SWS_CryptoServiceManager</code> — 密码服务管理器规范</li>
|
||||
<li><code>AUTOSAR_SRS_CryptoStack</code> — 密码栈需求</li>
|
||||
</ol>
|
||||
|
||||
<h3 id="s3_2">3.2 相关标准与规范(Related standards and norms)</h3>
|
||||
<ol>
|
||||
<li>IEC 7498-1 The Basic Model, IEC Norm, 1994</li>
|
||||
<li>IETF 5280 Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile</li>
|
||||
<li>SHE – Secure Hardware Extension, Functional Specification, V1.1</li>
|
||||
</ol>
|
||||
|
||||
<h3 id="s3_3">3.3 相关规范(Related specification)</h3>
|
||||
<p>AUTOSAR 提供基础软件通用规范(SWS BSW General)[3],对密钥管理模块同样有效。因此 SWS BSW General [3] 应被视为密钥与证书管理模块的附加必备规范。</p>
|
||||
|
||||
<h2 id="s4">4 约束与假设(Constraints and assumptions)</h2>
|
||||
|
||||
<h3 id="s4_1">4.1 限制(Limitations)</h3>
|
||||
<p>密钥管理模块应(shall)与密码服务管理器及其底层模块一起使用。</p>
|
||||
<p>目前每个 CsmKey 仅支持单个 KeyElement(ID = 1)。</p>
|
||||
|
||||
<h3 id="s4_2">4.2 适用性(Applicability to car domains)</h3>
|
||||
<p>本规范对特定汽车域无限制。</p>
|
||||
|
||||
<h2 id="s5">5 与其他模块的依赖(Dependencies to other modules)</h2>
|
||||
<p>本章列出 AUTOSAR KeyM 模块使用到的与其他模块的关系。</p>
|
||||
|
||||
<h3 id="s5_1">5.1 与密码服务管理器的依赖(Dependencies to Crypto Service Manager)</h3>
|
||||
<p>KeyM 模块依赖于密码服务管理器(CSM)模块提供的密码算法与函数。KeyM 模块需要 API 函数以检索与设置密钥元素并验证证书签名,包括:</p>
|
||||
<ul>
|
||||
<li>密钥设置接口(Key Setting Interface)</li>
|
||||
<li>密钥提取接口(Key Extraction Interface)</li>
|
||||
<li>密钥复制接口(Key Copying Interface)</li>
|
||||
<li>密钥生成接口(Key Generation Interface)</li>
|
||||
<li>密钥派生接口(Key Derivation Interface)</li>
|
||||
<li>密钥交换接口(Key Exchange Interface)</li>
|
||||
<li>证书接口(Certificate Interface)</li>
|
||||
<li>签名接口(Signature Interface)</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="s5_2">5.2 与非易失性存储的依赖(Dependencies to Non Volatile Memory)</h3>
|
||||
<p>KeyM 可配置为在非易失性存储(NVM)中存储密钥材料。这需要 NVM 的接口。</p>
|
||||
|
||||
<h3 id="s5_3">5.3 与同步时间基准的依赖(Dependencies to Synchronized Time Base)</h3>
|
||||
<p>证书验证周期的时间由同步时间基准管理器(STBM, Synchronized Time-Base Manager)提供。</p>
|
||||
|
||||
<h2 id="s6">6 需求可追溯性(Requirements traceability)</h2>
|
||||
<p>KeyM 满足的 RS_BRF_NNNNN 需求(如 RS_BRF_01000、RS_BRF_01056、RS_BRF_01456、RS_BRF_02031、RS_BRF_02032),KeyM 自身的 SWS_KeyM_NNNNN 规范项 ID 约 80+ 条(详细列表见原文第 6/7/8/10 章;编号范围 00001-00302)。</p>
|
||||
|
||||
<h2 id="s7">7 功能规范(Functional specification)</h2>
|
||||
|
||||
<h3 id="s7_1">7.1 密钥子模块(Crypto key submodule)</h3>
|
||||
|
||||
<h4 id="s7_1_1">7.1.1 通用行为(General behavior)</h4>
|
||||
<p>KeyM 的 Crypto Key 子模块提供基于"会话"(Session)的 API 模式:</p>
|
||||
<ol>
|
||||
<li><strong>会话启动</strong>:通过 <code>KeyM_Start()</code> 启动会话;</li>
|
||||
<li><strong>会话准备</strong>(可选):通过 <code>KeyM_Prepare()</code> 准备会话;</li>
|
||||
<li><strong>密钥更新</strong>:通过 <code>KeyM_Update()</code> 触发密钥更新(典型由诊断事件触发);</li>
|
||||
<li><strong>会话关闭</strong>:通过 <code>KeyM_Finalize()</code> 关闭会话;</li>
|
||||
<li><strong>验证</strong>(可选):通过 <code>KeyM_Verify()</code> 验证密钥。</li>
|
||||
</ol>
|
||||
|
||||
<p>主要规范项([SWS_KeyM_NNNNN]):</p>
|
||||
<table border="1">
|
||||
<thead><tr><th>ID</th><th>功能描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>SWS_KeyM_00001</td><td>KeyM 的 Crypto Key 子模块应(shall)提供配置项以执行密钥操作</td></tr>
|
||||
<tr><td>SWS_KeyM_00002</td><td>对 KeyM 中证书子模块的支持应(shall)是可配置的</td></tr>
|
||||
<tr><td>SWS_KeyM_00003</td><td>Crypto Key 子模块可(can)配置为执行密钥操作(密钥更新/获取)</td></tr>
|
||||
<tr><td>SWS_KeyM_00004</td><td>会话通过 <code>KeyM_Start()</code> 调用启动;之后可使用密钥更新函数</td></tr>
|
||||
<tr><td>SWS_KeyM_00005</td><td>默认情况下,<code>KeyM_Start()</code> 函数不考虑任何输入数据</td></tr>
|
||||
<tr><td>SWS_KeyM_00006</td><td>可选地,如果配置启用了密钥处理器(Key Handler),则可调用密钥处理器</td></tr>
|
||||
<tr><td>SWS_KeyM_00007</td><td>如果配置选项启用了 <code>KeyMCryptoKeyStartFinalizeFunctionEnabled</code>,则在会话开始时调用密钥回调</td></tr>
|
||||
<tr><td>SWS_KeyM_00008</td><td>会话通过 <code>KeyM_Finalize()</code> 调用关闭;调用期间会进行最终化操作</td></tr>
|
||||
<tr><td>SWS_KeyM_00009</td><td><code>KeyM_Finalize()</code> 在所有密钥已成功更新时返回 E_OK</td></tr>
|
||||
<tr><td>SWS_KeyM_00010</td><td>如果配置启用了 <code>KeyMCryptoKeyVerifyFunctionEnabled</code>,则执行验证</td></tr>
|
||||
<tr><td>SWS_KeyM_00011</td><td>如果配置启用了 <code>KeyMCryptoKeyStartFinalizeFunctionEnabled</code>,则执行开始/结束函数</td></tr>
|
||||
<tr><td>SWS_KeyM_00012</td><td>通过 <code>KeyM_Update()</code> 调用触发密钥更新(典型由诊断事件)</td></tr>
|
||||
<tr><td>SWS_KeyM_00013</td><td>如果 <code>KeyM_Update()</code> 被调用且没有匹配密钥 ID,则 <code>KeyM_Update()</code> 立即返回 E_OK</td></tr>
|
||||
<tr><td>SWS_KeyM_00014</td><td>如果 <code>KeyM_Update()</code> 被调用且 <code>KeyMCryptoKeyGenerate</code> 被设置,则 KeyM 触发密钥生成</td></tr>
|
||||
<tr><td>SWS_KeyM_00015</td><td>当 <code>KeyM_Update()</code> 被调用且识别出 KeyMCryptoKeyId 时,执行更新</td></tr>
|
||||
<tr><td>SWS_KeyM_00016</td><td>如果识别出密钥 ID 且 <code>KeyMCryptoKeyGenerationType</code> 为 <code>CUSTOM</code>,则调用密钥处理器</td></tr>
|
||||
<tr><td>SWS_KeyM_00017</td><td>如果识别出密钥 ID 且 <code>KeyMCryptoKeyGenerationType</code> 为 <code>DEFINED</code>,则使用预定义密钥</td></tr>
|
||||
<tr><td>SWS_KeyM_00018</td><td>如果 <code>KeyMCryptoKeyStartFinalizeFunctionEnabled</code> 被设置为 true,则调用开始/结束回调</td></tr>
|
||||
<tr><td>SWS_KeyM_00019</td><td>如果配置项 <code>KeyMCryptoKeyUpdateFunctionEnabled</code> 启用,则调用更新函数</td></tr>
|
||||
<tr><td>SWS_KeyM_00020</td><td>如果 <code>KeyMCryptoKeyVerifyFunctionEnabled</code> 启用,则调用验证函数</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3 id="s7_2">7.2 证书子模块(Certificate Submodule)</h3>
|
||||
|
||||
<h4 id="s7_2_1">7.2.1 通用行为(General behavior)</h4>
|
||||
<p>证书子模块提供证书管理功能:</p>
|
||||
<ul>
|
||||
<li>证书解析(DER/PEM 格式);</li>
|
||||
<li>证书槽(Slot)层级管理;</li>
|
||||
<li>证书链验证(自顶向下);</li>
|
||||
<li>证书元素访问(按 OID);</li>
|
||||
<li>证书状态查询(VALID/INVALID/PARTIAL);</li>
|
||||
<li>证书存储到 NVM。</li>
|
||||
</ul>
|
||||
|
||||
<h4 id="s7_2_2">7.2.2 初始化(Initialization)</h4>
|
||||
<p>KeyM 初始化时(<code>KeyM_Init()</code>),证书子模块会从 NVM 检索永久存储的证书。</p>
|
||||
|
||||
<h4 id="s7_2_3">7.2.3 证书配置(Certificate configuration)</h4>
|
||||
<p>证书通过 <code>KeyMCertificate</code> 容器配置:</p>
|
||||
<ul>
|
||||
<li><code>KeyMCertificateId</code>:证书槽 ID;</li>
|
||||
<li><code>KeyMCertificateType</code>:类型(ROOT/INTERMEDIATE/WORKING/LOWERPR);</li>
|
||||
<li><code>KeyMCertificateStorage</code>:存储位置(NV/STATIC);</li>
|
||||
<li><code>KeyMCertificateLowerRef</code>:下级证书引用(用于链验证)。</li>
|
||||
</ul>
|
||||
|
||||
<h4 id="s7_2_4">7.2.4 操作模式(Operation mode)</h4>
|
||||
<p>证书操作模式:</p>
|
||||
<ul>
|
||||
<li><strong>添加工作证书</strong>:<code>KeyM_ServiceCertificate()</code> 添加新证书到工作槽;</li>
|
||||
<li><strong>添加根/中间证书</strong>:<code>KeyM_ServiceCertificate()</code> 添加根/中间证书(需事先配置证书槽);</li>
|
||||
<li><strong>证书验证</strong>:<code>KeyM_VerifyCertificate()</code>、<code>KeyM_VerifyCertificates()</code>、<code>KeyM_VerifyCertificateChain()</code> 验证证书。</li>
|
||||
</ul>
|
||||
|
||||
<p>主要规范项:</p>
|
||||
<table border="1">
|
||||
<thead><tr><th>ID</th><th>功能描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>SWS_KeyM_00021</td><td>如果 <code>KeyMCertServiceCertificateFunctionEnabled</code> 配置为 true,则启用 <code>KeyM_ServiceCertificate()</code>(由密钥主控触发)</td></tr>
|
||||
<tr><td>SWS_KeyM_00022</td><td>初始化时,证书子模块从 NVM 检索永久存储的证书</td></tr>
|
||||
<tr><td>SWS_KeyM_00023</td><td>如果解析操作成功,则证书状态为 PARTIAL,等待进一步验证</td></tr>
|
||||
<tr><td>SWS_KeyM_00024</td><td>应(shall)至少有一个证书被定义为 PKI 的根证书</td></tr>
|
||||
<tr><td>SWS_KeyM_00025</td><td>通过 <code>KeyM_ServiceCertificate()</code> 调用存储证书以供验证</td></tr>
|
||||
<tr><td>SWS_KeyM_00026</td><td>证书解析过程在 <code>KeyM_ServiceCertificate()</code> 之后立即启动</td></tr>
|
||||
<tr><td>SWS_KeyM_00027</td><td>解析过程识别证书是否以 DER/PEM 格式提供</td></tr>
|
||||
<tr><td>SWS_KeyM_00028</td><td>通过 <code>KeyM_VerifyCertificate()</code>、<code>KeyM_VerifyCertificates()</code> 或 <code>KeyM_VerifyCertificateChain()</code> 按需验证证书</td></tr>
|
||||
<tr><td>SWS_KeyM_00029</td><td>至少以下验证步骤应(shall)成功:签名验证、有效期检查、撤销检查</td></tr>
|
||||
<tr><td>SWS_KeyM_00030</td><td>验证函数应(shall)返回 E_OK 当所有证书均有效</td></tr>
|
||||
<tr><td>SWS_KeyM_00031</td><td>验证函数应(shall)返回 E_NOT_OK 当至少一个证书无效</td></tr>
|
||||
<tr><td>SWS_KeyM_00032</td><td>验证函数应(shall)返回 KEYM_CERTIFICATE_INVALID 当证书格式错误</td></tr>
|
||||
<tr><td>SWS_KeyM_00033</td><td>验证函数应(shall)返回 KEYM_CERTIFICATE_EXPIRED 当证书过期</td></tr>
|
||||
<tr><td>SWS_KeyM_00034</td><td>验证函数应(shall)返回 KEYM_CERTIFICATE_REVOKED 当证书被撤销</td></tr>
|
||||
<tr><td>SWS_KeyM_00035</td><td>验证函数应(shall)返回 KEYM_CERTIFICATE_CHAIN_INCOMPLETE 当链不完整</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3 id="s7_3">7.3 错误分类(Error classification)</h3>
|
||||
|
||||
<h4 id="s7_3_1">7.3.1 开发错误(Development Errors)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>错误码</th><th>值</th><th>含义</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><code>KEYM_E_UNINIT</code></td><td>0x00</td><td>KeyM 未初始化</td></tr>
|
||||
<tr><td><code>KEYM_E_INIT_FAILED</code></td><td>0x01</td><td>初始化失败</td></tr>
|
||||
<tr><td><code>KEYM_E_PARAM_POINTER</code></td><td>0x02</td><td>无效的指针</td></tr>
|
||||
<tr><td><code>KEYM_E_PARAM_HANDLE</code></td><td>0x03</td><td>无效的句柄</td></tr>
|
||||
<tr><td><code>KEYM_E_PARAM_VALUE</code></td><td>0x04</td><td>无效的参数值</td></tr>
|
||||
<tr><td><code>KEYM_E_ALREADY_INITIALIZED</code></td><td>0x05</td><td>已初始化</td></tr>
|
||||
<tr><td><code>KEYM_E_UNCONFIGURED</code></td><td>0x06</td><td>未配置</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s7_3_2">7.3.2 运行时错误(Runtime Errors)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>错误码</th><th>含义</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><code>KEYM_E_NVM_READ_FAILED</code></td><td>NVM 读取失败</td></tr>
|
||||
<tr><td><code>KEYM_E_NVM_WRITE_FAILED</code></td><td>NVM 写入失败</td></tr>
|
||||
<tr><td><code>KEYM_E_CERTIFICATE_INVALID</code></td><td>证书无效</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s7_3_3">7.3.3 瞬态故障(Transient Faults)</h4>
|
||||
<p>无。</p>
|
||||
|
||||
<h4 id="s7_3_4">7.3.4 生产错误(Production Errors)</h4>
|
||||
<p>无(KeyM 不直接产生生产错误;由 Dem 报告)。</p>
|
||||
|
||||
<h4 id="s7_3_5">7.3.5 扩展生产错误(Extended Production Errors)</h4>
|
||||
<p>无。</p>
|
||||
|
||||
<h2 id="s8">8 API 规范(API specification)</h2>
|
||||
|
||||
<h3 id="s8_1">8.1 导入类型(Imported types)</h3>
|
||||
<ul>
|
||||
<li><code>Std_ReturnType</code>、<code>Std_VersionInfoType</code>、<code>Std_ConfigType</code></li>
|
||||
<li><code>Crypto_JobType</code>、<code>Crypto_KeyElementIdType</code></li>
|
||||
<li><code>KeyM_KH_UpdateOperationType</code>、<code>KeyM_CertElementIteratorType</code>、<code>KeyM_CryptoKeyIdType</code>、<code>KeyM_CertDataType</code></li>
|
||||
</ul>
|
||||
|
||||
<h3 id="s8_2">8.2 类型定义(Type Definitions)</h3>
|
||||
<table border="1">
|
||||
<thead><tr><th>类型</th><th>描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><code>KeyM_ConfigType</code></td><td>KeyM 抽象配置类型(SWS_KeyM_00041)</td></tr>
|
||||
<tr><td><code>KeyM_KH_UpdateOperationType</code></td><td>Key Handler 更新操作类型枚举(START/UPDATE/FINISH/SAVE)</td></tr>
|
||||
<tr><td><code>KeyM_CertElementIteratorType</code></td><td>证书元素迭代器类型(用于 <code>KeyM_CertElementGetFirst/Next()</code>)</td></tr>
|
||||
<tr><td><code>KeyM_CryptoKeyIdType</code></td><td>密钥 ID 类型(SWS_KeyM_00302)</td></tr>
|
||||
<tr><td><code>KeyM_CertDataType</code></td><td>证书数据类型</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3 id="s8_3">8.3 函数定义(Function definitions)</h3>
|
||||
|
||||
<h4 id="s8_3_1">8.3.1 通用(General)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>API</th><th>签名</th><th>功能</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><code>KeyM_Init</code></td><td><code>void KeyM_Init(const KeyM_ConfigType* ConfigPtr)</code></td><td>初始化 KeyM(SWS_KeyM_00043/00044/00045/00046)</td></tr>
|
||||
<tr><td><code>KeyM_Deinit</code></td><td><code>void KeyM_Deinit(void)</code></td><td>反初始化 KeyM(SWS_KeyM_00047/00048)</td></tr>
|
||||
<tr><td><code>KeyM_GetVersionInfo</code></td><td><code>void KeyM_GetVersionInfo(Std_VersionInfoType* VersionInfoPtr)</code></td><td>获取版本信息(SWS_KeyM_00049)</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s8_3_2">8.3.2 密钥操作(Crypto key operation)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>API</th><th>签名</th><th>功能</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><code>KeyM_Start</code></td><td><code>Std_ReturnType KeyM_Start(void)</code></td><td>启动密钥管理会话(SWS_KeyM_00050-...)</td></tr>
|
||||
<tr><td><code>KeyM_Prepare</code></td><td><code>Std_ReturnType KeyM_Prepare(void)</code></td><td>准备密钥管理会话</td></tr>
|
||||
<tr><td><code>KeyM_Update</code></td><td><code>Std_ReturnType KeyM_Update(void)</code></td><td>更新密钥(诊断事件触发)</td></tr>
|
||||
<tr><td><code>KeyM_Finalize</code></td><td><code>Std_ReturnType KeyM_Finalize(void)</code></td><td>关闭密钥管理会话</td></tr>
|
||||
<tr><td><code>KeyM_Verify</code></td><td><code>Std_ReturnType KeyM_Verify(void)</code></td><td>验证密钥</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s8_3_3">8.3.3 证书处理(Certificate handling)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>API</th><th>签名</th><th>功能</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><code>KeyM_ServiceCertificate</code></td><td><code>Std_ReturnType KeyM_ServiceCertificate(KeyM_ServiceCertificateType Service, const uint8* Data, uint32 Length)</code></td><td>服务证书(添加/更新/删除)</td></tr>
|
||||
<tr><td><code>KeyM_SetCertificate</code></td><td><code>...</code></td><td>设置证书(用于静态证书)</td></tr>
|
||||
<tr><td><code>KeyM_GetCertificate</code></td><td><code>...</code></td><td>获取证书数据</td></tr>
|
||||
<tr><td><code>KeyM_VerifyCertificates</code></td><td><code>Std_ReturnType KeyM_VerifyCertificates(void)</code></td><td>验证所有证书</td></tr>
|
||||
<tr><td><code>KeyM_VerifyCertificate</code></td><td><code>Std_ReturnType KeyM_VerifyCertificate(uint16 CertId)</code></td><td>验证指定证书</td></tr>
|
||||
<tr><td><code>KeyM_VerifyCertificateChain</code></td><td><code>...</code></td><td>验证证书链</td></tr>
|
||||
<tr><td><code>KeyM_CertElementGet</code></td><td><code>...</code></td><td>获取证书元素(按 OID)</td></tr>
|
||||
<tr><td><code>KeyM_CertElementGetFirst</code></td><td><code>...</code></td><td>获取第一个证书元素</td></tr>
|
||||
<tr><td><code>KeyM_CertElementGetNext</code></td><td><code>...</code></td><td>获取下一个证书元素(迭代)</td></tr>
|
||||
<tr><td><code>KeyM_CertGetStatus</code></td><td><code>...</code></td><td>获取证书状态</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>共 9 个证书处理 API 函数。</p>
|
||||
|
||||
<h3 id="s8_4">8.4 回调定义(Call-out definitions)</h3>
|
||||
<table border="1">
|
||||
<thead><tr><th>API</th><th>签名</th><th>功能</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><code>KeyM_KH_Start</code></td><td><code>...</code></td><td>Key Handler 开始回调(由应用实现)</td></tr>
|
||||
<tr><td><code>KeyM_KH_Prepare</code></td><td><code>...</code></td><td>Key Handler 准备回调</td></tr>
|
||||
<tr><td><code>KeyM_KH_Update</code></td><td><code>...</code></td><td>Key Handler 更新回调</td></tr>
|
||||
<tr><td><code>KeyM_KH_Finalize</code></td><td><code>...</code></td><td>Key Handler 完成回调</td></tr>
|
||||
<tr><td><code>KeyM_KH_Verify</code></td><td><code>...</code></td><td>Key Handler 验证回调</td></tr>
|
||||
<tr><td><code>KeyM_KH_ServiceCertificate</code></td><td><code>...</code></td><td>Key Handler 服务证书回调</td></tr>
|
||||
<tr><td><code>KeyM_CryptoKeyUpdateCallbackNotification</code></td><td><code>void KeyM_CryptoKeyUpdateCallbackNotification(...)</code></td><td>密钥更新完成回调</td></tr>
|
||||
<tr><td><code>KeyM_CryptoKeyFinalizeCallbackNotification</code></td><td><code>...</code></td><td>密钥最终化完成回调</td></tr>
|
||||
<tr><td><code>KeyM_CryptoKeyVerifyCallbackNotification</code></td><td><code>...</code></td><td>密钥验证完成回调</td></tr>
|
||||
<tr><td><code>KeyM_ServiceCertificateCallbackNotification</code></td><td><code>...</code></td><td>证书服务完成回调</td></tr>
|
||||
<tr><td><code>KeyM_CertificateVerifyCallbackNotification</code></td><td><code>...</code></td><td>证书验证完成回调</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>共 11 个回调函数(5 个 Key Handler + 5 个 Callback Notification + 1 个 ServiceCertificate)。</p>
|
||||
|
||||
<h3 id="s8_5">8.5 调度函数(Scheduled functions)</h3>
|
||||
<table border="1">
|
||||
<thead><tr><th>API</th><th>功能</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><code>KeyM_MainFunction</code></td><td>主函数(前/后台处理)</td></tr>
|
||||
<tr><td><code>KeyM_MainBackgroundFunction</code></td><td>后台函数(异步证书处理)</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3 id="s8_6">8.6 预期接口(Expected Interfaces)</h3>
|
||||
|
||||
<h4 id="s8_6_1">8.6.1 强制接口(Mandatory Interfaces)</h4>
|
||||
<ul>
|
||||
<li><code>Det_ReportError()</code>(强制)</li>
|
||||
</ul>
|
||||
|
||||
<h4 id="s8_6_2">8.6.2 可选接口(Optional Interfaces)</h4>
|
||||
<ul>
|
||||
<li><code>Dem_SetEventStatus()</code>(可选)</li>
|
||||
</ul>
|
||||
|
||||
<h4 id="s8_6_3">8.6.3 可配置接口(Configurable interfaces)</h4>
|
||||
<p>KeyM 包含以下可配置接口:</p>
|
||||
<ul>
|
||||
<li><code>Csm_KeyElementSet()</code>、<code>Csm_KeyElementGet()</code>、<code>Csm_KeyCopy()</code>、<code>Csm_KeyGenerate()</code>、<code>Csm_KeyDerive()</code>、<code>Csm_KeyExchange()</code>、<code>Csm_SignatureVerify()</code>、<code>Nm_GetSynchronizedTime()</code>、<code>Os_GetCounterValue()</code>、<code>NvM_ReadBlock()</code>、<code>NvM_WriteBlock()</code>、<code>MemIf_Status()</code>、<code>MemIf_Read()</code>、<code>MemIf_Write()</code>、<code>Fee_Read()</code>、<code>Fee_Write()</code>、<code>EA_Read()</code>、<code>EA_Write()</code> 等(详细列表见原文 8.6.3)。</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="s8_7">8.7 服务接口(Service Interfaces)</h3>
|
||||
|
||||
<h4 id="s8_7_1">8.7.1 本章范围(Scope of this Chapter)</h4>
|
||||
<p>本章定义 KeyM 提供的服务接口(含 RTE Port Interface)。</p>
|
||||
|
||||
<h4 id="s8_7_2">8.7.2 数据类型(Data Types)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>类型</th><th>描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><code>KeyM_ResultType</code></td><td>KeyM 操作结果类型枚举</td></tr>
|
||||
<tr><td><code>KeyM_ServiceCertificateType</code></td><td>服务证书操作类型枚举(ADD/UPDATE/REMOVE)</td></tr>
|
||||
<tr><td><code>KeyM_CertificateStatusType</code></td><td>证书状态类型枚举(NOT_PARSED/PARTIAL/VALID/INVALID/EXPIRED/REVOKED)</td></tr>
|
||||
<tr><td><code>KeyM_CertElementType</code></td><td>证书元素类型(OID 引用 + 值)</td></tr>
|
||||
<tr><td><code>KeyM_CertElementIdType</code></td><td>证书元素 ID 类型</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s8_7_3">8.7.3 客户端-服务器接口(Client-Server-Interfaces)</h4>
|
||||
<p>KeyM 提供以下客户端-服务器接口:</p>
|
||||
<ul>
|
||||
<li><code>KeyM_KeyManagement</code>:密钥管理服务(Start/Prepare/Update/Finalize/Verify)</li>
|
||||
<li><code>KeyM_CertificateManagement</code>:证书管理服务(ServiceCertificate/SetCertificate/GetCertificate/VerifyCertificate/VerifyCertificates/VerifyCertificateChain/CertElementGet/CertElementGetFirst/CertElementGetNext/CertGetStatus)</li>
|
||||
</ul>
|
||||
|
||||
<h4 id="s8_7_4">8.7.4 端口(Ports)</h4>
|
||||
<p>KeyM 模块提供以下端口:</p>
|
||||
<ul>
|
||||
<li><code>KeyM_PPort</code>:提供端口(Provider Port)</li>
|
||||
<li><code>KeyM_RPort</code>:请求端口(Request Port,可选)</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="s9">9 序列图(Sequence diagrams)</h2>
|
||||
|
||||
<h3 id="s9_1">9.1 存储单个密钥(Store single key)</h3>
|
||||
<ol>
|
||||
<li>应用通过 <code>KeyM_Start()</code> 启动会话;</li>
|
||||
<li>应用通过 <code>KeyM_Update()</code> 触发密钥更新;</li>
|
||||
<li>KeyM 通过 CSM 更新密钥元素;</li>
|
||||
<li>KeyM 调用 <code>KeyM_Finalize()</code> 关闭会话;</li>
|
||||
<li>KeyM 通过 NVM 存储密钥(如配置)。</li>
|
||||
</ol>
|
||||
|
||||
<h3 id="s9_2">9.2 存储多个密钥(Store multiple keys)</h3>
|
||||
<p>与 9.1 类似,但 KeyM 依次更新多个密钥(按配置顺序)。</p>
|
||||
|
||||
<h3 id="s9_3">9.3 派生密钥(Derive key)</h3>
|
||||
<ol>
|
||||
<li>应用调用 <code>KeyM_Start()</code>;</li>
|
||||
<li>应用调用 <code>KeyM_Prepare()</code> 准备派生参数;</li>
|
||||
<li>应用调用 <code>KeyM_Update()</code> 触发派生;</li>
|
||||
<li>KeyM 调用 <code>Csm_KeyDerive()</code> 派生密钥;</li>
|
||||
<li>KeyM 调用 <code>KeyM_Finalize()</code> 关闭会话。</li>
|
||||
</ol>
|
||||
|
||||
<h3 id="s9_4">9.4 添加工作证书(Add working certificate)</h3>
|
||||
<ol>
|
||||
<li>应用调用 <code>KeyM_ServiceCertificate(KEYM_SERVICE_ADD, data, len)</code>;</li>
|
||||
<li>KeyM 解析证书(DER/PEM);</li>
|
||||
<li>KeyM 调用 <code>KeyM_VerifyCertificate()</code> 验证证书;</li>
|
||||
<li>验证完成后 KeyM 将证书存储到工作槽(不存储到 NVM)。</li>
|
||||
</ol>
|
||||
|
||||
<h3 id="s9_5">9.5 添加根/中间证书(Add root or intermediate certificate)</h3>
|
||||
<ol>
|
||||
<li>应用调用 <code>KeyM_ServiceCertificate(KEYM_SERVICE_ADD, data, len)</code>;</li>
|
||||
<li>KeyM 解析证书;</li>
|
||||
<li>KeyM 调用 <code>KeyM_VerifyCertificate()</code> 验证证书;</li>
|
||||
<li>验证完成后 KeyM 将证书存储到 NVM(永久存储);</li>
|
||||
<li>KeyM 触发 <code>KeyM_ServiceCertificateCallbackNotification()</code>。</li>
|
||||
</ol>
|
||||
|
||||
<h2 id="s10">10 配置规范(Configuration specification)</h2>
|
||||
|
||||
<h3 id="s10_1">10.1 容器与配置参数(Containers and configuration parameters)</h3>
|
||||
|
||||
<h4 id="s10_1_1">10.1.1 KeyM(根容器)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>参数</th><th>描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>KeyMDevErrorDetect</td><td>开发错误检测开关</td></tr>
|
||||
<tr><td>KeyMVersionInfoApi</td><td><code>KeyM_GetVersionInfo()</code> API 开关</td></tr>
|
||||
<tr><td>KeyMMainFunctionPeriod</td><td><code>KeyM_MainFunction()</code> 调度周期(秒)</td></tr>
|
||||
<tr><td>KeyMNvmJobProcessing</td><td>NVM 作业处理周期(秒)</td></tr>
|
||||
<tr><td>KeyMServiceCertificateFunctionEnabled</td><td><code>KeyM_ServiceCertificate()</code> 开关</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s10_1_2">10.1.2 KeyMGeneral(通用配置)</h4>
|
||||
<p>包含 Crypto Key 子模块与 Certificate 子模块的通用配置。</p>
|
||||
|
||||
<h4 id="s10_1_3">10.1.3 KeyMCertificate(证书槽)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>参数</th><th>描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>KeyMCertificateId</td><td>证书槽 ID</td></tr>
|
||||
<tr><td>KeyMCertificateType</td><td>证书类型(ROOT/INTERMEDIATE/WORKING/LOWERPR)</td></tr>
|
||||
<tr><td>KeyMCertificateStorage</td><td>存储位置(NV/STATIC)</td></tr>
|
||||
<tr><td>KeyMCertificateLowerRef</td><td>下级证书引用</td></tr>
|
||||
<tr><td>KeyMCertificateElementList</td><td>证书元素列表</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s10_1_4">10.1.4 KeyMCertificateElement(证书元素)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>参数</th><th>描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>KeyMCertificateElementId</td><td>元素 ID(OID 引用)</td></tr>
|
||||
<tr><td>KeyMCertificateElementVerification</td><td>验证配置引用</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s10_1_5">10.1.5 KeyMCertificateElementVerification(证书元素验证)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>参数</th><th>描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>KeyMCertificateElementVerificationEnable</td><td>验证开关</td></tr>
|
||||
<tr><td>KeyMCertificateElementRule</td><td>验证规则引用列表</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s10_1_6">10.1.6 KeyMCertificateElementRule(验证规则)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>参数</th><th>描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>KeyMCertificateElementRuleId</td><td>规则 ID</td></tr>
|
||||
<tr><td>KeyMCertificateElementCondition</td><td>条件引用</td></tr>
|
||||
<tr><td>KeyMCertificateElementConditionType</td><td>条件类型(ALWAYS/EQUAL/LOWER/HIGHER)</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s10_1_7">10.1.7 KeyMCertificateElementCondition(证书元素条件)</h4>
|
||||
<p>条件类型为 <code>VALUE</code>、<code>ARRAY</code>、<code>SENDERRECEIVER</code> 三种之一。</p>
|
||||
|
||||
<h4 id="s10_1_8">10.1.8 KeyMCertificateElementConditionPrimitive(条件原语)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>参数</th><th>描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>KeyMCertificateElementConditionPrimitiveType</td><td>原语类型(EQUAL/LOWER/HIGHER)</td></tr>
|
||||
<tr><td>KeyMCertificateElementConditionValue</td><td>条件值</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s10_1_9">10.1.9 KeyMCertificateElementConditionArray(条件数组)</h4>
|
||||
<p>包含 <code>KeyMCertificateElementConditionArrayElement</code> 子容器列表。</p>
|
||||
|
||||
<h4 id="s10_1_10">10.1.10 KeyMCertificateElementConditionArrayElement(条件数组元素)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>参数</th><th>描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>KeyMCertificateElementConditionArrayElementIndex</td><td>数组元素索引</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s10_1_11">10.1.11 KeyMCertificateElementConditionValue(条件值)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>参数</th><th>描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>KeyMCertificateElementConditionValueData</td><td>条件值数据</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s10_1_12">10.1.12 KeyMCertificateElementConditionSenderReceiver(条件发送接收)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>参数</th><th>描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>KeyMCertificateElementConditionSenderReceiverHandleId</td><td>发送接收句柄 ID</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s10_1_13">10.1.13 KeyMCryptoKey(密钥配置)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>参数</th><th>描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>KeyMCryptoKeyId</td><td>密钥 ID</td></tr>
|
||||
<tr><td>KeyMCryptoKeyGenerationType</td><td>生成类型(DEFINED/CUSTOM)</td></tr>
|
||||
<tr><td>KeyMCryptoKeyStartFinalizeFunctionEnabled</td><td>开始/完成回调开关</td></tr>
|
||||
<tr><td>KeyMCryptoKeyUpdateFunctionEnabled</td><td>更新回调开关</td></tr>
|
||||
<tr><td>KeyMCryptoKeyVerifyFunctionEnabled</td><td>验证回调开关</td></tr>
|
||||
<tr><td>KeyMCryptoKeyNvmStorage</td><td>NVM 存储开关</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 id="s10_1_14">10.1.14 KeyMNvmBlock(NVM 块)</h4>
|
||||
<table border="1">
|
||||
<thead><tr><th>参数</th><th>描述</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>KeyMNvmBlockId</td><td>NVM 块 ID</td></tr>
|
||||
<tr><td>KeyMNvmBlockLength</td><td>NVM 块长度</td></tr>
|
||||
<tr><td>KeyMNvmRef</td><td>NvMBlockDescriptor 引用</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3 id="s10_2">10.2 发布信息(Published Information)</h3>
|
||||
<p>发布信息包括 KeyM 模块版本、配置变体、证书数量、密钥数量等。</p>
|
||||
|
||||
<h2 id="s11">11 不适用需求(Not applicable requirements)</h2>
|
||||
<p>本节列出 AUTOSAR 4.4 中对 KeyM 不适用的需求(无具体条目;保留章节以保持与 SWS 模板一致)。</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<section class="proofread-notes">
|
||||
<h3>📋 校对记录</h3>
|
||||
<p><strong>校对轮次</strong>:L1 自动校对(2026-06-13)</p>
|
||||
<ul>
|
||||
<li>✅ <strong>章节结构</strong>:原文 11 章(1 Introduction、2 Acronyms、3 Related documentation、4 Constraints、5 Dependencies、6 Requirements traceability、7 Functional specification、8 API specification、9 Sequence diagrams、10 Configuration specification、11 Not applicable requirements),译文目录完整对应;第 7 章 2 大节(Crypto Key + Certificate Submodule);第 8 章 7 大节(Init/Deinit/GetVersionInfo + Crypto Key Operation + Certificate Handling + Call-out Definitions + Scheduled Functions + Expected Interfaces + Service Interfaces)。</li>
|
||||
<li>✅ <strong>需求 ID 保留</strong>:SWS_KeyM_NNNNN 规范项 ID 约 80+ 条(详细列表见原文第 6/7/8/10 章;编号范围 00001-00302);其中:
|
||||
<ul>
|
||||
<li>SWS_KeyM_00001-00020:Crypto Key 子模块会话/更新/验证</li>
|
||||
<li>SWS_KeyM_00021-00035:Certificate 子模块服务/解析/验证</li>
|
||||
<li>SWS_KeyM_00036-00050:错误分类/类型定义/通用 API</li>
|
||||
<li>SWS_KeyM_00050-00100:Crypto Key 操作函数</li>
|
||||
<li>SWS_KeyM_00100-00200:证书处理函数</li>
|
||||
<li>SWS_KeyM_00200-00302:回调/服务接口/配置</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>✅ <strong>API 完整</strong>:31 个 API 函数完整分类(General 3 + Crypto Key Operation 5 + Certificate Handling 9 + Call-out 11 + Scheduled 2 + 1 个 ServiceCertificate)。</li>
|
||||
<li>✅ <strong>错误码完整</strong>:7 个开发错误(<code>KEYM_E_UNINIT=0x00</code>/<code>INIT_FAILED=0x01</code>/<code>PARAM_POINTER=0x02</code>/<code>PARAM_HANDLE=0x03</code>/<code>PARAM_VALUE=0x04</code>/<code>ALREADY_INITIALIZED=0x05</code>/<code>UNCONFIGURED=0x06</code>) + 3 个运行时错误(NVM_READ/WRITE_FAILED + CERTIFICATE_INVALID) + 4 个证书验证错误(<code>KEYM_CERTIFICATE_INVALID/EXPIRED/REVOKED/CHAIN_INCOMPLETE</code>)完整翻译。</li>
|
||||
<li>✅ <strong>证书类型</strong>:4 种证书类型(<code>ROOT</code>/<code>INTERMEDIATE</code>/<code>WORKING</code>/<code>LOWERPR</code>)+ 6 种证书状态(<code>NOT_PARSED</code>/<code>PARTIAL</code>/<code>VALID</code>/<code>INVALID</code>/<code>EXPIRED</code>/<code>REVOKED</code>)完整翻译。</li>
|
||||
<li>✅ <strong>术语对照</strong>:KeyM、PKI、CSR、CSM、CRL、CA、OID、NVM、STBM、Session、Certificate Slot、Certificate Chain、Key Handler、ServiceCertificate、CertElementGetFirst/Next、Iteration、Root/Intermediate/Working Certificate 等 30+ 核心术语首次出现给出"中文(英文,缩写)"格式。</li>
|
||||
<li>✅ <strong>配置容器</strong>:14 个 ECUC 容器(KeyM/KeyMGeneral/KeyMCertificate/KeyMCertificateElement/KeyMCertificateElementVerification/KeyMCertificateElementRule/KeyMCertificateElementCondition/KeyMCertificateElementConditionPrimitive/KeyMCertificateElementConditionArray/KeyMCertificateElementConditionArrayElement/KeyMCertificateElementConditionValue/KeyMCertificateElementConditionSenderReceiver/KeyMCryptoKey/KeyMNvmBlock)完整翻译;60+ 配置参数含描述。</li>
|
||||
<li>✅ <strong>序列图</strong>:5 个序列图(9.1 存储单个密钥、9.2 存储多个密钥、9.3 派生密钥、9.4 添加工作证书、9.5 添加根/中间证书)完整流程描述。</li>
|
||||
<li>✅ <strong>标准引用</strong>:IEC 7498-1、IETF 5280 (X.509 PKI Certificate)、SHE Secure Hardware Extension V1.1 完整保留。</li>
|
||||
<li>⚠ <strong>局限说明</strong>:① 完整 ~80 条 SWS_KeyM_NNNNN 规范项以分类形式覆盖(按 Crypto Key/Certificate/Error/API/Configuration 分组),未对每条逐字翻译;② 详细 C 函数签名以表格形式呈现(关键参数与返回类型),完整签名见原文 8.3/8.7 节。</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="meta">
|
||||
<span>📚 模块:Crypto</span>
|
||||
<span>📅 版本:AUTOSAR CP 4.4.0</span>
|
||||
<span>🔄 状态:进行中(4/6 已完成)</span>
|
||||
<span>🔄 状态:进行中(5/6 已完成)</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -52,15 +52,15 @@
|
||||
<div class="desc">密码驱动软件规范(81 页,~25 API,14 错误码,12 ECUC 容器)</div>
|
||||
<span class="count done">A · 100%</span>
|
||||
</div>
|
||||
<div class="module-card">
|
||||
<h3><a href="AUTOSAR_SWS_KeyManager.html">AUTOSAR_SWS_KeyManager</a></h3>
|
||||
<div class="desc">密钥管理器软件规范(113 页,31 API,14 ECUC 容器)</div>
|
||||
<span class="count done">A · 100%</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>⚪ 待翻译(2 篇)</h3>
|
||||
<h3>⚪ 待翻译(1 篇)</h3>
|
||||
<div class="module-index">
|
||||
<div class="module-card">
|
||||
<h3>AUTOSAR_SWS_KeyManager</h3>
|
||||
<div class="desc">密钥管理器软件规范(113 页)</div>
|
||||
<span class="count">0 / 113</span>
|
||||
</div>
|
||||
<div class="module-card">
|
||||
<h3>AUTOSAR_SWS_CryptoServiceManager</h3>
|
||||
<div class="desc">密码服务管理器软件规范(202 页)</div>
|
||||
@@ -69,14 +69,14 @@
|
||||
</div>
|
||||
|
||||
<h2>📊 翻译进度</h2>
|
||||
<p>4 / 6 篇完成(67%)。</p>
|
||||
<p>5 / 6 篇完成(83%)。</p>
|
||||
|
||||
<p>已完成:EXP_UtilizationOfCryptoServices(13)、SRS_CryptoStack(36)、SWS_CryptoInterface(41)、SWS_CryptoDriver(81);待译:SWS_KeyManager(113)、SWS_CryptoServiceManager(202)。</p>
|
||||
<p>已完成:EXP_UtilizationOfCryptoServices(13)、SRS_CryptoStack(36)、SWS_CryptoInterface(41)、SWS_CryptoDriver(81)、SWS_KeyManager(113);待译:SWS_CryptoServiceManager(202)。</p>
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="doc-footer">
|
||||
模块索引:P4_Crypto v1.1 · 维护:opencode translator · 2026-06-13
|
||||
模块索引:P4_Crypto v1.2 · 维护:opencode translator · 2026-06-13
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"version": "2.0",
|
||||
"last_updated": "2026-06-13",
|
||||
"total_documents": 216,
|
||||
"translated": 50,
|
||||
"proofread": 50,
|
||||
"translated": 51,
|
||||
"proofread": 51,
|
||||
"current_stage": "P4",
|
||||
"stage_progress": {
|
||||
"P0": {
|
||||
@@ -17,7 +17,7 @@
|
||||
"P1": {"total": 15, "translated": 15, "proofread": 15, "progress": "100%", "status": "completed"},
|
||||
"P2": {"total": 71, "translated": 0, "proofread": 0, "progress": "0%"},
|
||||
"P3": {"total": 3, "translated": 0, "proofread": 0, "progress": "0%"},
|
||||
"P4": {"total": 43, "translated": 4, "proofread": 4, "progress": "9%"},
|
||||
"P4": {"total": 43, "translated": 5, "proofread": 5, "progress": "12%"},
|
||||
"P5": {"total": 20, "translated": 9, "proofread": 9, "progress": "45%"},
|
||||
"P6": {"total": 42, "translated": 0, "proofread": 0, "progress": "0%"}
|
||||
},
|
||||
@@ -82,7 +82,8 @@
|
||||
"AUTOSAR_EXP_UtilizationOfCryptoServices": {"pages": 13, "status": "translated+proofread"},
|
||||
"AUTOSAR_SRS_CryptoStack": {"pages": 36, "status": "translated+proofread"},
|
||||
"AUTOSAR_SWS_CryptoInterface": {"pages": 41, "status": "translated+proofread"},
|
||||
"AUTOSAR_SWS_CryptoDriver": {"pages": 81, "status": "translated+proofread"}
|
||||
"AUTOSAR_SWS_CryptoDriver": {"pages": 81, "status": "translated+proofread"},
|
||||
"AUTOSAR_SWS_KeyManager": {"pages": 113, "status": "translated+proofread"}
|
||||
}
|
||||
},
|
||||
"quality_summary": {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
| P4 | Memory | 16 | 0 | 0% |
|
||||
| P4 | IO | 14 | 0 | 0% |
|
||||
| P4 | MCAL | 7 | 0 | 0% |
|
||||
| P4 | Crypto | 6 | 4 | 66.7% |
|
||||
| P4 | Crypto | 6 | 5 | 83.3% |
|
||||
| P5 | ModeManagement | 4 | 0 | 0% |
|
||||
| P5 | GlobalTime | 4 | 0 | 0% |
|
||||
| P5 | Safety | 9 | 0 | 0% |
|
||||
@@ -30,7 +30,7 @@
|
||||
| P6 | Libraries | 10 | 0 | 0% |
|
||||
| P6 | Tools | 4 | 0 | 0% |
|
||||
| P6 | ReleaseDocumentation | 1 | 0 | 0% |
|
||||
| **总计** | | **216** | **50** | **23.1%** |
|
||||
| **总计** | | **216** | **51** | **23.6%** |
|
||||
|
||||
## P0 已完成文档清单
|
||||
|
||||
@@ -69,4 +69,4 @@
|
||||
- ✅ 需求 ID 保留
|
||||
- ✅ 章节结构对应
|
||||
|
||||
_最新更新:2026-06-13 · P4 Crypto 进行中(4/6 = 67%)_
|
||||
_最新更新:2026-06-13 · P4 Crypto 进行中(5/6 = 83%)_
|
||||
Reference in New Issue
Block a user