461 lines
22 KiB
Markdown
461 lines
22 KiB
Markdown
# 03. RC(Resource Certificate:资源证书,CA/EE)
|
||
|
||
## 3.1 对象定位
|
||
|
||
资源证书(RC)是 X.509 v3 证书,遵循 PKIX profile(RFC 5280),并受 RPKI profile 进一步约束。RFC 6487 §4。
|
||
|
||
RC 在 RPKI 中至少分为两类语义用途:
|
||
|
||
- `CA 证书`:签发下级证书/CRL,并在 SIA 中声明发布点与 manifest。RFC 6487 §4.8.8.1。
|
||
- `EE 证书`:用于验证某个 RPKI Signed Object(如 ROA/MFT),在 SIA 中指向被验证对象。RFC 6487 §4.8.8.2。
|
||
|
||
## 3.2 原始载体与编码
|
||
|
||
- 载体:X.509 证书。
|
||
- 编码:DER。RFC 6487 §4(“valid X.509 public key certificate consistent with RFC 5280” + RPKI 限制)。
|
||
|
||
### 3.2.1 X.509 v3 证书基本语法(ASN.1;RFC 5280 §4.1)
|
||
|
||
资源证书在编码层面是 RFC 5280 定义的 X.509 v3 `Certificate`(DER),其中 `tbsCertificate` 携带主体字段与扩展集合(`Extensions`)。RFC 5280 §4.1。
|
||
|
||
```asn1
|
||
Certificate ::= SEQUENCE {
|
||
tbsCertificate TBSCertificate,
|
||
signatureAlgorithm AlgorithmIdentifier,
|
||
signatureValue BIT STRING }
|
||
|
||
TBSCertificate ::= SEQUENCE {
|
||
version [0] EXPLICIT Version DEFAULT v1,
|
||
serialNumber CertificateSerialNumber,
|
||
signature AlgorithmIdentifier,
|
||
issuer Name,
|
||
validity Validity,
|
||
subject Name,
|
||
subjectPublicKeyInfo SubjectPublicKeyInfo,
|
||
issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
|
||
-- If present, version MUST be v2 or v3
|
||
subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
|
||
-- If present, version MUST be v2 or v3
|
||
extensions [3] EXPLICIT Extensions OPTIONAL
|
||
-- If present, version MUST be v3
|
||
}
|
||
|
||
Version ::= INTEGER { v1(0), v2(1), v3(2) }
|
||
|
||
CertificateSerialNumber ::= INTEGER
|
||
|
||
Validity ::= SEQUENCE {
|
||
notBefore Time,
|
||
notAfter Time }
|
||
|
||
Time ::= CHOICE {
|
||
utcTime UTCTime,
|
||
generalTime GeneralizedTime }
|
||
|
||
UniqueIdentifier ::= BIT STRING
|
||
|
||
SubjectPublicKeyInfo ::= SEQUENCE {
|
||
algorithm AlgorithmIdentifier,
|
||
subjectPublicKey BIT STRING }
|
||
|
||
Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
|
||
|
||
Extension ::= SEQUENCE {
|
||
extnID OBJECT IDENTIFIER,
|
||
critical BOOLEAN DEFAULT FALSE,
|
||
extnValue OCTET STRING
|
||
-- contains the DER encoding of an ASN.1 value
|
||
-- corresponding to the extension type identified
|
||
-- by extnID
|
||
}
|
||
```
|
||
|
||
### 3.2.2 AlgorithmIdentifier(ASN.1;RFC 5280 §4.1.1.2)
|
||
|
||
```asn1
|
||
AlgorithmIdentifier ::= SEQUENCE {
|
||
algorithm OBJECT IDENTIFIER,
|
||
parameters ANY DEFINED BY algorithm OPTIONAL }
|
||
```
|
||
|
||
### 3.2.3 Name / DN 结构(ASN.1;RFC 5280 §4.1.2.4)
|
||
|
||
```asn1
|
||
Name ::= CHOICE { -- only one possibility for now --
|
||
rdnSequence RDNSequence }
|
||
|
||
RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
|
||
|
||
RelativeDistinguishedName ::=
|
||
SET SIZE (1..MAX) OF AttributeTypeAndValue
|
||
|
||
AttributeTypeAndValue ::= SEQUENCE {
|
||
type AttributeType,
|
||
value AttributeValue }
|
||
|
||
AttributeType ::= OBJECT IDENTIFIER
|
||
|
||
AttributeValue ::= ANY -- DEFINED BY AttributeType
|
||
|
||
DirectoryString ::= CHOICE {
|
||
teletexString TeletexString (SIZE (1..MAX)),
|
||
printableString PrintableString (SIZE (1..MAX)),
|
||
universalString UniversalString (SIZE (1..MAX)),
|
||
utf8String UTF8String (SIZE (1..MAX)),
|
||
bmpString BMPString (SIZE (1..MAX)) }
|
||
```
|
||
|
||
### 3.2.4 GeneralNames / GeneralName(ASN.1;RFC 5280 §4.2.1.6)
|
||
|
||
> 说明:RPKI 的 AIA/SIA/CRLDP 等扩展通常把 URI 编码在 `uniformResourceIdentifier [6] IA5String` 分支中。RFC 5280 §4.2.1.6。
|
||
|
||
```asn1
|
||
GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
|
||
|
||
GeneralName ::= CHOICE {
|
||
otherName [0] OtherName,
|
||
rfc822Name [1] IA5String,
|
||
dNSName [2] IA5String,
|
||
x400Address [3] ORAddress,
|
||
directoryName [4] Name,
|
||
ediPartyName [5] EDIPartyName,
|
||
uniformResourceIdentifier [6] IA5String,
|
||
iPAddress [7] OCTET STRING,
|
||
registeredID [8] OBJECT IDENTIFIER }
|
||
|
||
OtherName ::= SEQUENCE {
|
||
type-id OBJECT IDENTIFIER,
|
||
value [0] EXPLICIT ANY DEFINED BY type-id }
|
||
|
||
EDIPartyName ::= SEQUENCE {
|
||
nameAssigner [0] DirectoryString OPTIONAL,
|
||
partyName [1] DirectoryString }
|
||
```
|
||
|
||
### 3.2.5 AIA(Authority Information Access;ASN.1;RFC 5280 §4.2.2.1)
|
||
|
||
```asn1
|
||
id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
|
||
|
||
AuthorityInfoAccessSyntax ::=
|
||
SEQUENCE SIZE (1..MAX) OF AccessDescription
|
||
|
||
AccessDescription ::= SEQUENCE {
|
||
accessMethod OBJECT IDENTIFIER,
|
||
accessLocation GeneralName }
|
||
|
||
id-ad OBJECT IDENTIFIER ::= { id-pkix 48 }
|
||
|
||
id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 }
|
||
```
|
||
|
||
### 3.2.6 SIA(Subject Information Access;ASN.1;RFC 5280 §4.2.2.2)
|
||
|
||
```asn1
|
||
id-pe-subjectInfoAccess OBJECT IDENTIFIER ::= { id-pe 11 }
|
||
|
||
SubjectInfoAccessSyntax ::=
|
||
SEQUENCE SIZE (1..MAX) OF AccessDescription
|
||
|
||
AccessDescription ::= SEQUENCE {
|
||
accessMethod OBJECT IDENTIFIER,
|
||
accessLocation GeneralName }
|
||
|
||
id-ad OBJECT IDENTIFIER ::= { id-pkix 48 }
|
||
|
||
id-ad-caRepository OBJECT IDENTIFIER ::= { id-ad 5 }
|
||
```
|
||
|
||
### 3.2.7 RPKI 在 SIA 中新增/使用的 accessMethod OID(RFC 6487 §4.8.8.1 / §4.8.8.2;RFC 8182 §3.2)
|
||
|
||
> 说明:下列 OID 用于 `AccessDescription.accessMethod`,并放在 SIA 的 `extnValue` 内层结构中(其外层 extnID 仍为 SIA:`id-pe-subjectInfoAccess`)。RFC 6487 §4.8.8;RFC 8182 §3.2。
|
||
|
||
```asn1
|
||
id-ad OBJECT IDENTIFIER ::= { id-pkix 48 }
|
||
|
||
id-ad-rpkiManifest OBJECT IDENTIFIER ::= { id-ad 10 } -- 1.3.6.1.5.5.7.48.10
|
||
|
||
id-ad-signedObject OBJECT IDENTIFIER ::= { id-ad 11 } -- 1.3.6.1.5.5.7.48.11
|
||
|
||
id-ad-rpkiNotify OBJECT IDENTIFIER ::= { id-ad 13 } -- 1.3.6.1.5.5.7.48.13
|
||
```
|
||
|
||
### 3.2.8 CRLDistributionPoints(CRLDP;ASN.1;RFC 5280 §4.2.1.13)
|
||
|
||
```asn1
|
||
id-ce-cRLDistributionPoints OBJECT IDENTIFIER ::= { id-ce 31 }
|
||
|
||
CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
|
||
|
||
DistributionPoint ::= SEQUENCE {
|
||
distributionPoint [0] DistributionPointName OPTIONAL,
|
||
reasons [1] ReasonFlags OPTIONAL,
|
||
cRLIssuer [2] GeneralNames OPTIONAL }
|
||
|
||
DistributionPointName ::= CHOICE {
|
||
fullName [0] GeneralNames,
|
||
nameRelativeToCRLIssuer [1] RelativeDistinguishedName }
|
||
|
||
ReasonFlags ::= BIT STRING {
|
||
unused (0),
|
||
keyCompromise (1),
|
||
cACompromise (2),
|
||
affiliationChanged (3),
|
||
superseded (4),
|
||
cessationOfOperation (5),
|
||
certificateHold (6),
|
||
privilegeWithdrawn (7),
|
||
aACompromise (8) }
|
||
```
|
||
|
||
### 3.2.9 Certificate Policies(ASN.1;RFC 5280 §4.2.1.4)
|
||
|
||
```asn1
|
||
id-ce-certificatePolicies OBJECT IDENTIFIER ::= { id-ce 32 }
|
||
|
||
anyPolicy OBJECT IDENTIFIER ::= { id-ce-certificatePolicies 0 }
|
||
|
||
certificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation
|
||
|
||
PolicyInformation ::= SEQUENCE {
|
||
policyIdentifier CertPolicyId,
|
||
policyQualifiers SEQUENCE SIZE (1..MAX) OF
|
||
PolicyQualifierInfo OPTIONAL }
|
||
|
||
CertPolicyId ::= OBJECT IDENTIFIER
|
||
|
||
PolicyQualifierInfo ::= SEQUENCE {
|
||
policyQualifierId PolicyQualifierId,
|
||
qualifier ANY DEFINED BY policyQualifierId }
|
||
|
||
-- policyQualifierIds for Internet policy qualifiers
|
||
|
||
id-qt OBJECT IDENTIFIER ::= { id-pkix 2 }
|
||
id-qt-cps OBJECT IDENTIFIER ::= { id-qt 1 }
|
||
id-qt-unotice OBJECT IDENTIFIER ::= { id-qt 2 }
|
||
|
||
PolicyQualifierId ::= OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice )
|
||
|
||
Qualifier ::= CHOICE {
|
||
cPSuri CPSuri,
|
||
userNotice UserNotice }
|
||
|
||
CPSuri ::= IA5String
|
||
```
|
||
|
||
### 3.2.10 RFC 3779 IP/AS 资源扩展(ASN.1;RFC 3779 §2.2.1-§2.2.3;RFC 3779 §3.2.1-§3.2.3)
|
||
|
||
> 说明:RFC 3779 给出两个扩展的 OID 与 ASN.1 语法;它们作为 X.509 v3 扩展出现在 `extensions` 中(外层 extnID 为下列 OID)。RPKI profile 进一步约束 criticality/SAFI/RDI 等,见 RFC 6487 §4.8.10-§4.8.11。
|
||
|
||
```asn1
|
||
-- IP Address Delegation Extension
|
||
id-pe-ipAddrBlocks OBJECT IDENTIFIER ::= { id-pe 7 }
|
||
|
||
IPAddrBlocks ::= SEQUENCE OF IPAddressFamily
|
||
|
||
IPAddressFamily ::= SEQUENCE { -- AFI & optional SAFI --
|
||
addressFamily OCTET STRING (SIZE (2..3)),
|
||
ipAddressChoice IPAddressChoice }
|
||
|
||
IPAddressChoice ::= CHOICE {
|
||
inherit NULL, -- inherit from issuer --
|
||
addressesOrRanges SEQUENCE OF IPAddressOrRange }
|
||
|
||
IPAddressOrRange ::= CHOICE {
|
||
addressPrefix IPAddress,
|
||
addressRange IPAddressRange }
|
||
|
||
IPAddressRange ::= SEQUENCE {
|
||
min IPAddress,
|
||
max IPAddress }
|
||
|
||
IPAddress ::= BIT STRING
|
||
|
||
-- Autonomous System Identifier Delegation Extension
|
||
id-pe-autonomousSysIds OBJECT IDENTIFIER ::= { id-pe 8 }
|
||
|
||
ASIdentifiers ::= SEQUENCE {
|
||
asnum [0] EXPLICIT ASIdentifierChoice OPTIONAL,
|
||
rdi [1] EXPLICIT ASIdentifierChoice OPTIONAL}
|
||
|
||
ASIdentifierChoice ::= CHOICE {
|
||
inherit NULL, -- inherit from issuer --
|
||
asIdsOrRanges SEQUENCE OF ASIdOrRange }
|
||
|
||
ASIdOrRange ::= CHOICE {
|
||
id ASId,
|
||
range ASRange }
|
||
|
||
ASRange ::= SEQUENCE {
|
||
min ASId,
|
||
max ASId }
|
||
|
||
ASId ::= INTEGER
|
||
```
|
||
|
||
### 3.2.11 其它 RPKI profile 相关扩展的 ASN.1 定义(RFC 5280 §4.2.1.1-§4.2.1.3;RFC 5280 §4.2.1.9;RFC 5280 §4.2.1.12)
|
||
|
||
> 说明:这些是 RPKI 资源证书 profile(RFC 6487 §4.8)所引用的通用 PKIX 扩展语法。RPKI 对其“必须/禁止/criticality/字段允许性”有额外限制(见本文件 3.3/3.4),但编码层的 ASN.1 类型来自 RFC 5280。
|
||
|
||
```asn1
|
||
id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 35 }
|
||
|
||
AuthorityKeyIdentifier ::= SEQUENCE {
|
||
keyIdentifier [0] KeyIdentifier OPTIONAL,
|
||
authorityCertIssuer [1] GeneralNames OPTIONAL,
|
||
authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL }
|
||
|
||
KeyIdentifier ::= OCTET STRING
|
||
|
||
id-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 14 }
|
||
|
||
SubjectKeyIdentifier ::= KeyIdentifier
|
||
|
||
id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 }
|
||
|
||
KeyUsage ::= BIT STRING {
|
||
digitalSignature (0),
|
||
nonRepudiation (1), -- recent editions of X.509 have
|
||
-- renamed this bit to contentCommitment
|
||
keyEncipherment (2),
|
||
dataEncipherment (3),
|
||
keyAgreement (4),
|
||
keyCertSign (5),
|
||
cRLSign (6),
|
||
encipherOnly (7),
|
||
decipherOnly (8) }
|
||
|
||
id-ce-basicConstraints OBJECT IDENTIFIER ::= { id-ce 19 }
|
||
|
||
BasicConstraints ::= SEQUENCE {
|
||
cA BOOLEAN DEFAULT FALSE,
|
||
pathLenConstraint INTEGER (0..MAX) OPTIONAL }
|
||
|
||
id-ce-extKeyUsage OBJECT IDENTIFIER ::= { id-ce 37 }
|
||
|
||
ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
|
||
|
||
KeyPurposeId ::= OBJECT IDENTIFIER
|
||
```
|
||
|
||
## 3.3 抽象数据模型(接口)
|
||
|
||
> 说明:本模型面向“语义化解析产物”。实现可保留 `raw_der` 作为可追溯入口。
|
||
|
||
### 3.3.1 顶层联合类型:`ResourceCertificate`
|
||
|
||
| 字段 | 类型 | 语义 | 约束/解析规则 | RFC 引用 |
|
||
|---|---|---|---|---|
|
||
| `raw_der` | `DerBytes` | 证书 DER | 原样保留(建议) | RFC 6487 §4 |
|
||
| `tbs` | `RpkixTbsCertificate` | 证书语义字段(见下) | 仅允许 RFC 6487 允许的字段/扩展;其他字段 MUST NOT 出现 | RFC 6487 §4 |
|
||
| `kind` | `enum { ca, ee }` | 语义分类 | 来自 BasicConstraints + 用途约束 | RFC 6487 §4.8.1;RFC 6487 §4.8.8 |
|
||
|
||
### 3.3.1.1 派生类型(用于字段类型标注)
|
||
|
||
为避免在其它对象文档里反复写“`ResourceCertificate` 且 `kind==...`”,这里定义两个派生/别名类型:
|
||
|
||
- `ResourceCaCertificate`:`ResourceCertificate` 且 `kind == ca`
|
||
- `ResourceEeCertificate`:`ResourceCertificate` 且 `kind == ee`
|
||
|
||
这些派生类型不引入新字段,只是对 `ResourceCertificate.kind` 的约束化视图。
|
||
|
||
### 3.3.2 `RpkixTbsCertificate`(语义字段集合)
|
||
|
||
| 字段 | 类型 | 语义 | 约束/解析规则 | RFC 引用 |
|
||
|---|---|---|---|---|
|
||
| `version` | `int` | X.509 版本 | MUST 为 v3(字段值为 2) | RFC 6487 §4.1 |
|
||
| `serial_number` | `int` | 序列号 | 正整数;对每 CA 签发唯一 | RFC 6487 §4.2 |
|
||
| `signature_algorithm` | `Oid` | 证书签名算法 | 必须为 `sha256WithRSAEncryption`(`1.2.840.113549.1.1.11`) | RFC 6487 §4.3;RFC 7935 §2(引用 RFC 4055) |
|
||
| `issuer_dn` | `RpkixDistinguishedName` | 颁发者 DN | 必含 1 个 CommonName;可含 1 个 serialNumber;CN 必须 PrintableString | RFC 6487 §4.4 |
|
||
| `subject_dn` | `RpkixDistinguishedName` | 主体 DN | 同 issuer 约束;且对同一 issuer 下“实体+公钥”唯一 | RFC 6487 §4.5 |
|
||
| `validity_not_before` | `UtcTime` | 有效期起 | X.509 `Time`(UTCTime/GeneralizedTime)解析为 UTC 时间点 | RFC 6487 §4.6.1;RFC 5280 §4.1.2.5 |
|
||
| `validity_not_after` | `UtcTime` | 有效期止 | X.509 `Time`(UTCTime/GeneralizedTime)解析为 UTC 时间点 | RFC 6487 §4.6.2;RFC 5280 §4.1.2.5 |
|
||
| `subject_public_key_info` | `DerBytes` | SPKI DER | 算法 profile 指定 | RFC 6487 §4.7;RFC 7935 §3.1 |
|
||
| `extensions` | `RpkixExtensions` | 扩展集合 | 见下表;criticality/存在性/内容受约束 | RFC 6487 §4.8 |
|
||
|
||
### 3.3.3 `RpkixDistinguishedName`(RPKI profile 下的 DN 语义)
|
||
|
||
| 字段 | 类型 | 语义 | 约束/解析规则 | RFC 引用 |
|
||
|---|---|---|---|---|
|
||
| `common_name` | `string` | CommonName (CN) | MUST 存在且仅 1 个;类型为 PrintableString | RFC 6487 §4.4;RFC 6487 §4.5 |
|
||
| `serial_number` | `optional[string]` | serialNumber | MAY 存在且仅 1 个 | RFC 6487 §4.4;RFC 6487 §4.5 |
|
||
| `rfc4514` | `string` | DN 的 RFC4514 字符串表示 | 便于日志/索引(实现自选) | RFC 6487 §4.5(引用 RFC4514) |
|
||
|
||
### 3.3.4 `RpkixExtensions`(核心扩展语义)
|
||
|
||
> 表中 “存在性/criticality” 指 RPKI profile 下对该扩展的要求;实现应能区分 “字段缺失” 与 “字段存在但不符合约束”。
|
||
|
||
| 字段 | 类型 | 语义 | 存在性/criticality 与内容约束 | RFC 引用 |
|
||
|---|---|---|---|---|
|
||
| `basic_constraints` | `optional[BasicConstraints]` | CA 标志 | **extnID=`2.5.29.19`**;CA 证书:MUST present & critical;EE:MUST NOT present;pathLen MUST NOT present | RFC 6487 §4.8.1;RFC 5280 §4.2.1.9 |
|
||
| `subject_key_identifier` | `bytes` | SKI | **extnID=`2.5.29.14`**;MUST present & non-critical;值为 subjectPublicKey 的 DER bit string 的 SHA-1 哈希 | RFC 6487 §4.8.2(引用 RFC 5280 §4.2.1.2) |
|
||
| `authority_key_identifier` | `optional[AuthorityKeyIdentifier]` | AKI | **extnID=`2.5.29.35`**;自签名:MAY present 且可等于 SKI;非自签名:MUST present;authorityCertIssuer/authorityCertSerialNumber MUST NOT present;non-critical | RFC 6487 §4.8.3;RFC 5280 §4.2.1.1 |
|
||
| `key_usage` | `KeyUsage` | KeyUsage | **extnID=`2.5.29.15`**;MUST present & critical;CA:仅 `keyCertSign` 与 `cRLSign` 为 TRUE;EE:仅 `digitalSignature` 为 TRUE | RFC 6487 §4.8.4;RFC 5280 §4.2.1.3 |
|
||
| `extended_key_usage` | `optional[OidSet]` | EKU | **extnID=`2.5.29.37`**;CA:MUST NOT appear;用于验证 RPKI 对象的 EE:MUST NOT appear;若出现不得标 critical | RFC 6487 §4.8.5;RFC 5280 §4.2.1.12 |
|
||
| `crl_distribution_points` | `optional[CrlDistributionPoints]` | CRLDP | **extnID=`2.5.29.31`**;自签名:MUST be omitted;非自签名:MUST present & non-critical;仅 1 个 DistributionPoint;fullName URI;必须包含至少 1 个 `rsync://` | RFC 6487 §4.8.6;RFC 5280 §4.2.1.13 |
|
||
| `authority_info_access` | `optional[AuthorityInfoAccess]` | AIA | **extnID=`1.3.6.1.5.5.7.1.1`**;自签名:MUST be omitted;非自签名:MUST present & non-critical;必须含 accessMethod `id-ad-caIssuers`(**`1.3.6.1.5.5.7.48.2`**) 的 `rsync://` URI;可含同对象其它 URI | RFC 6487 §4.8.7;RFC 5280 §4.2.2.1 |
|
||
| `subject_info_access_ca` | `optional[SubjectInfoAccessCa]` | SIA(CA) | **extnID=`1.3.6.1.5.5.7.1.11`**;CA:MUST present & non-critical;必须含 accessMethod `id-ad-caRepository`(**`1.3.6.1.5.5.7.48.5`**)(`rsync://` 目录 URI)与 `id-ad-rpkiManifest`(**`1.3.6.1.5.5.7.48.10`**)(`rsync://` 对象 URI);若 CA 使用 RRDP,还会包含 `id-ad-rpkiNotify`(**`1.3.6.1.5.5.7.48.13`**)(HTTPS Notification URI) | RFC 6487 §4.8.8.1;RFC 5280 §4.2.2.2;RFC 8182 §3.2 |
|
||
| `subject_info_access_ee` | `optional[SubjectInfoAccessEe]` | SIA(EE) | **extnID=`1.3.6.1.5.5.7.1.11`**;EE:MUST present & non-critical;必须含 accessMethod `id-ad-signedObject`(**`1.3.6.1.5.5.7.48.11`**);URI **MUST include** `rsync://`;EE 的 SIA 不允许其它 AccessMethods | RFC 6487 §4.8.8.2;RFC 5280 §4.2.2.2 |
|
||
| `certificate_policies` | `CertificatePolicies` | 证书策略 | **extnID=`2.5.29.32`**;MUST present & critical;恰好 1 个 policy;并允许 0 或 1 个 CPS qualifier(若存在其 id 必为 `id-qt-cps`(**`1.3.6.1.5.5.7.2.1`**)) | RFC 6487 §4.8.9;RFC 7318 §2;RFC 5280 §4.2.1.4 |
|
||
| `ip_resources` | `optional[IpResourceSet]` | IP 资源扩展 | **extnID=`1.3.6.1.5.5.7.1.7`**;IP/AS 两者至少其一 MUST present;若 present MUST be critical;内容为 RFC 3779 语义;在公用互联网场景 SAFI MUST NOT 使用;且必须为非空或 inherit | RFC 6487 §4.8.10;RFC 3779 §2.2.1;RFC 3779 §2.2.2 |
|
||
| `as_resources` | `optional[AsResourceSet]` | AS 资源扩展 | **extnID=`1.3.6.1.5.5.7.1.8`**;IP/AS 两者至少其一 MUST present;若 present MUST be critical;内容为 RFC 3779 语义;RDI MUST NOT 使用;且必须为非空或 inherit | RFC 6487 §4.8.11;RFC 3779 §3.2.1;RFC 3779 §3.2.2 |
|
||
|
||
### 3.3.5 结构化子类型(建议)
|
||
|
||
#### `BasicConstraints`
|
||
|
||
| 字段 | 类型 | 语义 | 约束 | RFC 引用 |
|
||
|---|---|---|---|---|
|
||
| `ca` | `bool` | 是否 CA | 由 issuer 决定;在 CA 证书中该扩展必须存在 | RFC 6487 §4.8.1 |
|
||
| `path_len_constraint` | `None` | pathLenConstraint | MUST NOT present(RPKI profile 不使用) | RFC 6487 §4.8.1 |
|
||
|
||
#### `AuthorityKeyIdentifier`
|
||
|
||
| 字段 | 类型 | 语义 | 约束 | RFC 引用 |
|
||
|---|---|---|---|---|
|
||
| `key_identifier` | `bytes` | AKI.keyIdentifier | 使用 issuer 公钥的 SHA-1 哈希(按 RFC 5280 的定义) | RFC 6487 §4.8.3(引用 RFC 5280 §4.2.1.1) |
|
||
| `authority_cert_issuer` | `None` | authorityCertIssuer | MUST NOT present | RFC 6487 §4.8.3 |
|
||
| `authority_cert_serial_number` | `None` | authorityCertSerialNumber | MUST NOT present | RFC 6487 §4.8.3 |
|
||
|
||
#### `CrlDistributionPoints`
|
||
|
||
| 字段 | 类型 | 语义 | 约束 | RFC 引用 |
|
||
|---|---|---|---|---|
|
||
| `distribution_point_uris` | `list[Uri]` | CRL 位置列表 | 仅 1 个 DistributionPoint;必须包含至少 1 个 `rsync://` URI 指向该 issuer 最新 CRL;可含其它 URI | RFC 6487 §4.8.6 |
|
||
|
||
#### `AuthorityInfoAccess`
|
||
|
||
| 字段 | 类型 | 语义 | 约束 | RFC 引用 |
|
||
|---|---|---|---|---|
|
||
| `ca_issuers_uris` | `list[Uri]` | 上级 CA 证书位置 | accessMethod=`id-ad-caIssuers`(`1.3.6.1.5.5.7.48.2`);必含 `rsync://` URI;可含同对象其它 URI | RFC 6487 §4.8.7;RFC 5280 §4.2.2.1 |
|
||
|
||
#### `SubjectInfoAccessCa`
|
||
|
||
| 字段 | 类型 | 语义 | 约束 | RFC 引用 |
|
||
|---|---|---|---|---|
|
||
| `ca_repository_uris` | `list[Uri]` | CA 发布点目录(repository publication point) | accessMethod=`id-ad-caRepository`(`1.3.6.1.5.5.7.48.5`);至少 1 个;必须包含 `rsync://`;也可包含其它机制(例如 `https://`)作为“同一目录”的替代访问方式;顺序表示 CA 偏好 | RFC 6487 §4.8.8.1;RFC 5280 §4.2.2.2 |
|
||
| `rpki_manifest_uris` | `list[Uri]` | 当前 manifest 对象 URI | accessMethod=`id-ad-rpkiManifest`(`1.3.6.1.5.5.7.48.10`);至少 1 个;必须包含 `rsync://`;也可包含其它机制(例如 `https://`)作为“同一对象”的替代访问方式 | RFC 6487 §4.8.8.1;RFC 5280 §4.2.2.2 |
|
||
| `rpki_notify_uris` | `optional[list[Uri]]` | RRDP Notification(Update Notification File)URI | accessMethod=`id-ad-rpkiNotify`(`1.3.6.1.5.5.7.48.13`);若存在则 accessLocation MUST 为 `https://` URI,指向 RRDP Notification 文件 | RFC 8182 §3.2;RFC 5280 §4.2.2.2 |
|
||
|
||
#### `SubjectInfoAccessEe`
|
||
|
||
| 字段 | 类型 | 语义 | 约束 | RFC 引用 |
|
||
|---|---|---|---|---|
|
||
| `signed_object_uris` | `list[Uri]` | 被 EE 证书验证的签名对象位置 | accessMethod=`id-ad-signedObject`(`1.3.6.1.5.5.7.48.11`);必须包含 `rsync://`;其它 URI 可作为同对象替代机制;EE SIA 不允许其它 AccessMethods | RFC 6487 §4.8.8.2;RFC 5280 §4.2.2.2 |
|
||
|
||
#### `CertificatePolicies`
|
||
|
||
| 字段 | 类型 | 语义 | 约束 | RFC 引用 |
|
||
|---|---|---|---|---|
|
||
| `policy_oid` | `Oid` | 唯一 policy OID | 恰好 1 个 policy;RPKI CP 分配的 OID 为 `id-cp-ipAddr-asNumber`(`1.3.6.1.5.5.7.14.2`) | RFC 6487 §4.8.9;RFC 6484 §1.2 |
|
||
| `cps_uri` | `optional[Uri]` | CPS policy qualifier URI | MAY 存在且最多 1 个;若存在其 `policyQualifierId` 必为 `id-qt-cps`;对该 URI 不施加处理要求 | RFC 7318 §2;RFC 5280 §4.2.1.4 |
|
||
|
||
## 3.4 字段级约束清单(实现对照)
|
||
|
||
- 仅允许 RFC 6487 §4 指定的字段/扩展;未列出字段 MUST NOT 出现。RFC 6487 §4。
|
||
- 证书版本必须为 v3。RFC 6487 §4.1。
|
||
- CA/EE 在 BasicConstraints 与 SIA 的约束不同。RFC 6487 §4.8.1;RFC 6487 §4.8.8.1;RFC 6487 §4.8.8.2。
|
||
- KeyUsage:CA 仅 `keyCertSign`/`cRLSign`;EE 仅 `digitalSignature`。RFC 6487 §4.8.4。
|
||
- CRLDP/AIA:自签名必须省略;非自签名必须存在并包含 `rsync://`。RFC 6487 §4.8.6;RFC 6487 §4.8.7。
|
||
- IP/AS 资源扩展:两者至少其一存在;若存在必须 critical;语义来自 RFC 3779;在公用互联网场景 SAFI 与 RDI 均不得使用。RFC 6487 §4.8.10;RFC 6487 §4.8.11;RFC 3779 §2.2.3;RFC 3779 §3.2.3。
|