Closed kaurrJaspreet closed 3 years ago
This seems unrelated to isomorphic-webcrypto
. If you're using Expo, try upgrading to SDK 39, like this Expo user: https://github.com/expo/sentry-expo/issues/110#issuecomment-707047172
Closing for now. If upgrading to SDK 39 doesn’t fix the issue, I’ll reopen it.
I am still not able to use it. Can you just elaborate that how can I use the importkey, generatekey and encryption/decryption in react native? I am not able to use crypto.subtle.importKey Please open this issue and give me the solution please.
I got error when I import crypto.
import crypto from 'isomorphic-webcrypto';
I have not imported any other dependency.
Please lemme know if there is any other requirement ti use the below given functions :
Thank You in advance!!
There shouldn't be any additional requirement. What is the error message?
Whenever I import crypto from "import crypto from 'isomorphic-webcrypto';", then I got below error TypeError: global.document.addEventListener is not a function. (In 'global.document.addEventListener('click', domEventHandler('click', triggerHandlers.bind(null, 'dom')), false)', 'global.document.addEventListener' is undefined) I am using react native 0.63
You can also share the link of any example of React native if there is any. I want to resolve it asap.
There are several example here: https://github.com/kevlened/webcrypto-react-native-examples
Are you using create-react-native-app?
Hi @kevlened I am able to use crypto now. I am able to use importkey, generateKey functions but not wrapKey. Can you share any example where wrapKey is used?
I checked your code, wrapkey function is defined there.Check below link : https://github.com/kevlened/isomorphic-webcrypto/blob/master/src/react-native.js
I am getting below error :
Please help me in this.
My Code : const wrappedKey = await crypto.subtle.wrapKey( 'raw', sessionKey, wrappingKey, algorithm );
I am also interested in this. I am porting my Web code that use window.crypto.subtle
to react-native
.
All of the functions except crypto.subtle.wrapKey
seems to be present.
What is the analog to wrapKey
here?
wrapKey
should be the same, but it's only supported on certain algorithms. The react native implementation is Microsoft's pure js implementation with a few added tweaks. I haven't yet upgraded to their latest version, which may fix this issue.
I'll open a new issue for the upgrade. Feel free to open a new issue for your wrapKey
issue.
TypeError: global.document.addEventListener is not a function. (In 'global.document.addEventListener('click', domEventHandler('click', triggerHandlers.bind(null, 'dom')), false)', 'global.document.addEventListener' is undefined) I have to use the crypto.subtle into react native and I have installed only isomorphic-webcrypto only using command npm install isomorphic-webcrypto . Please share the link of the documentation if there is any.
Thanks in Advance!!!!
Please let me know if I need to install any other dependency also for react native