Skip to content

Commit

Permalink
fix(package): remove -utf8 option
Browse files Browse the repository at this point in the history
fixes #214

Signed-off-by: Josef Fröhle <[email protected]>
  • Loading branch information
Josef Fröhle committed Sep 14, 2018
1 parent d5a20dd commit 4d10fb2
Showing 1 changed file with 29 additions and 23 deletions.
52 changes: 29 additions & 23 deletions lib/pem.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,6 @@ 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 Expand Up @@ -237,7 +217,6 @@ function createCSR (options, callback) {
}

var params = ['req',
'-utf8',
'-new',
'-' + (options.hash || 'sha256')
]
Expand Down Expand Up @@ -471,7 +450,6 @@ function getPublicKey (certificate, callback) {

if (certificate.match(/BEGIN(\sNEW)? CERTIFICATE REQUEST/)) {
params = ['req',
'-utf8',
'-in',
'--TMPFILE--',
'-pubkey',
Expand All @@ -485,7 +463,6 @@ function getPublicKey (certificate, callback) {
]
} else {
params = ['x509',
'-utf8',
'-in',
'--TMPFILE--',
'-pubkey',
Expand Down Expand Up @@ -1280,3 +1257,32 @@ function readFromString (string, start, end) {

return output
}

// promisify not tested yet
/**
* Verifies the signing chain of the passed certificate
* @namespace
* @name promisified
* @property {function} createPrivateKey @see createPrivateKey
* @property {function} createDhparam - The default number of players.
* @property {function} createEcparam - The default level for the party.
* @property {function} createCSR - The default treasure.
* @property {function} createCertificate - How much gold the party starts with.
*/
module.exports.promisified = {
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)
}

0 comments on commit 4d10fb2

Please sign in to comment.