Skip to content

Commit

Permalink
feat(package): add promisify methods pem.promisify.FUNCTIONNAME
Browse files Browse the repository at this point in the history
Signed-off-by: Josef Fröhle <[email protected]>
  • Loading branch information
Josef Fröhle committed Sep 11, 2018
1 parent 4a2754a commit 8a0c1bc
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 7 deletions.
22 changes: 22 additions & 0 deletions lib/pem.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @module pem
*/

const {promisify} = require("es6-promisify");
var net = require('net')
var helper = require('./helper.js')
var openssl = require('./openssl.js')
Expand All @@ -26,6 +27,27 @@ module.exports.verifySigningChain = verifySigningChain
module.exports.checkCertificate = checkCertificate
module.exports.checkPkcs12 = checkPkcs12
module.exports.config = config

// promisify not tested yet
const promisifyObj = {
createPrivateKey: promisify(createPrivateKey),
createDhparam: promisify(createDhparam),
createEcparam: promisify(createEcparam),
createCSR: promisify(createCSR),
createCertificate: promisify(createCertificate),
readCertificateInfo: promisify(readCertificateInfo),
getPublicKey: promisify(getPublicKey),
getFingerprint: promisify(getFingerprint),
getModulus: promisify(getModulus),
getDhparamInfo: promisify(getDhparamInfo),
createPkcs12: promisify(createPkcs12),
readPkcs12: promisify(readPkcs12),
verifySigningChain: promisify(verifySigningChain),
checkCertificate: promisify(checkCertificate),
checkPkcs12: promisify(checkPkcs12)
}
module.exports.promisified = promisifyObj

/**
* quick access the convert module
* @type {module:convert}
Expand Down
21 changes: 14 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
]
},
"dependencies": {
"es6-promisify": "^6.0.0",
"md5": "^2.2.1",
"os-tmpdir": "^1.0.1",
"which": "^1.3.1"
Expand Down

0 comments on commit 8a0c1bc

Please sign in to comment.