Guest User

Untitled

a guest
Feb 15th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. const clientData = JSON.stringify({
  2. challenge: base64url.encode(Buffer.from(publicKeyCreationOptions.challenge as ArrayBuffer)),
  3. hashAlgorithm: 'SHA-256',
  4. origin,
  5. type: 'webauthn.create',
  6. });
  7.  
  8. const keyParams: EcdsaParams = { name: 'ECDSA', hash: 'SHA-256' };
  9. const signature = await window.crypto.subtle.sign(
  10. keyParams,
  11. keyPair.privateKey,
  12. new TextEncoder().encode(clientData),
  13. );
Add Comment
Please, Sign In to add comment