Custom sign and encrypt key management functions #566
FurlanLuka
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
I don't think the effort and increased footgun api surface is worth it given that (see above links) curve25519 is not far out from being part of the webcrypto api algorithm suite. In the meantime, use algorithms that are available in both your target runtimes. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I've been working on a project that heavily relies on elliptic curve cryptography on both backend (node) and front-end (browser). The curve of choice is Curve25519. The issue I'm having is that subtle crypto does not support Curve25519 which makes it impossible to use this library for JWS / JWE. My suggestion would be to add setSignFunction and setKeyManagementFunction to respective objects that will allow to pass custom sign / key management functions inside the library. This would allow me to use non-subtle crypto variants of Curve25519 which work on browser (https://www.npmjs.com/package/@noble/ed25519). An example of usage would look like this
const signature = await new jose.CompactSign(dataBytes) .setProtectedHeader({ alg: 'ES256' }) .setSignFunction(customEd25519) .sign(privateSigningKey);
Beta Was this translation helpful? Give feedback.
All reactions