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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

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.

1 participant