Last active
August 29, 2015 14:20
-
-
Save bmeck/e20ff68fc7b19bc70652 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var asn = require('asn1.js'); | |
| var rfc3280 = require('asn1.js/rfc/3280'); | |
| var CRLReason = rfc3280.CRLReason; | |
| var Certificate = rfc3280.Certificate; | |
| var fs = require('fs'); | |
| global.log = false; | |
| var cert = Certificate.decode(fs.readFileSync('sandbox/valid-cert/cacert.der'), 'der') | |
| var exts = cert.tbsCertificate.extensions; | |
| var CRLDistPoints = asn.define('CRL Distribution Points', function() { | |
| this.seq() | |
| .seq() | |
| .obj( | |
| this.key('distributionPoint').choice({ | |
| fullName: this.use(rfc3280.Name), | |
| nameRelativeToCRLIssuer: this.use(rfc3280.RelativeDistinguishedName) | |
| }), | |
| this.key('reasons').optional().use(CRLReason), | |
| this.key('cRLIssuer').optional().use(rfc3280.Name) | |
| ); | |
| }); | |
| console.log(exts[0].extnValue.toString('hex')) | |
| console.log(CRLDistPoints.decode(exts[0].extnValue, 'der')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment