Bug 309347
| Summary: | SubtleCrypto.importKey is unable to import a private Key that is working fine in chrome and other browsers | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | pjain <pranjal.jain> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | ||
| Priority: | P2 | ||
| Version: | Safari 26 | ||
| Hardware: | iPhone / iPad | ||
| OS: | iOS 26 | ||
pjain
Steps to reproduce:
// PKCS8 representation of a P-256 EC private key with the public key omitted
const pkcs8 = new Uint8Array([48,129,147,2,1,0,48,19,6,7,42,134,72,206,61,2,1,6,8,42,134,72,206,61,3,1,7,4,121,48,119,2,1,1,4,32,232,48,70,210,221,56,109,25,129,113,81,91,165,225,251,99,14,164,11,105,244,7,43,71,62,179,7,61,139,30,152,238,160,10,6,8,42,134,72,206,61,3,1,7,161,68,3,66,0,4,35,226,167,162,21,4,6,207,12,238,2,40,121,168,11,16,254,151,85,17,145,148,140,207,195,45,28,100,59,133,45,128,181,196,131,11,196,108,181,186,254,28,93,236,21,167,43,55,221,253,93,124,177,161,71,92,58,179,154,198,150,54,20,223])
await crypto.subtle.importKey('pkcs8', pkcs8, { name: 'ECDSA', namedCurve: 'P-256' }, true, ['sign'])
Actual results:
importKey is rejected with DataError: Data provided to an operation does not meet requirements
Expected results:
EC private key PKCS8 without the public key component should import as in other browsers
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
pjain
*** This bug has been marked as a duplicate of bug 233705 ***