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

draft: support alg ECDH-1PU+A256KW for jwe tokens #1

Merged
merged 6 commits into from
Jan 8, 2025

Conversation

ilya-korotya
Copy link
Collaborator

@ilya-korotya ilya-korotya commented Dec 13, 2024

Currently, we are unable to use popular JOSE libraries to build JWE tokens with the ECDH-1PU key agreement protocol. This is because the ECDH-1PU algorithm is still considered a proposal for future releases as a part of JWT. Unfortunately, there is no way to add custom key agreement protocols to the popular libraries, as explained below:

  1. go-jose This library does not provide any interface to implement custom key agreement protocols. Additionally, it does not support go ECDH keys used for Diffie-Hellman operations.

  2. jwx This library is slightly more flexible as it supports ECDH keys, but only on the X25519 curve, with no support for NIST curves. While it is possible to derive a CEK (Content Encryption Key) externally and pass it to the StaticEncrypt method for encrypting the KEK (Key Encryption Key), this process introduces another issue. The library adds an incorrect alg value to the header block because it does not recognize or support the ECDH-1PU protocol.

@vmidyllic vmidyllic requested a review from olomix December 18, 2024 12:59
a256cbc_hmac.go Outdated Show resolved Hide resolved
a256cbc_hmac.go Outdated Show resolved Hide resolved
a256cbc_hmac.go Outdated Show resolved Hide resolved
a256cbc_hmac.go Outdated Show resolved Hide resolved
@ilya-korotya ilya-korotya requested a review from vmidyllic January 8, 2025 12:28
@vmidyllic vmidyllic merged commit 24e2b0e into master Jan 8, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants