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

Unsupported algorithm error #26

Open
oluomoniyi opened this issue Jan 7, 2020 · 1 comment
Open

Unsupported algorithm error #26

oluomoniyi opened this issue Jan 7, 2020 · 1 comment

Comments

@oluomoniyi
Copy link

@oluomoniyi oluomoniyi commented Jan 7, 2020

Thanks a lot for this package.

I am having issues generating a keyPair in React Native, it worked perfectly in plane JS.

But once I try the following

`
const KeyExchangeKeySpec = {
name: 'RSA-OAEP',
modulusLength: 2048,
publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
hash: { name: 'SHA-256' }
};

generateKeyPair = async = > {
const keyPair = await subtle.generateKey(KeyExchangeKeySpec, false, ["encrypt", "decrypt"])

}
`

I get an unsupported algorithm error (I have tried other algorithms too, none seem to be supported).

Can you help please?

@kevlened

This comment has been minimized.

Copy link
Owner

@kevlened kevlened commented Jan 10, 2020

Glad you got it working outside of React Native!

Not all algorithms are supported in all environments. The compatibility table shows the algorithms that have been tested. Most of the tested algorithms deal with signing, not encryption, but many algorithms should work.

One caveat is generating RSA keys in React Native. The implementation in React Native is entirely JS, so generating RSA keys would take an extremely long time, so it's not implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.