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

selfsigned

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

selfsigned

Generate self signed certificates private and public keys

  • 2.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14M
increased by6.58%
Maintainers
2
Weekly downloads
 
Created

What is selfsigned?

The selfsigned npm package is used to generate self-signed SSL/TLS certificates. It is primarily used for development purposes where trusted certificates are not required. The package allows users to create certificates with various options, such as setting the validity period, adding extensions, and defining subject fields.

What are selfsigned's main functionalities?

Generate a self-signed certificate

This feature allows the generation of a self-signed certificate with a common name of 'contoso.com' and a validity of 365 days. The 'pems' object contains the private key, certificate, and other related PEM-encoded data.

const selfsigned = require('selfsigned');
const attrs = [{ name: 'commonName', value: 'contoso.com' }];
const options = { days: 365 };
selfsigned.generate(attrs, options, function(err, pems) {
  console.log(pems);
});

Generate a certificate with custom extensions

This feature allows the generation of a self-signed certificate with custom extensions, such as marking the certificate as a CA (Certificate Authority). This is useful for creating more complex certificate chains or for specific use cases requiring certain extensions.

const selfsigned = require('selfsigned');
const attrs = [{ name: 'commonName', value: 'contoso.com' }];
const extensions = [{ name: 'basicConstraints', cA: true }];
const options = { days: 365, extensions: extensions };
selfsigned.generate(attrs, options, function(err, pems) {
  console.log(pems);
});

Other packages similar to selfsigned

Keywords

FAQs

Package last updated on 26 Oct 2023

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