|
|
@ -346,10 +346,14 @@ Enc.bufToUrlBase64 = function (buf) { |
|
|
|
// For 'rsa-compat' module only
|
|
|
|
// PLEASE do not use these sync methods, they are deprecated
|
|
|
|
Keypairs._importSync = function (opts) { |
|
|
|
if ('RSA' === opts.jwk.kty) { |
|
|
|
return Rasha.importSync(opts); |
|
|
|
} else { |
|
|
|
try { |
|
|
|
return Eckles.importSync(opts); |
|
|
|
} catch(e) { |
|
|
|
try { |
|
|
|
return Rasha.importSync(opts); |
|
|
|
} catch(e) { |
|
|
|
console.error("options.pem does not appear to be a valid RSA or ECDSA public or private key"); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
// PLEASE do not use these, they are deprecated
|
|
|
|