{"_id":"@andrewiski/openssl","_rev":"2-a68795fbd0064631a7df53b4554db272","name":"@andrewiski/openssl","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.1":{"name":"@andrewiski/openssl","version":"1.0.1","description":"Tool to assist with creating a CA using Open SSL as well as adding support for requesting lets Encrypt certificates","main":"openssl.js","license":"GPL-3.0-or-later","private":false,"repository":{"type":"git","url":"git+https://github.com/andrewiski/openssl.git"},"author":{"name":"Andrew DeVries","email":"adevries@digitalexample.com","url":"https://digitalexample.com"},"engines":{"node":">=12.0"},"scripts":{"test":"node test/test-openssl.js","start":"DEBUG=app USELOCALLIB=true node example/basic.js"},"dependencies":{"@fidm/x509":"^1.2.1","@root/acme":"^3.1.0","@root/csr":"^0.8.1","@root/keypairs":"^0.10.3","debug":"^4.3.2","deferred":"^0.7.11","extend":"^3.0.2","moment":"^2.29.1","punycode":"^2.1.1"},"gitHead":"12117cc8ee19beb0b70f07d4166d03f171174df6","bugs":{"url":"https://github.com/andrewiski/openssl/issues"},"homepage":"https://github.com/andrewiski/openssl#readme","_id":"@andrewiski/openssl@1.0.1","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-RdprrZSHEyf/AKyDT9tyXmf7QN8jzWaunYYr4WJVobZKFlwaCXvYLit+WGiiCT0vkFj8Wsi3xIcZHzYxyOhCSg==","shasum":"a007916b303d812f9568e37eeb6d9abd73c7b6c9","tarball":"https://registry.npmjs.org/@andrewiski/openssl/-/openssl-1.0.1.tgz","fileCount":32,"unpackedSize":11197321,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEfEcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmokfBAAh17RX0Mr73M+RtR0m5RDhkA5I4S0ChqrWoyn6Oxh1xHIdS8q\r\np5oxdRj6SikrtAHFQNPLKf1q8SYx+hFdYXMrky1irX5l/o9mshIoiFfC0cdH\r\n3QD5Pl4w5sN5KPmHrImFeRjlR2PZ5/3lAnHAOXQdU+++x/eX764/Kbtv7ESR\r\n1oogqnSdAX6NnZi6TF6waaGmr8F2ySzBxOf+Q+DmwrvZpf8Cb68mFyLbmwcn\r\ncysfIbnSIgG5tDQdJarTFTHuKsBQhp1+7eF1++mGfiShkAXNFnQtNIZCXRpZ\r\nTe7yldGBYlKLX3vgbSbCcaFk1CAIHDM5bUwYAzZ07JGvQc6kVLHsA42vECn3\r\nI6ZR0INsN1qAMAJ8968yWvwZHIyidUNIRZ49pqSkf1/dHDJL/l2KC9hDp+4D\r\nNzFlns1HFLAfKp9RivsXkdMUu84l2PcGfj+tHsJv3cpToqoBfW/35ytuB0vo\r\nblcVvkxDj+LauaWN1AUg7oreqQzQaDntalntXCSd1ra8YpIP0hY/m2jIfE1i\r\nxibV50XwHU7tvxV6TWynn9041IHyo88LFhZ9HsL0PsITXFG4WN9Sv0uDHie2\r\nv9KKrd0Vcv3eza65Q3mS4b9094t0y5TmrJk2+u3iusL+oATI9jQ3HScgUfFa\r\nsfqDcbccZG4fLWWpP07mT39qf5QpS1fyUqw=\r\n=8x2U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFB8ht34vtwvmusB7+vAG43Ej6d5XiIoVrOifOGeT4zrAiBeNGUApNlxCmiZ7ONlaaGJ92dU4+470YCFeSFAuMuKMg=="}]},"_npmUser":{"name":"andrewiski","email":"adevries@digitalexample.com"},"directories":{},"maintainers":[{"name":"andrewiski","email":"adevries@digitalexample.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openssl_1.0.1_1645343004225_0.4966366863227081"},"_hasShrinkwrap":false},"1.0.2":{"name":"@andrewiski/openssl","version":"1.0.2","description":"Tool to assist with creating a CA using OpenSSL","main":"openssl.js","license":"GPL-3.0-or-later","private":false,"repository":{"type":"git","url":"git+https://github.com/andrewiski/openssl.git"},"author":{"name":"Andrew DeVries","email":"adevries@digitalexample.com","url":"https://digitalexample.com"},"engines":{"node":">=12.0"},"scripts":{"test":"node test/test-openssl.js","start":"DEBUG=openssl USELOCALLIB=true node example/basic.js"},"dependencies":{"debug":"^4.3.2","deferred":"^0.7.11","extend":"^3.0.2"},"gitHead":"81d2191bb2259820b457ad2cd95164152580103b","bugs":{"url":"https://github.com/andrewiski/openssl/issues"},"homepage":"https://github.com/andrewiski/openssl#readme","_id":"@andrewiski/openssl@1.0.2","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-Pa/7JsUZviL4CLOa1V+VNyswIYMtUS8D3HWJXx1Jox5P+BPF5m/E90GY6sAj2eFqE20QieUVvKe4HhwGpPTnxw==","shasum":"dd4f587da3d2d24a9de98f951c8a07dcf8f49548","tarball":"https://registry.npmjs.org/@andrewiski/openssl/-/openssl-1.0.2.tgz","fileCount":29,"unpackedSize":11164509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEpqNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNWQ/+KdpDyj1OLRJrJVw9epYDCnFQkAwq0oOw60mjByD4A+ZXR4dA\r\nfmcr2PwHmlL8kzbk29zjvqY5bPO79CdzyxH2SftOFP7rVMTQvLPPyWG3xNWq\r\n6WwyiJlgahtOJ69a88sDCzQWTX3w77okRKliF8LPfF2uylT9KvRHIv9XfsUD\r\n1n7XG0yk7m/KF48VsEf0yXZsHDSpyCD56yAKsnP0jmOtiE0lZfvQA5eoZAkC\r\n0f39DIBU5imBqONw8aFKr9cCIQTjdRwDfABNALD6ZcduyCBLhc/MiYiSRY2z\r\nJSdnPN7CJFf3PyB9dH7uwZl+6d42+RUz3gaQPaOlbMyy+PMXuzf4yhaaA1Yz\r\n6iH89N0Y3Qb47uODc+RPfpirCKRfuE5OcynbXpknp2uZXwmtCrsofxj6APSJ\r\nqdyDNIl0x/oQUFSqUngiy8kDhUAYNuTcxJKVClyjdJGkWkZvFRJnaAChjBp+\r\nW1aK4mDMeI6R+r6Tcsc4BoUoyC7rjSgi6IJoNLhwa3RUXox0wXY2Xzmx/RT+\r\nrtie8W4dv5BWh3VeHRiFRkhR00afs4VUUVn9FNIYI2NcG/te1ZsrOaca0BlK\r\nyj9VGCCYgQKgiUMG3l151WmzlR6VLe2/CW/QPCGuHw5bVUNT8xoi4yEGh39X\r\nZuUsw8txFdHBi31kFc5iB03N8OljBAJ4f0c=\r\n=aoRS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6NrR6/07OjPsN8C1mrEuYvyepJBbsuwmAq3vZUtRa4gIgMy1l8eVFtO5Jcoh55IizZWvsr6rhDTqd50+VBhZWWfo="}]},"_npmUser":{"name":"andrewiski","email":"adevries@digitalexample.com"},"directories":{},"maintainers":[{"name":"andrewiski","email":"adevries@digitalexample.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openssl_1.0.2_1645386380871_0.619909878509584"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-20T07:43:24.163Z","1.0.1":"2022-02-20T07:43:24.482Z","modified":"2022-04-04T14:01:28.805Z","1.0.2":"2022-02-20T19:46:21.152Z"},"maintainers":[{"name":"andrewiski","email":"adevries@digitalexample.com"}],"description":"Tool to assist with creating a CA using OpenSSL","homepage":"https://github.com/andrewiski/openssl#readme","repository":{"type":"git","url":"git+https://github.com/andrewiski/openssl.git"},"author":{"name":"Andrew DeVries","email":"adevries@digitalexample.com","url":"https://digitalexample.com"},"bugs":{"url":"https://github.com/andrewiski/openssl/issues"},"license":"GPL-3.0-or-later","readme":"# @Andrewiski/OpenSSL\n Node.js Open SSL Helper with LetsEncrypt Support\n\n Tool to assist with creating a CA using Open SSL as well as adding support for requesting lets Encrypt certificates\n\nTested on openSLL 3.0.1\n\n\nExample of creating a CA key and Cert then creating client, webserver, CRS and Certificate\n\n\nOpen and Debug examples/basic/basic.js using visual Code.\n\n\n```\n'use strict';\n\nconst path = require('path');\n\nOpenSSL = require(\"@andrewiski/openssl\");\n\n\nlet openSSLExePath = 'openssl';   //if just the exe name assumes its on the exectue path\n// if runing on Windows ie Proboly testing in Visual studio code use the included openssl \nif (process.platform === 'win32') {\n    \n    if (process.env.OPENSSL_PATH === undefined || process.env.OPENSSL_PATH === '') {\n        openSSLExePath = path.join(__dirname, '../../openssl', 'openssl.exe');\n    }\n}\n\n\nvar opensslOptions = {\n    opensslPath: openSSLExePath,\n    certificatesFolder:  path.join(__dirname,'certs'),\n    caFolder: path.join(__dirname,'certs' , 'ca'),\n    keySize: 4096, //2048\n    caDomainName: \"localhost\",\n    caPassword: null //\"mycapassword\"\n}\n\nvar openSSL = new OpenSSL(opensslOptions);\n\n//Create a CA\nopenSSL.createCA({overwriteExistingCAKeyFile:false, overwriteExistingCACertFile:false}).then(\n    function(result){\n        console.log(\"Successfully Created CA Key and Certificate\");\n\n        //Create a Client Auth Certificate\n        openSSL.createCertificate(\n            {\n                overwriteExistingKeyFile:false,\n                certificateId: \"johndoe\",\n                subject: \"/DC=localhost/DC=clients/CN=johndoe/C=US/ST=MI/L=AnyTown/O=Any Company/OU=Any Department/emailAddress=johndoe@example.com\",\n                subjectAltName : \"email:copy\",\n                x509Extensions : openSSL.defaultClientAuthX509Extensions,\n                createPfxFile:true,\n                pfxPassword: \"simplepassword\"\n            }\n        ).then(\n            function(result){\n                console.log(\"Successfully Created Client Auth Certificate\");\n            },\n            function(err){\n                console.error(err);\n                throw err;\n            }\n        );\n        //Create a web Server Certificate\n        openSSL.createCertificate(\n            {\n                overwriteExistingKeyFile:false,\n                certificateId: \"www\",\n                subject: \"/CN=www.localhost\",\n                subjectAltName : \"DNS:localhost,DNS:wwww.localhost,IP:127.0.0.1\",\n                x509Extensions : openSSL.defaultServerAuthX509Extensions,\n                createPfxFile:true,\n                pfxPassword: \"simplepassword\"\n            }\n        ).then(\n            function(result){\n                console.log(\"Successfully Created Web Server Certificate\");\n            },\n            function(err){\n                console.error(err);\n                throw err;\n            }\n        );\n\n\n        \n        //Create a web Server Certificate Request to send to the CA for Signing Use same library on Client\n        // Create the Key and CSR on Client only send CSR to Server for it to sign and send back that way the Private Key never leaves the box\n\n        openSSL.createCertificateSigningRequest(\n            {\n                overwriteExistingKeyFile:false,\n                certificateId: \"dev\",\n                subject: \"/CN=dev.localhost\",\n                subjectAltName : \"DNS:dev.localhost,DNS:www.dev.localhost,IP:127.0.0.1\",\n                x509Extensions : {\n                    basicConstraints: \"critical,CA:FALSE\",\n                    keyUsage : \"digitalSignature, nonRepudiation, keyEncipherment\",\n                    subjectKeyIdentifier: \"hash\",\n                    //authorityKeyIdentifier: \"keyid\",\n                    extendedKeyUsage: \"serverAuth\"  \n                }\n            }\n        ).then(\n            function(result){\n                console.log(\"Successfully Created Certificate Signing Request\");\n                //This typicaly would done on the server that is CA as if its on the same server no reason to make to calls\n\n                //This is not working not sure why but kee[ getting a need a a -key error but the csr should not need a key\n                openSSL.signCertificateSigningRequest({\n                    certificateId: \"dev\"\n                }).then(\n                    function(result){\n                        console.log(\"Successfully Created Certificate Using Certificate Signing Request\");\n                    },\n                    function(err){\n                        console.error(err);\n                        throw err;\n                    }\n                )\n                \n            },\n            function(err){\n                console.error(err);\n                throw err\n            }\n        );\n        \n\n    },\n    function(err){\n        console.error(err);\n        throw err\n    }\n);\n\n\n\n\n\n\n\n\n\n\n```\n","readmeFilename":"README.md"}