blob: 0153dd5b4fbba773659e810d442319298869d206 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
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",
]);
}
|