3.6 Certificate Payload (证书载荷)
3.6 Certificate Payload (证书载荷)
Certificate 载荷在本文档中记为 CERT, 提供通过 IKE 传送证书或其他与认证相关信息的手段. 若发送方持有证书, 交换中应该包含 Certificate 载荷. 若对等方已通过 HTTP_CERT_LOOKUP_SUPPORTED 通知表明能从别处获取此类信息, 宜使用 Certificate 载荷的 Hash 与 URL 形式. 注意 "Certificate 载荷" 一名略有误导: 并非所有认证机制都使用证书, 且本载荷也可承载非证书数据.
Certificate 载荷定义如下:
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Payload |C| RESERVED | Payload Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cert Encoding | |
+-+-+-+-+-+-+-+-+ |
~ Certificate Data ~
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 12: Certificate Payload Format
- Certificate Encoding (1 字节) - 指明 Certificate Data 字段中所含证书或证书相关信息的类型. 取值仅截至 RFC 4306 发布时有效, 此后可能已有新增. 读者应查阅 [IKEV2IANA] 获取最新取值.
| Certificate Encoding | Value | Note |
|---|---|---|
| PKCS #7 wrapped X.509 certificate | 1 | UNSPECIFIED |
| PGP Certificate | 2 | UNSPECIFIED |
| DNS Signed Key | 3 | UNSPECIFIED |
| X.509 Certificate - Signature | 4 | |
| Kerberos Token | 6 | UNSPECIFIED |
| Certificate Revocation List (CRL) | 7 | |
| Authority Revocation List (ARL) | 8 | UNSPECIFIED |
| SPKI Certificate | 9 | UNSPECIFIED |
| X.509 Certificate - Attribute | 10 | UNSPECIFIED |
| Deprecated (was Raw RSA Key) | 11 | DEPRECATED |
| Hash and URL of X.509 certificate | 12 | |
| Hash and URL of X.509 bundle | 13 |
- Certificate Data (变长) - 证书数据的实际编码. 证书类型由 Certificate Encoding 字段指明.
Certificate 载荷的载荷类型编号为三十七 (37).
上述部分证书类型代码的具体语法未在本文档定义. 本文档定义语法的类型如下:
-
"X.509 Certificate - Signature" 含 DER 编码的 X.509 证书, 其公钥用于校验发送方 AUTH 载荷. 注意使用本编码时, 若需发送证书链, 应使用多个 CERT 载荷, 仅第一个载荷持有用于校验发送方 AUTH 载荷的公钥.
-
"Certificate Revocation List" 含 DER 编码的 X.509 证书吊销列表.
-
Hash 与 URL 编码通过用被替换值的 20 字节 SHA-1 散列 (见 [FIPS.180-4.2012]) 加上可解析到 DER 结构本身的变长 URL 替换长数据结构, 从而缩短 IKE 消息. 当端点已缓存证书数据时可提高效率, 并降低 IKE 消息过大需 IP 分片时更易遭受的 DoS 风险 [DOSUDPPROT].
"Hash and URL of a bundle" 类型对 X.509 捆绑使用下列 ASN.1 定义:
CertBundle
{ iso(1) identified-organization(3) dod(6) internet(1)
security(5) mechanisms(5) pkix(7) id-mod(0)
id-mod-cert-bundle(34) }
DEFINITIONS EXPLICIT TAGS ::=
BEGIN
IMPORTS
Certificate, CertificateList
FROM PKIX1Explicit88
{ iso(1) identified-organization(3) dod(6)
internet(1) security(5) mechanisms(5) pkix(7)
id-mod(0) id-pkix1-explicit(18) } ;
CertificateOrCRL ::= CHOICE {
cert [0] Certificate,
crl [1] CertificateList }
CertificateBundle ::= SEQUENCE OF CertificateOrCRL
END
实现必须能够配置为在认证场景下最多发送并接受四份 X.509 证书, 且必须能够配置为发送并接受两种 Hash 与 URL 格式 (HTTP URL). 若发送多份证书, 第一份必须包含与用于签署 AUTH 载荷的私钥对应的公钥. 其余证书可按任意顺序发送.
实现必须支持基于 hash-and-URL 查询的 http: 方案. 其他 URL 方案 [URLS] 的行为目前未规定, 在未有文档专门规定之前不应使用.