@darkmaper/easyrsa-node

A nodejs module for create and manage easyrsa certificates


Keywords
nodejs, node, easyrsa, typescript, module
License
GPL-2.0
Install
npm install @darkmaper/easyrsa-node@0.1.1

Documentation

Easy-RSA Node.js

Build Status

This module is for easier creation of CA and signing certificates with Node.js without create persistent files and oriented to storing in database.

How this works

To generate a new CA is very simple

const EasyRSA = require('@darkmaper/easyrsa-node');

const easyrsa = new EasyRSA({
    country: "US",
    province: "California",
    city: "San Francisco",
    org: "Example Organization",
    email: "example@email.com",
    ou: "Organizationar Unit Example",
    cn: 'ChangeMe',
    digest: 'sha256',
    dn: 'cn_only',
    keySize: 2048,
    caExpire: 3650,
    crlDays: 180,
    certExpire: 825,
    algo: 'rsa'
});

easyrsa.build_ca('testing','password').then((res) => {
    console.log(res.privateKey, res.certificate);
 });
import EasyRSA from '@darkmaper/easyrsa-node';

const easyrsa = new EasyRSA({
    country: "US",
    province: "California",
    city: "San Francisco",
    org: "Example Organization",
    email: "example@email.com",
    ou: "Organizationar Unit Example",
    cn: 'ChangeMe',
    digest: 'sha256',
    dn: 'cn_only',
    keySize: 2048,
    caExpire: 3650,
    crlDays: 180,
    certExpire: 825,
    algo: 'rsa'
});

easyrsa.build_ca('testing','password').then((res) => {
    console.log(res.privateKey, res.certificate);
})

The output is the private key of CA and its certificate.