Replies: 1 comment 3 replies
-
|
As evident, I am not interested in exposing internals and making them part of the public API that needs to be maintained and stable. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem Statement
The current implementation of Jose does not export any functions to allow use of an externally managed private key on JWE encrypt/decrypt. It is always expected for the application server to have direct access to the private keys, which is not necessarily possible.
Example: Key managed by the AWS KMS, which runs KeyAgreement through a DH function and returns the SharedSecret.
Proposed Solution(s)
Expose the
decryptKeyManagementfunction - SimpleExporting the
decryptKeyManagementfunction would allow us to derive the CEK directly and decrypt the JWE ciphertext with it. It is not very "idiomatic), in the sense that it seems a bit against the spirit of Jose as a library.Add decryptFromZ function
This is probably the preferred solution: a new function to derive a jwe explicitly from a shared secret, provided by the developer, through their own means (locally running
crypto.diffieHellmanor using an external kms).The main benefit is that it would hide the "dirty" crypto steps behind a black box, exposing only a single
decryptFromZmethod.Similar topics
@thod Requested the export named in solution 1 here, but the discussion ended up being closed.
Thank you for the consideration. If any further info is needed, I'll be happy to provide it.
Beta Was this translation helpful? Give feedback.
All reactions