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 did:web #36

Merged
merged 3 commits into from
Jan 27, 2021
Merged

Add did:web #36

merged 3 commits into from
Jan 27, 2021

Conversation

clehner
Copy link
Contributor

@clehner clehner commented Jan 26, 2021

This adds support for did:web in DIDKit's CLI and HTTP server, using spruceid/ssi#74.

hyper-tls uses native TLS, which uses the openssl crate on Linux. That may be able to cross-compile for Android (e.g. sfackler/rust-openssl#626), but I was not able to get that working, so I have disabled did:web for the FFIs for now, only enabling it with a feature for the CLI and HTTP server. (A possible alternative may be change the did:web implementation to use hyper-rustls. rustls uses ring.)

Using this resolver for verification without passing a verificationMethod option may result in making two HTTPS requests instead of one. This is because internally the DID document is resolved twice, once to dereference the verificationMethod in the proof object, and once to resolve the DID document from the issuer or holder property - unless the verificationMethod verify option is given which overrides that behavior. This inefficiency could be fixed by adding memoization/caching (possibly changing the DIDResolve trait methods to use &mut self instead of &self).

@clehner clehner changed the title Add did:key Add did:web Jan 26, 2021
@wyc
Copy link
Contributor

wyc commented Jan 27, 2021

LGTM. I will open issues for the caching and also to add resolve as a subcommand to CLI.

@wyc wyc merged commit 9af226a into main Jan 27, 2021
@clehner clehner deleted the did-web branch January 27, 2021 20:16
@clehner clehner mentioned this pull request Feb 10, 2021
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.

2 participants