|
|
@ -342,3 +342,21 @@ Enc.bufToUrlBase64 = function (buf) { |
|
|
|
return Buffer.from(buf).toString('base64') |
|
|
|
.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); |
|
|
|
}; |
|
|
|
|
|
|
|
// 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 { |
|
|
|
return Eckles.importSync(opts); |
|
|
|
} |
|
|
|
}; |
|
|
|
// PLEASE do not use these, they are deprecated
|
|
|
|
Keypairs._exportSync = function (opts) { |
|
|
|
if ('RSA' === opts.jwk.kty) { |
|
|
|
return Rasha.exportSync(opts); |
|
|
|
} else { |
|
|
|
return Eckles.exportSync(opts); |
|
|
|
} |
|
|
|
}; |