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: add encryption key support for ethr-did-documents #53

Merged
merged 1 commit into from
Feb 25, 2020

Conversation

mirceanis
Copy link
Member

What's here

This adds explicit support for listing X25519 encryption keys in ethr-did documents
This extends the supported attribute values to include X25519 key algorithm and enc key purpose.

(fixes #52)

Example Base64 encoded X25519 Encryption Key

A DIDAttributeChanged event for the identity 0xf3beac30c498d9e26865f34fcaa57dbb935b0d74 with the name
did/pub/X25519/enc/base64 and the value of
0x302a300506032b656e032100118557777ffb078774371a52b00fed75561dcf975e61c47553e664a617661052
generates a PublicKey entry like this:

{
  id: "did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74#delegate-1",
  type: "X25519KeyAgreementKey2019",
  owner: "did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74",
  publicKeyBase64: "MCowBQYDK2VuAyEAEYVXd3/7B4d0NxpSsA/tdVYdz5deYcR1U+ZkphdmEFI="
}

Note

Some key algorithms would not fit certain purposes (like encryption with secp256k1 or signing with X25519).
The DID resolver makes no assumptions here and does not enforce a match, nor does the registry contract where these attribute changes need to be sent.
It is up to the owners of the DIDs which attributes they list.

Copy link
Contributor

@simonas-notcat simonas-notcat left a comment

Choose a reason for hiding this comment

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

Looks good

@mirceanis mirceanis merged commit 2f5825c into develop Feb 25, 2020
@mirceanis mirceanis deleted the feature/encryption-key-support branch February 25, 2020 14:36
@awoie
Copy link
Member

awoie commented Feb 25, 2020

LGTM

@uport-automation-bot
Copy link
Collaborator

🎉 This PR is included in version 2.3.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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] add encryption key support to DID documents
4 participants