Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

X25519 and ECDH-ES+XC20PKW #1

Closed
oed opened this issue Sep 1, 2020 · 5 comments
Closed

X25519 and ECDH-ES+XC20PKW #1

oed opened this issue Sep 1, 2020 · 5 comments
Labels
question Further information is requested

Comments

@oed
Copy link

oed commented Sep 1, 2020

Hi, I wanted to use the ECDH-ES+XC20PKW with the x25519 curve but noticed that I get an error when trying to do that:

JWKKeySupport: the key does not support ECDH-ES+XC20PKW key management (encryption) algorithm

I assume this is because this library doesn't register the ECDH-ES+XC20PKW alg for x25519. I tried added the following line to my code and I could successfully create a JWE.

const registry = require('jose/lib/registry')
registry.JWK.OKP.deriveKey['ECDH-ES+XC20PKW'] = key => (key.use === 'enc' || key.use === undefined) && key.keyObject.asymmetricKeyType.startsWith('x')

Is it ok to do this, might I be missing something?

@oed oed added the question Further information is requested label Sep 1, 2020
@panva
Copy link
Owner

panva commented Sep 1, 2020

What’s your nodejs version?

@oed
Copy link
Author

oed commented Sep 1, 2020

$ node -v                                                                                                                                                                                                                                 15:58
v14.4.0

@panva panva closed this as completed in bfefd6e Sep 1, 2020
@panva
Copy link
Owner

panva commented Sep 1, 2020

It's just that x25519 and x448 ECDH wasn't added to Node.js until recently and I completely forgot to update this to reflect that.

I've released v1.1.0 that resolves that for both x25519 and x448

@panva
Copy link
Owner

panva commented Sep 1, 2020

Thanks for bringing this up, please consider supporting the library if it provides value to you or your company and this support was of help to you. Supporting the library means, amongst other things, that such support and the library will be available in the future.

@oed
Copy link
Author

oed commented Sep 1, 2020

Thanks for clarifying 🙏 That was my guess of what was going on, just wanted to make sure I was thinking about it in the right way!

@github-actions github-actions bot locked and limited conversation to collaborators Dec 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants