summaryrefslogtreecommitdiffhomepage
path: root/packages/server/src/helpers/iso/isoCrypto/importKey.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2023-08-22 10:13:03 -0700
committerGitHub <noreply@github.com>2023-08-22 10:13:03 -0700
commitfefc95e4535e6ecf903f647124a492fba3fd11d6 (patch)
tree4c924d43d32fb12a780533302eaf5dee08875d75 /packages/server/src/helpers/iso/isoCrypto/importKey.ts
parent443c341bc2163f07b93a3ef84a43294d10b826f8 (diff)
parent2935857c76d458c26701842e500f8d97d17499c5 (diff)
Merge pull request #425 from MasterKale/feat/server-esm-take-2-dnt
feat/server-esm-take-2-dnt
Diffstat (limited to 'packages/server/src/helpers/iso/isoCrypto/importKey.ts')
-rw-r--r--packages/server/src/helpers/iso/isoCrypto/importKey.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/server/src/helpers/iso/isoCrypto/importKey.ts b/packages/server/src/helpers/iso/isoCrypto/importKey.ts
index 4d2ef2b..bfe8f66 100644
--- a/packages/server/src/helpers/iso/isoCrypto/importKey.ts
+++ b/packages/server/src/helpers/iso/isoCrypto/importKey.ts
@@ -1,10 +1,14 @@
-import WebCrypto from '@simplewebauthn/iso-webcrypto';
+import { getWebCrypto } from './getWebCrypto.ts';
export async function importKey(opts: {
keyData: JsonWebKey;
algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams;
}): Promise<CryptoKey> {
+ const WebCrypto = await getWebCrypto();
+
const { keyData, algorithm } = opts;
- return WebCrypto.subtle.importKey('jwk', keyData, algorithm, false, ['verify']);
+ return WebCrypto.subtle.importKey('jwk', keyData, algorithm, false, [
+ 'verify',
+ ]);
}