due*_*see 2 ssl certificate ca distinguishedname x509
我很难理解 RDN (RelativeDistinguishedName) 中属性 (AttributeTypeAndValue) 的顺序。
以下是相关的 ASN.1 定义(取自www.in2eps.com):
TBSC证书
TBSCertificate ::= SEQUENCE {
[...]
subject Name,
[...]
}
Run Code Online (Sandbox Code Playgroud)
姓名
Name ::= CHOICE {
rdnSequence RDNSequence
}
Run Code Online (Sandbox Code Playgroud)
RDN序列
RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
Run Code Online (Sandbox Code Playgroud)
相对专有名称
RelativeDistinguishedName ::= SET SIZE (1 .. MAX) OF AttributeTypeAndValue
Run Code Online (Sandbox Code Playgroud)
属性类型和值
AttributeTypeAndValue ::= SEQUENCE {
type AttributeType,
value AttributeValue
}
Run Code Online (Sandbox Code Playgroud)
属性类型
AttributeType ::= OBJECT IDENTIFIER
Run Code Online (Sandbox Code Playgroud)
属性值
AttributeValue ::= ANY -- DEFINED BY AttributeType
Run Code Online (Sandbox Code Playgroud)
如果我创建了一个包含“/CN=CommonNameX/O=OrganizationX/...”(按照这个特定顺序)的 CSR,CA 如何从中构建证书?
将主题设置为“.../O=OrganizationX/CN=CommonNameX/”(以相反的顺序相同)时,将如何构建证书?
据我所知,在验证证书链时,RDN 属性的顺序很重要。因此,我假设一定有一些详细的规范可用?
更重要的是,我还想知道是否有不同的 CA 使用不同的顺序。如果是这样,有人可以指出一些 CA 吗?
编辑:
阅读第一个答案后,我意识到我要求的东西与预期非常不同。简而言之:预期的问题是,RDN 序列中元素的顺序是否重要。
抱歉造成混乱,稍后我会更正问题的标题...
如果我创建了一个包含“/CN=CommonNameX/O=OrganizationX/...”(按照这个特定顺序)的 CSR,CA 如何从中构建证书?
一个体面的 CA 实际上应该忽略在 CSR 中提交的 DN,并根据它已验证的信息构建主题 DN。也就是说,通常,他们会根据自己的 CA 策略放置自己的国家/地区、组织、OU(等等)。他们会将 CN 更改为您申请的主机的 CN(例如,或者根据证书类型与申请流程相关的任何其他内容)。CSR 中的内容对于跟踪在申请过程中提交的公钥的身份很有用,但充其量仅用于管理目的。
据我所知,在验证证书链时,RDN 属性的顺序很重要。因此,我假设一定有一些详细的规范可用?
是的,顺序RDNSequence确实很重要SEQUENCE OF RelativeDistinguishedName。每个RDN是本身的AVA(属性值断言/的集合(其是无序的)AttributeTypeAndValue): SET SIZE (1 .. MAX) OF AttributeTypeAndValue。
每个 RDN 内容(一组 AVA)和每个 DN(RDN 序列)的匹配规则在RFC 5280 中定义:
Run Code Online (Sandbox Code Playgroud)Two naming attributes match if the attribute types are the same and the values of the attributes are an exact match after processing with the string preparation algorithm. Two relative distinguished names RDN1 and RDN2 match if they have the same number of naming attributes and for each naming attribute in RDN1 there is a matching naming attribute in RDN2. Two distinguished names DN1 and DN2 match if they have the same number of RDNs, for each RDN in DN1 there is a matching RDN in DN2, and the matching RDNs appear in the same order in both DNs. A distinguished name DN1 is within the subtree defined by the distinguished name DN2 if DN1 contains at least as many RDNs as DN2, and DN1 and DN2 are a match when trailing RDNs in DN1 are ignored.
本质上,DN 中的 RDN 需要按正确的顺序排列(SEQUENCE已排序),但 AVA 的顺序不需要(SET未排序):“如果两个相对可分辨名称 RDN1 和 RDN2 具有相同数量的命名属性,则它们匹配对于 RDN1 中的每个命名属性,在 RDN2 中都有一个匹配的命名属性。 ”
实际上,大多数 CA 只对每个 RDN 使用一个属性值对。如果依赖文本序列化(例如RFC 2253)的许多实现(不一定是 SSL/TLS 堆栈的一部分,而是说,在它之上的身份验证/授权层)会被多个混淆,我不会感到惊讶AVA(更具体地说,它们的顺序在每个 RDN 中并不重要,因此您可以拥有两个实际上等效的不同文本序列化)。
| 归档时间: |
|
| 查看次数: |
6573 次 |
| 最近记录: |