Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CryptoKey definition not found #356

Closed
pke opened this issue Jun 25, 2024 · 5 comments · Fixed by #363
Closed

CryptoKey definition not found #356

pke opened this issue Jun 25, 2024 · 5 comments · Fixed by #363

Comments

@pke
Copy link

pke commented Jun 25, 2024

Using the newest 0.7.0-rc.10 the definition of CryptoKey does not seem to be properly exported?
I have to manually import it using
import { CryptoKey } from "react-native-quick-crypto/src/keys"

Is there a way to have it available using tsconfig/babel resolve?

@boorad
Copy link
Collaborator

boorad commented Jun 27, 2024

You are right. crypto.webcrypto didn't get the same treatment as crypto.subtle.

Do you want to throw a PR together? If not, I can get to it after I release 0.7.0 and #349.

@pke
Copy link
Author

pke commented Jun 27, 2024

Its just a missing type export I guess? Then a PR would be possible.

@boorad
Copy link
Collaborator

boorad commented Jun 27, 2024

Well, probably it's missing webcrypto.ts file in the top-level of JS code, and then put the exports in there, according to Node docs and implementation-coverage.md in this repo. Then one last add to index.ts inside of QuickCrypto object.

@esperor
Copy link

esperor commented Jul 3, 2024

I think i hava the same issue but the definition is needed in third-party code. I'm trying to sign a jwt using jose library (alg: RS256) and somewhere it performs isCryptoKey check. I can't find the function in node_modules so ig i can't manually add import. Is there a work around? The project doesn't use ts yet if that matters.

@boorad
Copy link
Collaborator

boorad commented Jul 3, 2024

I have this fix in an upcoming PR

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

Successfully merging a pull request may close this issue.

3 participants