jose-x25519-ecdh
This is a plugin for the jose
package that implements Key Agreement with Elliptic Curve
Diffie-Hellman Ephemeral Static for X25519
OKP keys.
Why a plugin?
- It's backed by libsodium instead of node crypto, unfortunately Node.js does not support this ECDH yet
- It'll get deprecated once Node.js fills the missing feature gap and the functionality will be implemented in the jose module instead
Usage
Installing
npm install jose // jose ^1.16.0 declared as a peer dependencynpm install jose-x25519-ecdh
const jose = const x25519 = async { await x25519 // wait for libsodium to be ready! const key = joseJWK console console }
Note: X25519 OKP keys are only supported in Node.js runtime >= 12.0.0 and are not supported in electron due to BoringSSL not having the curve implemented.
Have a question about using jose
? - ask.
Found a bug? - report it.
Missing a feature? - If it wasn't already discussed before, ask for it.
Found a vulnerability? - Reach out to us via email first, see security vulnerability disclosure.
Support
If you or your business use jose
, please consider becoming a sponsor so I can continue maintaining it and adding new features carefree.