Open simon-p-r opened 10 years ago
Empty passphrase is the default, or you can pass null/false/undefined .
Bit length is not configurable, but you could add an option for it: https://github.com/ericvicenti/ssh-keygen/blob/master/src/ssh-keygen.js#L50
I'd be happy to merge and release any upgrades you've got, adding this as an opt would be pretty easy.
Also, check out the pem module. It is a more mature alternative which I stumbled upon after writing this module.
Thanks
I have tried passing null, false or undefined to passphrase but it doesn't work. I have attached code;
var keygen = require('ssh-keygen'); var fs = require('fs'); var config = { comment: 'wonderful comment', password: 'testing1234', location: '/path/to/store/key', read: true };
var comment = config.comment; var password = config.password; var location = config.location; var read = config.read;
keygen({location: location,comment:comment, password: password, read: read}, function(err, out){ console.log('SSH keys being created!'); fs.writeFile(location, out.key, function (err) { if (err) throw err; console.log('Private key created!'); fs.writeFile(location + '.pub', out.pubKey, function (err) { if (err) throw err; console.log('Public key created!'); }); }); });
Maybe you can show me how to override passphrase as trying to make it generic?
Cheers Simon
Hi
Nice module however I can't seem to leave passphrase empty and configure the bits length -is that right?
Thanks Simon