17

On MS Edge following unwrapping code works:

window.crypto.subtle.unwrapKey(
                                "raw",
                                wrappedKey,
                                derivedKey,
                                { "name": "AES-KW", iv: iv },
                                { "name": "AES-CBC", iv: iv },
                                false,
                                ["decrypt"]
                            )

The IE11 implementation is based on a unfinished version of the W3C WebCrypto APIs, there is a documentation but there isn't any example code available and my tries have not worked so far. Following does not throw an error on IE11 but the resulting key is null:

window.msCrypto.subtle.unwrapKey(
                                    wrappedKey,                                        
                                    {
                                        "name": "AES-KW",
                                        iv: iv
                                    },
                                    e.target.result,
                                    false,
                                    ["decrypt"]
                                )

Here is the JSFiddle that you can run.

David
  • 3,971
  • 1
  • 26
  • 65
  • So just as ref... I am getting an error in both Edge and IE11, It looks like they were being swallowed. I am guessing this isn't your full implementation. Can you isolate a subset of what exactly isn't working? I get StringToArrayBuffer is not a function in Edge. In IE11 I get you are setting oncomplete on undefined. – Goblinlord Jan 24 '16 at 09:52
  • I updated the code, StringToArrayBuffer is not needed in IE11 only in others browsers, otherwise the code is complete for testing purporses. – David Jan 25 '16 at 09:09

1 Answers1

1

You could use a shim, like webcrypto-shim to fix the incomplete implementation of IE11

alebianco
  • 2,475
  • 18
  • 25
  • You mean to workaround it, yes, we did that, but this affects the performance of the solution among other consequences. – David Nov 24 '16 at 14:55
  • Sure, but I don't think you can aim for anything better than that on the IE11 front ... – alebianco Nov 24 '16 at 15:01