ecdsa-csr.js/bin/ecdsacsr.js

17 lines
405 B
JavaScript
Raw Normal View History

2018-11-18 10:21:48 +00:00
#!/usr/bin/env node
2018-11-18 10:13:17 +00:00
'use strict';
var fs = require('fs');
var ecdsacsr = require('../index.js');
var keyname = process.argv[2];
var domains = process.argv[3].split(/,/);
var keypem = fs.readFileSync(keyname, 'ascii');
ecdsacsr({ key: keypem, domains: domains }).then(function (csr) {
console.error("CN=" + domains[0]);
console.error("subjectAltName=" + domains.join(','));
console.log(csr);
});