Read basic info (subject, altnames, expiresAt, issuedAt) from a cert.pem / x509 certificate (tls / ssl / https)
Go to file
AJ ONeal 263d5a11c5 v1.0.0 2016-08-11 09:43:11 -06:00
bin v1.0.0 2016-08-11 09:43:11 -06:00
.gitignore Initial commit 2016-08-11 09:15:10 -06:00
LICENSE Initial commit 2016-08-11 09:15:10 -06:00
README.md v1.0.0 2016-08-11 09:43:11 -06:00
cert.pem v1.0.0 2016-08-11 09:43:11 -06:00
index.js v1.0.0 2016-08-11 09:43:11 -06:00
package.json v1.0.0 2016-08-11 09:43:11 -06:00
test.js v1.0.0 2016-08-11 09:43:11 -06:00

README.md

cert-info.js

Read basic info from a cert.pem / x509 certificate.

Install

# bin
npm install --global certpem

# node.js library
npm install --save certpem

Usage

For basic info (subject, altnames, issuedAt, expiresAt):

certpem /path/to/cert.pem

Output all info by passing --debug or use --json to see the basic info pretty-printed.

'use strict';

var certpem = require('certpem').certpem
var cert = fs.readFile('cert.pem', 'ascii', function (err, certstr) {
  console.info(cert.pem.info());

  console.info(cert.pem.debug());
});
{
  "subject": "localhost.daplie.com",
  "altnames": [
    "localhost.daplie.com"
  ],
  "issuedAt": 1465516800000,
  "expiresAt": 1499731199000
}