output der as binstr, add comment
This commit is contained in:
parent
7a1df742aa
commit
e8837a0721
2 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue