From 4500c593c10e4c171b18c1615feffef2cc91102d Mon Sep 17 00:00:00 2001 From: Aazam Thakur Date: Wed, 2 Oct 2024 23:47:34 +0530 Subject: [PATCH 1/2] updated web5 rust cli --- crates/web5_cli/README.md | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/crates/web5_cli/README.md b/crates/web5_cli/README.md index 98fe0559..e1b855c5 100644 --- a/crates/web5_cli/README.md +++ b/crates/web5_cli/README.md @@ -61,6 +61,54 @@ web5 vc -h ] } ``` +### Create a `did:jwk` + +```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" + } + ] +} +``` ### Resolve a DID URI From 30bad310e4a2638fc0fc6285b3aadffe14143423 Mon Sep 17 00:00:00 2001 From: Aazam Thakur Date: Thu, 3 Oct 2024 10:59:11 +0530 Subject: [PATCH 2/2] Added did:web for cli docs --- crates/web5_cli/README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/crates/web5_cli/README.md b/crates/web5_cli/README.md index e1b855c5..aa8d11b8 100644 --- a/crates/web5_cli/README.md +++ b/crates/web5_cli/README.md @@ -61,6 +61,7 @@ web5 vc -h ] } ``` + ### Create a `did:jwk` ```shell @@ -110,6 +111,42 @@ web5 vc -h } ``` +### 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