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

Expose CryptoKey class #18

Open
mjeanroy opened this issue Sep 28, 2022 · 2 comments
Open

Expose CryptoKey class #18

mjeanroy opened this issue Sep 28, 2022 · 2 comments

Comments

@mjeanroy
Copy link

Hi,

Problem

We are using the library to polyfill the web crypto API in a react-native environment, and it seems the CryptoKey interface is not exposed.

To give more details, we are using it with jose:

  • When used in a non node environment, jose expects the polyfill to emulate the presence of required globals.
  • Problem: since version 4.8.0, the jose library expect the CryptoKey interface to be exposed in the global namespace.

This is especially due to this check in the jose library, and it seems there is no plan to change it in the short term (see here).

Question

We fixed it on our side (by exposing a CryptoKey class in the global namespace).
Would you be open to reviewing a PR fixing this specific issue?

Thanks!

@ljoy913
Copy link
Contributor

ljoy913 commented Oct 24, 2022

Sorry for the delay, I missed this request.

This was something I considered adding. The library's original intent, as a polyfill for older browsers, just having a CryptoKey-like object was enough. I'll add CryptoKey.

I'll do my own PR because I have to consider older browsers and situations where there is a native CryptoKey already - and then add/update some tests.

If you want to post your own PR, that will help me ensure I'm addressing your specific requirements.

@mjeanroy
Copy link
Author

Hi @ljoy913,

For what it's worth, I just opened a PR here. I tried to take care of old browsers and cases where the native CryptoKey interface is defined.

  • Of course, feel free to close it and submit your own PR, at least you have something to start with 🙂
  • If you want to merge my PR, let me know, and I'll sign the CLA 😉

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

No branches or pull requests

2 participants