diff --git a/deno.jsonc b/deno.jsonc index 804bd69..4e93d7b 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -1,6 +1,6 @@ { "name": "@cross/jwt", - "version": "0.4.8", + "version": "0.4.9", "exports": "./mod.ts", "tasks": { diff --git a/src/cryptokeys.ts b/src/cryptokeys.ts index 4f9829b..360822f 100644 --- a/src/cryptokeys.ts +++ b/src/cryptokeys.ts @@ -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, ); @@ -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 },