simplessl
A basic openssl manager
Installation
$ npm install simplessl
Features
- simply create key, csr & crt and save it in files for ssl use
- ... with the three or only one function
Doc
setOpenSSLBinPath(file: string): Promise<void>
set a specific path to the OpenSSL software (default = process.env.OPENSSL_BIN || "openssl")setOpenSSLConfPath(file: string): Promise<void>
set a specific path to the OpenSSL configuration (default = process.env.OPENSSL_CONF || /lib/openssl.cnf)createPrivateKey(keyfile: string, options?: string|number|iOptions): Promise<iPrivateKey>
createCSR(keyfile: string, csrfile: string, options?: string|number|iOptions): Promise<iCSR>
createCertificate(keyfile: string, csrfile: string, certificatefile: string, options?: string|number|iOptions): Promise<iCertificate>
if "options" is given and not an object, define the key's size
Examples
Native
const SimpleSSL = ; const SSL = crtpath = path serverkey = path servercsr = path servercrt = path; // this function will automatically apply SSL.createCSR && SSL.createPrivateKey functions// if serverkey or servercsr does not exist SSL;
Typescript
;; SSL.createCertificateserverkey, servercsr, servercrt, "medium".then;
Tests
$ npm run-script tests