indutny/asn1.js — pull request #24 by chjj (2014-08-27 17:43:06+00:00)
Title: Implement standardized Certificate Extensions from RFC5280

NOTE: This is a work in progress.

This implements 17 TBSCertificate Extensions as laid out in rfc5280: http://www.ietf.org/rfc/rfc5280.txt

This also adds all string types to the DER encoder/decoder aside from a few which I couldn't find much documentation on.

It ultimately adds an `rfc5280.decodeExtensions(cert, ...)' function which can parse all extensions of a TBSCert and returns an object potentially containing all 17 standardized extensions, decoded.

I'm still receiving parse errors on certain certificates. You may see my old debugging code in past commits. I receive a parse error on the test cert itself, so I'll have to do some more debugging. I hope there is not a problem with the core DER decoder (I tried to obey the specification perfectly, but on the cert chain I was testing on, I was receiving parse errors. You will see some "XXX" comments noting workarounds for the parse errors I was receiving. The lines of code below those comments did not exist prior trying to workaround parse errors, and the cert chain I was testing on is completely valid).

I still have to work on tests.