Fix generation of ASN.1 representation of RelativeDistinguishedNames #235
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Certificates, created by current version of PKI.js, have their issuer and subject generated as multi-valued RDNs. All the sequences, containing TypeAndValue, are in the same set.
The ASN.1 representation of the subject of the certificate, generated by X509_cert_complex_example, is as follows:
Although conforming implementation should be able to parse this certificate correctly, at least in one occasion it has shown to be problematic. Specific example is Adobe Reader, which fails to build certificate chain out of the certificates inside signed PDF document, and subsequently fails validation.
Current approach of generating RDNs also differs from the approach, used in popular open source crypto libraries like OpenSSL and BouncyCastle. There each TypeAndValue sequence resides in it's own set. ASN.1 representation of the same subject, generated by OpenSSL looks like this:
The proposed fix alters RDN generation to align with OpenSSL RDN generation.