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

Updated README to add did:web example #381

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions crates/web5_cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,91 @@ web5 vc -h
}
```

### Create a `did:jwk`
Copy link
Contributor

Choose a reason for hiding this comment

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

@aazam-gh could you rebase onto main? (The diff viewer is showing changes from #379)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!


```shell
➜ web5 did create jwk
{
"uri": "did:jwk:eyJhbGciOiJFZDI1NTE5Iiwia3R5IjoiT0tQIiwiY3J2IjoiRWQyNTUxOSIsIngiOiJQakdPcEhhUTBsNjVNNzFMTkZFTW9QSklQdWkzWl9uOFRyM1hMM2FDVlhJIn0",
"document": {
"id": "did:jwk:eyJhbGciOiJFZDI1NTE5Iiwia3R5IjoiT0tQIiwiY3J2IjoiRWQyNTUxOSIsIngiOiJQakdPcEhhUTBsNjVNNzFMTkZFTW9QSklQdWkzWl9uOFRyM1hMM2FDVlhJIn0",
"@context": [
"https://www.w3.org/ns/did/v1"
],
"verificationMethod": [
{
"id": "did:jwk:eyJhbGciOiJFZDI1NTE5Iiwia3R5IjoiT0tQIiwiY3J2IjoiRWQyNTUxOSIsIngiOiJQakdPcEhhUTBsNjVNNzFMTkZFTW9QSklQdWkzWl9uOFRyM1hMM2FDVlhJIn0#0",
"type": "JsonWebKey",
"controller": "did:jwk:eyJhbGciOiJFZDI1NTE5Iiwia3R5IjoiT0tQIiwiY3J2IjoiRWQyNTUxOSIsIngiOiJQakdPcEhhUTBsNjVNNzFMTkZFTW9QSklQdWkzWl9uOFRyM1hMM2FDVlhJIn0",
"publicKeyJwk": {
"alg": "Ed25519",
"kty": "OKP",
"crv": "Ed25519",
"x": "PjGOpHaQ0l65M71LNFEMoPJIPui3Z_n8Tr3XL3aCVXI"
}
}
],
"authentication": [
"did:jwk:eyJhbGciOiJFZDI1NTE5Iiwia3R5IjoiT0tQIiwiY3J2IjoiRWQyNTUxOSIsIngiOiJQakdPcEhhUTBsNjVNNzFMTkZFTW9QSklQdWkzWl9uOFRyM1hMM2FDVlhJIn0#0"
],
"assertionMethod": [
"did:jwk:eyJhbGciOiJFZDI1NTE5Iiwia3R5IjoiT0tQIiwiY3J2IjoiRWQyNTUxOSIsIngiOiJQakdPcEhhUTBsNjVNNzFMTkZFTW9QSklQdWkzWl9uOFRyM1hMM2FDVlhJIn0#0"
],
"capabilityInvocation": [
"did:jwk:eyJhbGciOiJFZDI1NTE5Iiwia3R5IjoiT0tQIiwiY3J2IjoiRWQyNTUxOSIsIngiOiJQakdPcEhhUTBsNjVNNzFMTkZFTW9QSklQdWkzWl9uOFRyM1hMM2FDVlhJIn0#0"
],
"capabilityDelegation": [
"did:jwk:eyJhbGciOiJFZDI1NTE5Iiwia3R5IjoiT0tQIiwiY3J2IjoiRWQyNTUxOSIsIngiOiJQakdPcEhhUTBsNjVNNzFMTkZFTW9QSklQdWkzWl9uOFRyM1hMM2FDVlhJIn0#0"
]
},
"privateKeys": [
{
"alg": "Ed25519",
"kty": "OKP",
"crv": "Ed25519",
"d": "Z2TSOicWegPpYJghDn9UVKsVWAexgsgFBjr2Cl5hQ9Y",
"x": "PjGOpHaQ0l65M71LNFEMoPJIPui3Z_n8Tr3XL3aCVXI"
}
]
}
```

### Create a `did:web`
```shell
➜ web5 did create web https://blackgirlbytes.com
{
"uri": "did:web:blackgirlbytes.com",
"document": {
"id": "did:web:blackgirlbytes.com",
"@context": [
"https://www.w3.org/ns/did/v1"
],
"verificationMethod": [
{
"id": "did:web:blackgirlbytes.com#key-0",
"type": "JsonWebKey",
"controller": "did:web:blackgirlbytes.com",
"publicKeyJwk": {
"alg": "Ed25519",
"kty": "OKP",
"crv": "Ed25519",
"x": "aJjHLs_8HAg38xpOpRf4DUFkpDD-AwbvDKnNLV_CVqA"
}
}
]
},
"privateKeys": [
{
"alg": "Ed25519",
"kty": "OKP",
"crv": "Ed25519",
"d": "jjVbwCwGeOnHkQfJgnLJv8ZQfcQ9e4DunUVUjUwM0ng",
"x": "aJjHLs_8HAg38xpOpRf4DUFkpDD-AwbvDKnNLV_CVqA"
}
]
}
```

### Resolve a DID URI

```shell
Expand Down
Loading