-
Notifications
You must be signed in to change notification settings - Fork 17
/
crl.js
44 lines (36 loc) · 918 Bytes
/
crl.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* Creates CRL
*/
var spawn = require('child_process').spawn;
var log = require('fancy-log');
var fs = require('fs-extra');
/*
* Creates / updates CRL and overwrites old version.
*/
var createCRL = function() {
crl = spawn('openssl', [
'ca',
'-config', 'openssl.cnf',
'-gencrl',
'-out', 'crl/crl.pem'
], {
cwd: global.paths.pkipath + 'intermediate',
shell: true,
detached: true
});
// Enter ocsp private key password
crl.stdin.write(global.config.ca.intermediate.passphrase + '\n');
crl.on('error', function(error) {
log("Error during crl generation: " + error);
});
crl.on('exit', function(code, signal){
if(code === 0) {
log("CRL successfully created");
} else {
log.error("Error during CRL creation")
}
});
};
module.exports = {
createCRL: createCRL
}