Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

unwrapKey does not work #3

Open
mobilekosmos opened this issue Jan 14, 2016 · 7 comments
Open

unwrapKey does not work #3

mobilekosmos opened this issue Jan 14, 2016 · 7 comments

Comments

@mobilekosmos
Copy link

This work on other browsers, but in IE11 with this shim Unsupported Exception is thrown. The importing of a key is working so I know I imported the shim correctly.

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

@vibornoff
Copy link
Owner

Could you please provide complete code snippet?

@mobilekosmos
Copy link
Author

Yes, I don't have access to the code today, would prepare an example you can run on monday, post it here and there also try to contact to microsoft support because or the microsoft documentation is wrong or the implementatino in IE is broken.
Also I debugged this lib and I could see that there is a wrap/unwrap test where CBC keys are generated, but when you change the algorithm to AES-KW the key generation does not work, despite the microsoft documentation says AES-KW is supported in key generation.

@mobilekosmos
Copy link
Author

Hello again, here is the code you should be able to run:
https://jsfiddle.net/qayxswedcvfr/ezo8bcqt/6/
Take note that the pbkdf2 code part takes ~5 secs.

NotSupportedError is thrown in webcrypt.shim.js in following function:
[ 'encrypt', 'decrypt', 'sign', 'verify' ]

What I also could see while debugging this project is that in case of IE the unwrap function is not called, instead decrypt and then importkey is called, why is this?

Here is also the post about the problem when not using the shim and using the msCrypto class instead, maybe it is interesting for you.

@Ruffio
Copy link
Contributor

Ruffio commented Sep 16, 2017

@vibornoff have you had a chance to look at the code/issue?

2 similar comments
@Ruffio
Copy link
Contributor

Ruffio commented Sep 25, 2017

@vibornoff have you had a chance to look at the code/issue?

@Ruffio
Copy link
Contributor

Ruffio commented Apr 18, 2018

@vibornoff have you had a chance to look at the code/issue?

@Ruffio
Copy link
Contributor

Ruffio commented Jul 9, 2018

@tererecool you sample doesn't look complete:

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants