Javascript – Importing a key for ECDH key derivation in subtle crypto
let randKey = window.crypto.getRandomValues(new Uint8Array(64)); let importedKey = await window.crypto.subtle.importKey("raw", randKey, { name: "ECDH", namedCurve: "P-256", }, false, ["deriveKey"] ); Yet this fails with the error: Uncaught DOMException: Cannot create a key using the specified key usages. How do I…