Browse Source

v1.2.13: add support for rsa-compat

tags/v1.2.13
AJ ONeal 6 months ago
parent
commit
5dc3795a17
2 changed files with 25 additions and 3 deletions
  1. 18
    0
      keypairs.js
  2. 7
    3
      package.json

+ 18
- 0
keypairs.js View File

@@ -342,3 +342,21 @@ Enc.bufToUrlBase64 = function (buf) {
342 342
   return Buffer.from(buf).toString('base64')
343 343
     .replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
344 344
 };
345
+
346
+// For 'rsa-compat' module only
347
+// PLEASE do not use these sync methods, they are deprecated
348
+Keypairs._importSync = function (opts) {
349
+  if ('RSA' === opts.jwk.kty) {
350
+    return Rasha.importSync(opts);
351
+  } else {
352
+    return Eckles.importSync(opts);
353
+  }
354
+};
355
+// PLEASE do not use these, they are deprecated
356
+Keypairs._exportSync = function (opts) {
357
+  if ('RSA' === opts.jwk.kty) {
358
+    return Rasha.exportSync(opts);
359
+  } else {
360
+    return Eckles.exportSync(opts);
361
+  }
362
+};

+ 7
- 3
package.json View File

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "name": "keypairs",
3
-  "version": "1.2.12",
4
-  "description": "Lightweight RSA/ECDSA keypair generation and JWK <-> PEM",
3
+  "version": "1.2.13",
4
+  "description": "Lightweight RSA/ECDSA keypair generation and JWK <-> PEM using node's native RSA and ECDSA support",
5 5
   "main": "keypairs.js",
6 6
   "files": [
7 7
     "bin/keypairs.js"
@@ -21,7 +21,11 @@
21 21
     "RSA",
22 22
     "ECDSA",
23 23
     "PEM",
24
-    "JWK"
24
+    "JWK",
25
+    "keypair",
26
+    "crypto",
27
+    "sign",
28
+    "verify"
25 29
   ],
26 30
   "author": "AJ ONeal <coolaj86@gmail.com> (https://coolaj86.com/)",
27 31
   "license": "MPL-2.0",

Loading…
Cancel
Save