Skip to content

Commit

Permalink
use crypto from global. Closes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Pinta365 committed Jun 17, 2024
1 parent 2b4fca3 commit 2e430eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cross/jwt",
"version": "0.4.8",
"version": "0.4.9",
"exports": "./mod.ts",

"tasks": {
Expand Down
4 changes: 2 additions & 2 deletions src/cryptokeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export async function exportPEMKey(key: CryptoKey, filePathOrOptions?: string |

const keyType = key.type;

const exportedKey = await window.crypto.subtle.exportKey(
const exportedKey = await crypto.subtle.exportKey(
keyType === "private" ? "pkcs8" : "spki",
key,
);
Expand Down Expand Up @@ -291,7 +291,7 @@ export async function importPEMKey(keyDataOrPath: string, algorithm: SupportedKe
const pemContents = pemString.substring(pemHeader.length, pemString.length - pemFooter.length);
const binaryDer = decodeBase64(pemContents);

return await window.crypto.subtle.importKey(
return await crypto.subtle.importKey(
keyType === "private" ? "pkcs8" : "spki",
binaryDer,
{ ...algo },
Expand Down

0 comments on commit 2e430eb

Please sign in to comment.