跳到主要内容

3. Constructing Unsigned Certificates

本节说明如何构造 unsigned certificates, 包括 signatureAlgorithm, signatureValue, issuer 和相关 extensions 的处理要求.

RFC 文本

3.  构造未签名证书

本节描述发送方如何构造 unsigned certificate.

3.1. 签名

为构造 unsigned X.509 certificate, 发送方 MUST 将 Certificate 的
signatureAlgorithm 字段和 TBSCertificate 的 signature 字段分别设置为
AlgorithmIdentifier, 其 algorithm 为 id-alg-unsigned, 定义如下:

id-alg-unsigned OBJECT IDENTIFIER ::= {1 3 6 1 5 5 7 6 36}

id-alg-unsigned 的 parameters MUST 省略. Certificate 的
signatureValue 字段 MUST 是长度为零的 BIT STRING.

3.2. 签发者

在应用程序只需要主体信息的场景中, unsigned certificate 会取代
self-signed certificate. 它没有签发者, 因此 [RFC5280] 中定义的
profile 的某些要求无法有意义地应用. 不过, 应用程序可能已有源自
[X.509] 和 [RFC5280] 的既有要求, 因此, 如互操作性需要, 发送方 MAY
像构造 self-signed certificate 一样构造该证书.

具体而言, 以下字段描述证书的签发者:

* issuer ([RFC5280] 第 4.1.2.4 节)

* issuerUniqueID ([RFC5280] 第 4.1.2.8 节)

issuer 字段不是可选字段, 且 [X.509] 和 [RFC5280] 第 4.1.2.4 节都
禁止空签发者, 因此这样的值可能无法与现有应用程序互操作.

如果 subject 非空, 发送方 MAY 将 issuer 设置为 subject, 类似于构造
self-signed certificate 的方式. 这可能适用于某些应用程序, 例如这些
应用程序期望信任锚具有匹配的 issuer 和 subject. 但这是一个
placeholder 值. 该 unsigned certificate 不被视为 self-signed 或
self-issued.

发送方 MAY 改为使用一个较短的 placeholder issuer, 它由单个
relative distinguished name 组成; 该 relative distinguished name
具有单个属性, 其 type 为 id-rdna-unsigned, value 为长度为零的
UTF8String. id-rdna-unsigned 定义如下:

id-rdna-unsigned OBJECT IDENTIFIER ::= {1 3 6 1 5 5 7 25 1}

在 [RFC4514] 的字符串表示中, 该 placeholder name 为:

1.3.6.1.5.5.7.25.1=#0C00

发送方 MUST 省略 issuerUniqueID 字段, 因为该字段是可选的, 不适用于
此场景, 并且已被 [RFC5280] 第 4.1.2.8 节禁止.

3.3. 扩展

某些 X.509 extensions 也描述证书签发者, 因此对 unsigned certificate
没有意义:

* authority key identifier ([RFC5280] 第 4.2.1.1 节)

* issuer alternative name ([RFC5280] 第 4.2.1.7 节)

发送方 SHOULD 省略 authority key identifier 和 issuer alternative name
extensions. [RFC5280] 第 4.2.1.1 节要求证书包含 authority key
identifier, 但允许在分发公钥时使用的 self-signed certificates 例外.
本文档更新 [RFC5280], 也允许在 unsigned certificates 中省略 authority
key identifier.

某些 extensions 反映主体是 CA 还是终端实体:

* key usage ([RFC5280] 第 4.2.1.3 节)

* basic constraints ([RFC5280] 第 4.2.1.9 节)

发送方 SHOULD 填写这些值以反映主体. 也就是说:

* 如果 subject 是 CA, 则 SHOULD 声明 keyCertSign key usage bit, 并
SHOULD 包含一个将 cA boolean 设置为 TRUE 的 basic constraints
extension.

* 如果 subject 是终端实体, 则 SHOULD NOT 声明 keyCertSign key usage
bit, 并且 SHOULD 省略 basic constraints extension, 或将 cA boolean
设置为 FALSE. 与 self-signed certificate 不同, unsigned certificate
不会签发自身, 因此无需在任一 extension 中适配 self-signature.