Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pem

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pem

Create private keys and certificates with node.js and io.js

  • 1.15.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
167K
decreased by-14.03%
Maintainers
2
Weekly downloads
 
Created

What is pem?

The 'pem' npm package is a tool for creating and managing PEM (Privacy Enhanced Mail) files, which are commonly used for SSL/TLS certificates and keys. It provides a variety of functionalities for generating, reading, and managing these files.

What are pem's main functionalities?

Generate SSL Certificates

This feature allows you to generate self-signed SSL certificates. The code sample demonstrates how to create a certificate that is valid for one day.

const pem = require('pem');
pem.createCertificate({ days: 1, selfSigned: true }, function (err, keys) {
  if (err) {
    throw err;
  }
  console.log(keys);
});

Read Certificate Information

This feature allows you to read and extract information from an existing certificate. The code sample shows how to read certificate information from a specified file path.

const pem = require('pem');
pem.readCertificateInfo('path/to/certificate.pem', function (err, info) {
  if (err) {
    throw err;
  }
  console.log(info);
});

Create Certificate Signing Request (CSR)

This feature allows you to create a Certificate Signing Request (CSR), which is used to request a certificate from a Certificate Authority (CA). The code sample demonstrates how to create a CSR with a specified common name.

const pem = require('pem');
pem.createCSR({ commonName: 'example.com' }, function (err, csr) {
  if (err) {
    throw err;
  }
  console.log(csr);
});

Create Private Key

This feature allows you to generate a private key. The code sample shows how to create a private key using the 'pem' package.

const pem = require('pem');
pem.createPrivateKey(function (err, key) {
  if (err) {
    throw err;
  }
  console.log(key);
});

Other packages similar to pem

FAQs

Package last updated on 20 Jan 2022

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