Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1bc6f8d
Merge pull request #112 from rzcoder/stage
rzcoder May 14, 2018
73cb4c2
add documentation to import public key from modulus and exponent
May 14, 2018
884f98f
Merge pull request #113 from MaximeThoonsen/master
rzcoder May 14, 2018
8718e9b
Update README.md
rzcoder May 14, 2018
049fac8
Support Node v6
teppeis May 16, 2018
da04387
Merge pull request #116 from teppeis/node-v6
rzcoder May 16, 2018
885c220
NodeRSA.importKey() now returns this
dgramop Aug 1, 2018
ad881cd
Merge pull request #124 from dgramop/patch-1
rzcoder Aug 1, 2018
66149c5
Merge pull request #125 from rzcoder/stage
rzcoder Aug 1, 2018
763bee2
update tests
rzcoder Aug 1, 2018
a0dc3c6
update readme
rzcoder Aug 1, 2018
4fce444
Make the pkcs1 format more accepting of cruft
garethsime Sep 20, 2018
41a622f
Merge pull request #131 from garethsime/master
rzcoder Dec 12, 2018
5e4806c
Importing keys from PEM now is less dependent on non-key data in file…
rzcoder Dec 12, 2018
05f043f
Allow keys without BEGIN/END boundaries to be loaded
Jan 23, 2019
7a9f0a4
Validate correct objects in tests
Jan 24, 2019
4aa8265
Merge pull request #140 from enver/master
rzcoder Jan 24, 2019
5fba405
Merge pull request #142 from enver/fix-test
rzcoder Jan 24, 2019
8fda923
es5 compatible
rzcoder Jan 24, 2019
8c4b106
add test cases
rzcoder Jan 24, 2019
89c4626
fix: Change let - var for es5 compatible
andrufel94 Feb 22, 2019
b7651e6
Merge pull request #1 from andrufel94/fix/pkcs1-es5
andrufel94 Feb 22, 2019
81721e1
Merge pull request #147 from andrufel94/master
rzcoder Mar 4, 2019
b4d0aa6
version bump
rzcoder Mar 4, 2019
9feef4b
fix .npmignore
rzcoder Mar 4, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.idea
.tmp
node_modules/
node_modules/
.nyc_output
6 changes: 5 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
test
.travis.yml
.travis.yml
.nyc_output
.tmp
.idea
.DS_Store
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
language: node_js
node_js:
- '8.11.1'
- 'stable'
- '6'
- '8'
- 'stable'

sudo: false

Expand All @@ -10,4 +11,3 @@ before_install:
- npm install -g grunt-cli
install:
- npm install

26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ const privateDer = key.exportKey('pkcs1-der');

```javascript
key.importKey({
n: new Buffer('0086fa9ba066685845fc03833a9699c8baefb53cfbf19052a7f10f1eaa30488cec1ceb752bdff2df9fad6c64b3498956e7dbab4035b4823c99a44cc57088a23783', 'hex'),
n: Buffer.from('0086fa9ba066685845fc03833a9699c8baefb53cfbf19052a7f10f1eaa30488cec1ceb752bdff2df9fad6c64b3498956e7dbab4035b4823c99a44cc57088a23783', 'hex'),
e: 65537,
d: new Buffer('5d2f0dd982596ef781affb1cab73a77c46985c6da2aafc252cea3f4546e80f40c0e247d7d9467750ea1321cc5aa638871b3ed96d19dcc124916b0bcb296f35e1', 'hex'),
p: new Buffer('00c59419db615e56b9805cc45673a32d278917534804171edcf925ab1df203927f', 'hex'),
q: new Buffer('00aee3f86b66087abc069b8b1736e38ad6af624f7ea80e70b95f4ff2bf77cd90fd', 'hex'),
dmp1: new Buffer('008112f5a969fcb56f4e3a4c51a60dcdebec157ee4a7376b843487b53844e8ac85', 'hex'),
dmq1: new Buffer('1a7370470e0f8a4095df40922a430fe498720e03e1f70d257c3ce34202249d21', 'hex'),
coeff: new Buffer('00b399675e5e81506b729a777cc03026f0b2119853dfc5eb124610c0ab82999e45', 'hex')
d: Buffer.from('5d2f0dd982596ef781affb1cab73a77c46985c6da2aafc252cea3f4546e80f40c0e247d7d9467750ea1321cc5aa638871b3ed96d19dcc124916b0bcb296f35e1', 'hex'),
p: Buffer.from('00c59419db615e56b9805cc45673a32d278917534804171edcf925ab1df203927f', 'hex'),
q: Buffer.from('00aee3f86b66087abc069b8b1736e38ad6af624f7ea80e70b95f4ff2bf77cd90fd', 'hex'),
dmp1: Buffer.from('008112f5a969fcb56f4e3a4c51a60dcdebec157ee4a7376b843487b53844e8ac85', 'hex'),
dmq1: Buffer.from('1a7370470e0f8a4095df40922a430fe498720e03e1f70d257c3ce34202249d21', 'hex'),
coeff: Buffer.from('00b399675e5e81506b729a777cc03026f0b2119853dfc5eb124610c0ab82999e45', 'hex')
}, 'components');
const publicComponents = key.exportKey('components-public');
console.log(publicComponents);
Expand All @@ -165,7 +165,14 @@ console.log(publicComponents);
*/
```

If you want to only import the public key use `'components-public'` as an option:

```javascript
key.importKey({
n: Buffer.from('0086fa9ba066685845fc03833a9699c8baefb53cfbf19052a7f10f1eaa30488cec1ceb752bdff2df9fad6c64b3498956e7dbab4035b4823c99a44cc57088a23783', 'hex'),
e: 65537,
}, 'components-public');
```

### Properties

Expand Down Expand Up @@ -237,8 +244,11 @@ Questions, comments, bug reports, and pull requests are all welcome.

## Changelog

### 1.0.2
* Importing keys from PEM now is less dependent on non-key data in files.

### 1.0.1
* `importKey()` now returns this
* `importKey()` now returns `this`

### 1.0.0
* Using semver now 🎉
Expand Down
Loading