Installation & Usage
npm install openssl-nodejs
Import openssl module:
const openssl =
Next, invoke openssl function and put command with parameters inside a function like presented in the example below.
To get access to the result of execution specify callback function as the last parameter of openssl function (with arguments err and buffer).
openssl function can be invoked with a single parameter like OpenSSL command (see example above) or within an array with command name and parameters itself.
If you want to specify Buffer text instead of the file as an input/output or whatever you need, use the version with an array as a function parameter. And put an object with keys: name: (specify a name of file which will be created to handle this command), and buffer: (your buffer variable) Example of object:
name:'csr.conf' buffer: BufferVariable
When you used a command which generates additional output in file format this package will create a folder openssl/ in the directory where the command was invoked. All output files will appear in this folder (openssl).
If u want to use a command which needs additional interaction use parameter -config and specify pass to file with configuration.
That's all that you need to start using it.
For any information, improvements or bug fixes please contact me. If it's package was useful for you please give a star in GitHub. (really inspiring me to new ones)