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

feat: enable remote ECDH for JWE [de]encrypters #186

Merged
merged 3 commits into from
Jun 9, 2021

Conversation

mirceanis
Copy link
Member

@mirceanis mirceanis commented Jun 8, 2021

With this change, users will be able to use the JWE functionality even without direct access to sender or recipient secretKey material, as long as they can provide a wrapper method that resolves to the shared secret.

This also adds a createX25519ECDH(mySecretKey: Uint8Array): ECDH method that creates such a wrapper from an existing key.

The signature of the wrapper is this:

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

fixes #183

@mirceanis mirceanis requested a review from awoie June 8, 2021 14:03
Copy link
Member

@awoie awoie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

src/ECDH.ts Outdated Show resolved Hide resolved
src/ECDH.ts Outdated Show resolved Hide resolved
src/ECDH.ts Outdated Show resolved Hide resolved
src/ECDH.ts Outdated Show resolved Hide resolved
src/xc20pEncryption.ts Outdated Show resolved Hide resolved
@mirceanis mirceanis merged commit ff26440 into master Jun 9, 2021
@mirceanis mirceanis deleted the 183-add-shared-key-interface branch June 9, 2021 11:37
uport-automation-bot pushed a commit that referenced this pull request 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 PR is included 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add ability to use external sharedSecret function
3 participants