Socket
Socket
Sign inDemoInstall

certpem

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

certpem

Read basic info (subject, altnames, expiresAt, issuedAt) from a cert.pem / x509 certificate (tls / ssl / https)


Version published
Weekly downloads
764
increased by12.35%
Maintainers
1
Weekly downloads
 
Created
Source

certpem.js

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

Used for Greenlock.js

Install

# bin
npm install --global certpem

# node.js library
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) {

  // basic info
  console.info(certpem.info(certstr));

  // way too much info
  // (requires npm install --save node.extend@1)
  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).

certpem.js | MPL-2.0 | Terms of Use | Privacy Policy

Keywords

FAQs

Package last updated on 17 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc