This is a CN from a x509 certificate (I have done some substitutions just to mask the data but the length is not changed)

CN=Alex Perry/pseudonym=88b2e76beE0e4e4b94b502020202262E/x500UniqueIdentifier=22e4EE844E8B744490EEE96EE8BEB7E29548e4496E425247944B025E04528654/postalCode=60601

As per the RFC, the CN field should not be more than 64 bytes, but this CN is more than 64 bytes

So does the max length 64 only counted up for the CN=Alex Perry & the rest of the string (/pseudonym, /x500UniqueIdentifier etc) is ignored?

If so, is there a limit imposed on the total maximum length? What is that?

  • $\begingroup$ It looks to me that you've posted a distinguished name (DN) with several attributes where the CN is just one of them. $\endgroup$ – Jaime Hablutzel Jul 9 at 23:16

They are separate fields. Their lengths, from the very same RFC:

ub-pseudonym INTEGER ::= 128

ub-postal-code-length INTEGER ::= 16

If x500UniqueIdentifier is OID then it is a bit-string which isn't constrained in length (afaik).

Both the Subject and the Issuer fields are instances of RelativeDistinguishedName (section and are of SIZE (1..MAX)

Appendix B says that:

MAX indicates that the upper bound is unspecified. Implementations are free to choose an upper bound that suits their environment.

So while the definition suggests that Subject can be as large as you want it to be, it also suggests that it may well be constrained by your particular implementation.

  • $\begingroup$ Is there any upper limit for the who Subject field combined? $\endgroup$ – user93353 Dec 22 '17 at 12:44
  • $\begingroup$ Issuer and Subject are not instances of RelativeDistinguishedName, but of RDNSequence which holds a sequence of RelativeDistinguishedNames and the SIZE (1..MAX) applies to the number of attributes that every RelativeDistinguishedName can hold and, AFAIK, RFC 5280 doesn't say anything about size constraints for the RDNSequence itself. $\endgroup$ – Jaime Hablutzel Jul 9 at 23:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.