Skip to content

Commit afb6ce9

Browse files
committed
key size check
1 parent 56c73c9 commit afb6ce9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/NodeRSA.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ module.exports = (function() {
4747
bits = bits || 2048;
4848
exp = 65537;
4949

50-
if (bits % 2 == 1) {
51-
throw Error('Key size must be even.');
50+
if (bits % 8 != 0) {
51+
throw Error('Key size must be a multiple of 8.');
5252
}
5353

5454
this.keyPair.generate(bits, exp.toString(16));

0 commit comments

Comments
 (0)