Skip to content

Commit e7abb55

Browse files
committed
readme
1 parent 4231f93 commit e7abb55

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ This library developed and tested primary for Node.js, but it still can work in
4646
```javascript
4747
var NodeRSA = require('node-rsa');
4848

49-
var key = new NodeRSA([keyData], [format], [options]);
49+
var key = new NodeRSA([keyData, [format]], [options]);
5050
```
5151

52-
**keyData**`{string|buffer|object}` — parameters of a generated key or the key in one of supported formats.<br/>
53-
**format**`{string}` — format for importing key. See more details about formats in [Export/Import](#importexport-keys) section<br/>
54-
**options**`{object}` — additional settings
52+
* **keyData**`{string|buffer|object}` — parameters for generating key or the key in one of supported formats.<br/>
53+
* **format**`{string}` — format for importing key. See more details about formats in [Export/Import](#importexport-keys) section.<br/>
54+
* **options**`{object}` — additional settings.
5555

5656
#### Options
57-
You can specify some options by second constructor argument, or over `key.setOptions()` method.
57+
You can specify some options by second/third constructor argument, or over `key.setOptions()` method.
5858

5959
* **environment** — working environment, `'browser'` or `'node'`. Default autodetect.
6060
* **encryptionScheme** — padding scheme for encrypt/decrypt. Can be `'pkcs1_oaep'` or `'pkcs1'`. Default `'pkcs1_oaep'`.
@@ -89,6 +89,14 @@ var key = new NodeRSA();
8989
var key = new NodeRSA({b: 512});
9090
```
9191

92+
Also you can use next method:
93+
94+
```javascript
95+
key.generateKeyPair([bits], [exp]);
96+
```
97+
**bits**`{int}` — key size in bits. 2048 by default.
98+
**exp**`{int}` — public exponent. 65537 by default.
99+
92100
#### Load key from PEM string
93101

94102
```javascript
@@ -103,14 +111,6 @@ var key = new NodeRSA('-----BEGIN RSA PRIVATE KEY-----\n'+
103111
'-----END RSA PRIVATE KEY-----');
104112
```
105113

106-
Also you can use next methods:
107-
108-
```javascript
109-
key.generateKeyPair([bits], [exp]);
110-
```
111-
**bits**`{int}` — key size in bits. 2048 by default.
112-
**exp**`{int}` — public exponent. 65537 by default.
113-
114114
### Import/Export keys
115115
```javascript
116116
key.importKey(keyData, [format]);

0 commit comments

Comments
 (0)