New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cert-infos

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cert-infos

Get certificate information from a rsa pem/crt/der file

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

certificate-infos: Node.js

Receive RSA certificate information (distinguishedName, commonName, validFrom, validTo,...) from a pem or der encoded file.

##Publications:

https://blog.appit-online.de/publications/

##Table of contents:

Quickstart

Installing the library

npm install cert-infos --save

Using the library

import * as certInfo from 'cert-infos';

/**
 * Given a pem certificate file, get certificate information.
 * @param {string} pemCertPath The path to a certificate file.
 */
const {certificate, certificateOriginal} = certInfo.getRSACertInfoPem(pemCertPath);
console.log('The short certificate information:');
console.log(certificate);
/*
{
        "issuer": {
            "distinguishedName": "CN=Test CA,OU=CA,O=Test GmbH,C=DE",
            "components": {
                "email": "",
                "commonName": "Test CA",
                "organizationalUnit": "CA",
                "organizationName": "Test GmbH",
                "localityName": "",
                "stateName": "",
                "country": "DE"
            }
        },
        "subject": {
            "distinguishedName": "CN=Test1 CA,OU=CA,O=Test1 GmbH,C=DE",
            "components": {
                "email": "",
                "commonName": "Test CA",
                "organizationalUnit": "CA",
                "organizationName": "Test GmbH",
                "localityName": "",
                "stateName": "",
                "country": "DE"
            }
        },
        "serialNumber": "01",
        "validFrom": "2019-01-16T11:55:00.000Z",
        "validTo": "2028-01-11T12:15:00.000Z",
        "version": 3
    }
*/


console.log('The unconverted certificate data:');
console.log(certificateOriginal)
import * as certInfo from 'cert-infos';

/**
 * Given a der certificate file, get certificate information.
 * @param {string} derCertPath The path to a certificate file.
 */
const {certificate, certificateOriginal} = certInfo.getRSACertInfoDER(derCertPath);
console.log('The short certificate information:');
console.log(certificate);

console.log('The unconverted certificate data:');
console.log(certificateOriginal)

Supported Node.js Versions

Our client libraries follow the Node.js release schedule. Libraries are compatible with all current active and maintenance versions of Node.js.

License

Apache Version 2.0

See LICENSE

Keywords

FAQs

Package last updated on 12 Dec 2021

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