I have difficulties to understand the ordering of the attributes (AttributeTypeAndValue) in the RDN (RelativeDistinguishedName).
Here are the relevant ASN.1 definitions (taken from www.in2eps.com):
TBSCertificate
TBSCertificate ::= SEQUENCE {
[...]
subject Name,
[...]
}
Name
Name ::= CHOICE {
rdnSequence RDNSequence
}
RDNSequence
RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
RelativeDistinguishedName
RelativeDistinguishedName ::= SET SIZE (1 .. MAX) OF AttributeTypeAndValue
AttributeTypeAndValue
AttributeTypeAndValue ::= SEQUENCE {
type AttributeType,
value AttributeValue
}
AttributeType
AttributeType ::= OBJECT IDENTIFIER
AttributeValue
AttributeValue ::= ANY -- DEFINED BY AttributeType
If I create a CSR containing "/CN=CommonNameX/O=OrganizationX/..." (in this specific order), how does a CA constructs a certificate out of this?
How will the certificate be constructed when setting the subject to ".../O=OrganizationX/CN=CommonNameX/" (same in reversed order)?
As far as I know the ordering of the RDN attributes is important when verifying certificate chains. Therefore, I assume there must by some detailed specification available?
More importantly, I would also like to know if there are different CAs using different orderings. If so, can someone point out some CAs?
EDIT:
After reading the first answers, I realized that I was asking for something very different than intended. To cut it short: the intended question was, if the ordering of the elements in the sequence of RDNs is important.
Sorry for the confusion, I will rectify the title of the question afterwards...