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 4760d37Copy full SHA for 4760d37
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,15 @@ 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
{
70
name: "RSA-OAEP",
71
+ hash: { name: 'SHA-1' },
72
},
73
importedKey,
74
data,
0 commit comments