backwards compat fix
This commit is contained in:
parent
ec4118a988
commit
7776aaa785
8
node.js
8
node.js
|
@ -161,6 +161,11 @@ function create(deps) {
|
|||
function (keypair, header, protect, payload) {
|
||||
// old (keypair, payload, nonce)
|
||||
var nonce;
|
||||
|
||||
keypair = RSA._internal.import(keypair);
|
||||
keypair = RSA._internal.importForge(keypair);
|
||||
keypair.publicKeyJwk = RSA.exportPublicJwk(keypair);
|
||||
|
||||
if ('string' === typeof protect || ('undefined' === typeof protect && 'undefined' === typeof payload)) {
|
||||
console.warn("deprecation notice: new signature for signJws(keypair, header, protect, payload)");
|
||||
// old API
|
||||
|
@ -173,9 +178,6 @@ function create(deps) {
|
|||
};
|
||||
protect = { nonce: nonce };
|
||||
}
|
||||
keypair = RSA._internal.import(keypair);
|
||||
keypair = RSA._internal.importForge(keypair);
|
||||
keypair.publicKeyJwk = RSA.exportPublicJwk(keypair);
|
||||
|
||||
// Compute JWS signature
|
||||
var protectedHeader = "";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "rsa-compat",
|
||||
"version": "2.0.0",
|
||||
"version": "1.3.2",
|
||||
"description": "RSA utils that work on Windows, Mac, and Linux with or without C compiler",
|
||||
"main": "node.js",
|
||||
"bin": {
|
||||
|
|
Loading…
Reference in New Issue