output der as binstr, add comment

This commit is contained in:
AJ ONeal 2018-11-24 19:47:56 -07:00
parent 7a1df742aa
commit e8837a0721
2 changed files with 5 additions and 1 deletions

View file

@ -32,7 +32,7 @@ Rasha.generate({ format: 'jwk' }).then(function (keypair) {
* `format` defaults to `'jwk'`
* `'pkcs1'` (traditional)
* `'pkcs8'`
* `'pkcs8'` <!-- * `'ssh'` -->
* `modulusLength` defaults to 2048 (must not be lower)
* generally you shouldn't pick a larger key size - they're slow
* **2048** is more than sufficient

View file

@ -20,6 +20,10 @@ if (-1 !== [ 'jwk', 'pem', 'json', 'der', 'pkcs1', 'pkcs8', 'spki' ].indexOf(inf
, modulusLength: parseInt(format, 10) || 2048
, encoding: parseInt(format, 10) ? null : format
}).then(function (key) {
if ('der' === infile || 'der' === format) {
key.private = key.private.toString('binary');
key.public = key.public.toString('binary');
}
console.log(key.private);
console.log(key.public);
}).catch(function (err) {