@nfi/openssl-ca
v2.1.1
Published
Basic X.509 CA built around the OpenSSL command-line utility.
Downloads
10
Maintainers
Readme
@nfi/openssl-ca
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'
]
})
})