npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tder

v0.0.8

Published

small ASN1-DER and PEM parser in about 100 lines

Downloads

19

Readme

tder

small ASN1 DER and PEM parser in pure js

wow, just 100 lines of code and the module can parse ASN1-DER data structures. it is made to read informations from certificates. tested with certificates generated with hyperledger cryptogen and the github.com certificate

// test.js
var tder = require('./index');
var fs = require('fs');


var asn1 = tder.parsePem(`
-----BEGIN CERTIFICATE-----
MIIHeTCCBmGgAwIBAgIQC/20CQrXteZAwwsWyVKaJzANBgkqhkiG9w0BAQsFADB1
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
...
nT8MIG1u1zF8MA0GCSqGSIb3DQEBCwUAA4IBAQCLbNtkxuspqycq8h1EpbmAX0wM
FrBHTFxqIP6kDnxiLElBrZngtY07ietaYZVLQN/ETyqLQftsf8TecwTklbjvm8NT
JqbaIVifYwqwNN+4lRxS3F5lNlA/il12IOgbRioLI62o8G0DaEUQgHNf8vSG
-----END CERTIFICATE-----
`);
asn1 = tder.interpreter.certInterpreter(asn1);
// {
//   "serial": "0bfdb4090ad7b5e640c30b16c9529a27",
//   "issuer": {
//     "countryName": "US",
//     "organizationName": "DigiCert Inc",
//     "organizationalUnitName": "www.digicert.com",
//     "commonName": "DigiCert SHA2 Extended Validation Server CA"
//   },
//   "dueTime": {    
//     "notBefore": "2016-03-10T00:00:00.000Z",
//     "notAfter": "2018-05-17T12:00:00.000Z"
//   },
//   "subject": {
//     "businessCategory": "Private Organization",
//     "jurisdictionCountryName": "US",
//     "jurisdictionStateOrProvinceName": "Delaware",
//     "serialNumber": "5157550",
//     "streetAddress": "88 Colin P Kelly, Jr Street",
//     "postalCode": "94107",
//     "countryName": "US",
//     "stateOrProvinceName": "California",
//     "localityName": "San Francisco",
//     "organizationName": "GitHub, Inc.",
//     "commonName": "github.com"
//   }
// }

you can clearly see the issue and subject, to verify if the datastructures are are valid and are signed correctly, you need to look elsewhere.