Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

crypto.generateKeyPair* support in electron node #92

Open
Kaimaerah opened this issue Jan 31, 2019 · 4 comments
Open

crypto.generateKeyPair* support in electron node #92

Kaimaerah opened this issue Jan 31, 2019 · 4 comments

Comments

@Kaimaerah
Copy link

I recently updated my project to the latest electron beta (5.0.0-beta.1) which uses node "12" (electron-node-canary) as I was hoping to make use of crypto.generateKeyPairSync that was introduced in node v10.12. Unfortunately, when I call the function, I get the following error TypeError: crypto.generateKeyPairSync is not a function, despite the fact that it works on node latest and lts/dubnium

I've noticed that in the canary branch that feature had been reverted (see commit: c9f4c6f). What was the reason for removing this feature from the latest node build, and is there a chance of bringing it back in?

@MarshallOfSound
Copy link
Member

@Kaimaerah That particular API depends on APIs inside OpenSSL that do not exist inside BoringSSL. It would be possible to rewrite that API to use BoringSSL APIs but it is a not-trivial amount of work.

@ryzokuken
Copy link
Contributor

@MarshallOfSound @codebytere do you want me to look into this?

@aykay76
Copy link

aykay76 commented Feb 9, 2019

I would like to see this too please :) if I run Node on its own I can use generateKeyPair but not within electron. Is there a way to call the Node crypto module from Electron?

@codebytere
Copy link
Member

codebytere commented Feb 9, 2019

@ryzokuken that would be 💯

@aykay76 we bundle the entirety of Node.js in Electron, you can run the module it's just that we tweak it to build with BoringSSL instead of OpenSSL for compatibility with Chromium. So the path forward here is to modify our fork to allow it to accomplish what you seek.

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

5 participants