2018-12-16 09:54:57 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var fs = require('fs');
|
|
|
|
var rsacsr = require('../index.js');
|
|
|
|
|
|
|
|
var keyname = process.argv[2];
|
|
|
|
var domains = process.argv[3].split(/,/);
|
|
|
|
|
|
|
|
var key = fs.readFileSync(keyname, 'ascii');
|
|
|
|
|
|
|
|
try {
|
|
|
|
key = JSON.parse(key);
|
|
|
|
} catch(e) {
|
|
|
|
// ignore
|
|
|
|
}
|
|
|
|
|
2019-06-03 09:27:38 +00:00
|
|
|
var csr = rsacsr.sync({ key: key, domains: domains });
|
|
|
|
console.log(csr);
|
|
|
|
/*
|
|
|
|
.then(function (csr) {
|
2018-12-16 09:54:57 +00:00
|
|
|
// Using error so that we can redirect stdout to file
|
|
|
|
//console.error("CN=" + domains[0]);
|
|
|
|
//console.error("subjectAltName=" + domains.join(','));
|
|
|
|
console.log(csr);
|
|
|
|
});
|
2019-06-03 09:27:38 +00:00
|
|
|
*/
|