enrollment-bbk-per-passkey.https.html (1589B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Test for the 'secure-payment-confirmation' payment method authentication - browser bound key per passkey</title> 4 <link rel="help" href="https://w3c.github.io/secure-payment-confirmation/#sctn-binding-a-keypair"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="/resources/testdriver.js"></script> 8 <script src="/resources/testdriver-vendor.js"></script> 9 <script src=../webauthn/resources/common-inputs.js></script> 10 <script src=../webauthn/resources/utils.js></script> 11 <script src="utils.sub.js"></script> 12 <script src="utils-bbk.js"></script> 13 <script> 14 'use strict'; 15 16 promise_test(async t => { 17 await window.test_driver.add_virtual_authenticator( 18 AUTHENTICATOR_OPTS) 19 .then(authenticator => { 20 t.add_cleanup(() => { 21 return window.test_driver.remove_virtual_authenticator(authenticator); 22 }); 23 }); 24 25 const credential1 = await createCredential(); 26 const browserBoundPublicKey1 = getBrowserBoundPublicKeyFromCredential(credential1); 27 28 const credential2 = await createCredential(); 29 const browserBoundPublicKey2 = getBrowserBoundPublicKeyFromCredential(credential2); 30 31 if (browserBoundPublicKey1 === undefined && browserBoundPublicKey2 === undefined) { 32 return; 33 } 34 assert_not_equals(browserBoundPublicKey1, browserBoundPublicKey2, 35 'The browser bound key must be different for different passkeys.'); 36 }, 'If a browser bound keys are created on enrollment then a different browser bound key is created for a different passkey'); 37 </script>