Steps to reproduce: // SPKI representation of a P-384 EC key in a compressed form. const spki = new Uint8Array([48, 70, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 3, 50, 0, 2, 251, 203, 124, 105, 238, 28, 96, 87, 155, 231, 163, 52, 19, 72, 120, 217, 197, 197, 191, 53, 213, 82, 218, 182, 60, 1, 64, 57, 126, 209, 76, 239, 99, 125, 119, 32, 146, 92, 68, 105, 158, 163, 14, 114, 135, 76, 114, 251]) crypto.subtle.importKey('spki', spki, { name: 'ECDSA', namedCurve: 'P-384' }, false, ['verify']) Actual result: importKey is rejected with DataError: Data provided to an operation does not meet requirements Expected result: compressed EC public key SPKI should import as in other browsers (we expect interoperability in this regard)
Likewise, same issue, when using the raw keyFormat const pub = new Uint8Array([2, 251, 203, 124, 105, 238, 28, 96, 87, 155, 231, 163, 52, 19, 72, 120, 217, 197, 197, 191, 53, 213, 82, 218, 182, 60, 1, 64, 57, 126, 209, 76, 239, 99, 125, 119, 32, 146, 92, 68, 105, 158, 163, 14, 114, 135, 76, 114, 251]) await crypto.subtle.importKey('raw', pub, { name: 'ECDSA', namedCurve: 'P-384' }, false, ['verify']) importKey is rejected with DataError: Data provided to an operation does not meet requirements
<rdar://problem/86211772>
Pull request: https://github.com/WebKit/WebKit/pull/3406
*** Bug 244005 has been marked as a duplicate of this bug. ***
*** Bug 244032 has been marked as a duplicate of this bug. ***
*** Bug 244083 has been marked as a duplicate of this bug. ***