cert-generator

0.0.1 • Public • Published

cert-generator

Generate a root certificate.

MIT License

Installation

$ npm install --save cert-generator

Usage

import Generator from 'cert-generator';

/*
   options.dir   // where should the certificates be save
   options.name  // the root certificate name
*/
let generator = new Generator([options]);

generator.generateRootCA()
  .then(() => console.log('success'))
  .catch(error => console.log(error));

// get certificate for special hostname
generator.getCertificate('example.com')
  .then(({cert, key}) => {
     console.log(cert);  // the certificate
     console.log(key);   // the private key
  })
  .catch(error => console.log(error));

// check if the root CA is exists  
generator.isRootCAExists()
  .then((exists) => console.log(exists));
  
// clear all certs
generator.clearCerts()
  .then(() => console.log('certs ware cleared.'));

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

Package Sidebar

Install

npm i cert-generator

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • bubkoo