We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 758f829 commit 0b9245bCopy full SHA for 0b9245b
lib/utils/webcrypto.js
@@ -51,6 +51,7 @@ function decodeBase64(b64) {
51
52
// need more test
53
async function publicEncrypt(key, data) {
54
+ key = key.toString()
55
const pemHeader = "-----BEGIN PUBLIC KEY-----\n";
56
const pemFooter = "\n-----END PUBLIC KEY-----";
57
key = key.trim();
@@ -59,14 +60,14 @@ async function publicEncrypt(key, data) {
59
60
const importedKey = await subtleCrypto.importKey(
61
"spki",
62
decodeBase64(key),
- { name: "RSA-OAEP", hash: "SHA-256" },
63
+ { name: "RSA-OAEP", hash: "SHA-1" },
64
false,
65
["encrypt"],
66
);
67
68
const encryptedData = await subtleCrypto.encrypt(
69
{
- name: "RSA-OAEP",
70
+ name: "RSA-OAEP"
71
},
72
importedKey,
73
data,
0 commit comments