Skip to content

Commit ec52a27

Browse files
committed
readme
1 parent c90e841 commit ec52a27

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ Also you can use next method:
9494
```javascript
9595
key.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'+
116117
key.importKey(keyData, [format]);
117118
key.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
123125
Format 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

0 commit comments

Comments
 (0)