crypto.webkitSubtle.generateKey({ name: "RSA-OAEP", modulusLength: 2048, publicExponent: new Uint8Array([0x01, 0x00, 0x01]), hash: {name: "SHA-256"} }, true, ["encrypt", "decrypt" ]).then((keypair) => { console.log("Generated Key Pair:", keypair); return crypto.webkitSubtle.exportKey("jwk", keypair.publicKey); }).then((keydata) => { console.log("Key Data:", keydata); }).catch((error) => { console.log("Error: ", error); }); The code above should be able log both the newly Generated Key Pair and also log the Key Data. It successfully generates the key pair: [Log] Generated Key Pair: – KeyPair {publicKey: Key, privateKey: Key} KeyPair {publicKey: Key, privateKey: Key}KeyPairprivateKey: Key {type: "private", extractable: true, algorithm: Object, usages: ["decrypt", "encrypt"]}KeypublicKey: Key {type: "public", extractable: true, algorithm: Object, usages: ["decrypt", "encrypt"]}KeyKeyPair Prototype But not able to export it: [Log] Error: TypeError: Key algorithm and size do not map to any JWK algorithm identifier exportKey promiseReactionJob
<rdar://problem/25507292>
From the ChangeLog in <http://trac.webkit.org/changeset/159944>: This is happening because RSA-OAEP in JWK is more limited than general WebCrypto, as JWK only allows SHA-1 as hash. I'm not sure whether that statement is correct.
It looks like we are not up-to-date with http://www.w3.org/TR/WebCryptoAPI/.
That statement is probably obsolete, JWK added many new identifiers since then.
This bug should be resolved by Bug 164722.