-
Hi import * as jose from "jose";
const algorithm = "ES256";
const spki = `-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEFlHHWfLk0gLBbsLTcuCrbCqoHqmM
YJepMC+Q+Dd6RBmBiA41evUsNMwLeN+PNFqib+xwi9JkJ8qhZkq8Y/IzGg==
-----END PUBLIC KEY-----`;
const ecPublicKey = await jose.importSPKI(spki, algorithm);
console.log({ ecPublicKey }); The code is one of the samples of the repository. TypeError: keyData: Is not ArrayBufferView or ArrayBuffer
at EcdsaProvider.checkKeyData (/app/node_modules/webcrypto-core/build/webcrypto-core.js:289:19)
at EcdsaProvider.checkImportKey (/app/node_modules/webcrypto-core/build/webcrypto-core.js:221:14)
at EcdsaProvider.importKey (/app/node_modules/webcrypto-core/build/webcrypto-core.js:216:29)
at SubtleCrypto.importKey (/app/node_modules/webcrypto-core/build/webcrypto-core.js:848:29)
at genericImport (evalmachine.<anonymous>:5080:73)
at fromSPKI (evalmachine.<anonymous>:5086:12)
at Module.importSPKI (evalmachine.<anonymous>:3776:70) Anyone has any idea why I'm getting this error? |
Beta Was this translation helpful? Give feedback.
Answered by
panva
Feb 19, 2022
Replies: 1 comment 4 replies
-
That's not a native WebCrypto implementation you're using, is it... |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
panva
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's not a native WebCrypto implementation you're using, is it...