@nfi/openssl-ca
TypeScript icon, indicating that this package has built-in type declarations

2.1.1 • Public • Published

@nfi/openssl-ca

npm version pipeline status coverage status standard-js

Basic X.509 CA built around the OpenSSL command-line utility.

Installation

npm install @nfi/openssl-ca

Usage Example

const { CA } = require('@nfi/openssl-ca')

/* Create a new self-signed CA. */
const ca = CA.generate({
  pass: 'password',
  bits: 2048,
  days: 3650,
  subj: [
    'CN=Test CA',
    'O=Test Organisation'
  ]
})

/* Issue a certificate from that CA. */
const cert = await ca.guard((ca) => {
  return ca.issue({
    pass: 'password',
    bits: 2048,
    days: 365,
    subj: [
      'CN=Test Server',
      'OU=Test Department',
      'O=Test Organisation'
    ]
    sans: [
      'DNS:server.test.org'
    ]
  })
})

Package Sidebar

Install

npm i @nfi/openssl-ca

Weekly Downloads

1

Version

2.1.1

License

ISC

Unpacked Size

16.7 kB

Total Files

6

Last publish

Collaborators

  • cptpackrat