Read basic info from a cert.pem / x509 certificate.
Used for Greenlock.js
Install
npm install --global certpem
npm install --save certpem
Usage
CLI
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.
node.js
'use strict';
var certpem = require('certpem').certpem
var cert = fs.readFile('cert.pem', 'ascii', function (err, certstr) {
console.info(certpem.info(certstr));
console.info(certpem.debug(certstr));
});
Example output:
{
"subject": "localhost.example.com",
"altnames": [
"localhost.example.com"
],
"issuedAt": 1465516800000,
"expiresAt": 1499731199000
}
With a few small changes this could also work in the browser (that's how its dependencies are designed).
Legal
certpem.js |
MPL-2.0 |
Terms of Use |
Privacy Policy