certreq

1.0.1 • Public • Published

OpenSSL NodeJS (LibOpenSSL)

This package provides a simple interface to the certreq command.

Installation & Usage

Perform basic npm installation task:

foo@bar: npm install node-certreq --save

Import openssl module:

const certreq = require("node-certreq");
certreq.run(["-submit", "-attrib", "CertificateTemplate XXX"], function (data) {
  // the data object will contain every process output
  console.log(data);
});

The last parameter of the function run will always be the callback function.

The Library will call this function with all return values of the process:

Important: "processError" is not directly a sign of an error, consider hasError as the primary detection. Check this Article for more information about how openssl for example handles stderr. In addition, certreq spawns windows - if the user closes the window without finishing it will result in a process error.

[
  (processError: ""),
  (processOutput: "certreq output"),
  (processExitCode: 0), // <- That's the important one!
  (processEnd: "closed"), // <- Shows how the process exited
  (hasError: false),
];

That's all that you need to start using it.
For any information, improvements or bug fixes please contact me.

Package Sidebar

Install

npm i certreq

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

4.72 kB

Total Files

3

Last publish

Collaborators

  • timoms