Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async importPublicKey(key: string): Promise {
const buffer = parsePublicPEMKey(key);
const cryptoKey = await crypto.subtle.importKey(
'spki',
buffer,
{
name: 'ECDSA',
namedCurve: BrowserSigningCryptoImpl.NAMED_CURVE,
},
true,
['verify']
);
return new BrowserPublicCryptoKey(cryptoKey);
}