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

add ability to use external sharedSecret function #183

Closed
mirceanis opened this issue Jun 2, 2021 · 2 comments · Fixed by #186
Closed

add ability to use external sharedSecret function #183

mirceanis opened this issue Jun 2, 2021 · 2 comments · Fixed by #186
Labels
enhancement New feature or request feature pinned a known issue or feature that should not be closed by bots released

Comments

@mirceanis
Copy link
Member

Context

When creating auth JWE or decrypting JWE, the current assumption is that there is access to secretKey material so that sharedKey() can be called directly.
Examples here, here and here

Problem

This prevents external crypto implementations from being used along with this library.

Solution

In a similar fashion to the Signer pattern, I'm proposing that a similar interface be used to allow the use of external crypto.

Example:

type ECDH = (theirPublicKey: Uint8Array) => Promise<Uint8Array>

with a possible implementation along the lines of:

export function createX25519ECDH(mySecretKey: Uint8Array): ECDH {
  return async (theirPublicKey: Uint8Array): Promise<Uint8Array> => {
    return sharedKey(mySecretKey, theirPublicKey)
  }
}
@mirceanis mirceanis added enhancement New feature or request feature pinned a known issue or feature that should not be closed by bots labels Jun 2, 2021
@awoie
Copy link
Member

awoie commented Jun 3, 2021

That sounds good to me, also the naming makes sense.

mirceanis added a commit that referenced this issue Jun 8, 2021
mirceanis added a commit that referenced this issue Jun 9, 2021
* feat: enable remote ECDH for JWE [de]encrypters

fixes #183

* docs: add some documentation regarding the use of remote ECDH
uport-automation-bot pushed a commit that referenced this issue Jun 9, 2021
# [5.6.0](5.5.3...5.6.0) (2021-06-09)

### Features

* enable remote ECDH for JWE [de]encrypters ([#186](#186)) ([ff26440](ff26440)), closes [#183](#183)
@uport-automation-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 5.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature pinned a known issue or feature that should not be closed by bots released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants