draft: support alg ECDH-1PU+A256KW for jwe tokens #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.
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.