File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ Also you can use next method:
9494``` javascript
9595key .generateKeyPair ([bits], [exp]);
9696```
97+
9798* ** bits** — ` {int} ` — key size in bits. 2048 by default.
9899* ** exp** — ` {int} ` — public exponent. 65537 by default.
99100
@@ -116,16 +117,20 @@ var key = new NodeRSA('-----BEGIN RSA PRIVATE KEY-----\n'+
116117key .importKey (keyData, [format]);
117118key .exportKey ([format]);
118119```
120+
119121* ** keyData** — ` {string|buffer} ` — key in PEM string ** or** Buffer contains PEM string ** or** Buffer contains DER encoded data.
120122* ** format** — ` {string} ` — format id for export/import.
121123
122124#### Format string syntax
123125Format string composed of several parts: ` scheme-[key_type]-[output_type] `
124126** Scheme** — NodeRSA supports multiple format schemes for import/export keys:
127+
125128 * ` 'pkcs1' ` — public key starts from ` '-----BEGIN RSA PUBLIC KEY-----' ` header and private key starts from ` '-----BEGIN RSA PRIVATE KEY-----' header `
126129 * ` 'pkcs8' ` — public key starts from ` '-----BEGIN PUBLIC KEY-----' ` header and private key starts from ` '-----BEGIN PRIVATE KEY-----' header `
130+
127131** Key type** — can be ` 'private' ` or ` 'public' ` . Default ` 'private' `
128132** Output type** — can be:
133+
129134 * ` 'pem' ` — Base64 encoded string with header and footer. Used by default.
130135 * ` 'der' ` — Binary encoded key data.
131136
You can’t perform that action at this time.
0 commit comments