Skip to content

Commit

Permalink
adding options for -CAcreateserial (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Rhea authored and Dexus committed Oct 13, 2016
1 parent be54d61 commit 9ae5ff0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/pem.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,17 @@ function createCertificate(options, callback) {
var tmpfiles = [options.csr];

if (options.serviceCertificate) {
if (!options.serial) {
return callback(new Error('serial option required for CA signing'));
}

params.push('-CA');
params.push('--TMPFILE--');
params.push('-CAkey');
params.push('--TMPFILE--');
params.push('-set_serial');
params.push('0x' + ('00000000' + options.serial.toString(16)).slice(-8));
if (options.serial) {
params.push('-set_serial');
params.push('0x' + ('00000000' + options.serial.toString(16)).slice(-8));
} else {
params.push('-CAcreateserial');
}
if(options.serviceKeyPassword){
params.push('-passin');
params.push('pass:' + options.serviceKeyPassword);
Expand Down

0 comments on commit 9ae5ff0

Please sign in to comment.