Skip to content

Commit

Permalink
removing metadata key value from vc create.json, updating its readme.…
Browse files Browse the repository at this point in the history
… also adding portable_did parse.json
  • Loading branch information
jiyoonie9 committed Mar 27, 2024
1 parent 4787b82 commit 3688a5d
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 8 deletions.
13 changes: 7 additions & 6 deletions test-vectors/credentials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ Create test vectors are available in the [json file](./create.json), which conta

The value of `input` is an object with the following properties.

| Property | Description |
|--------------------|--------------------------------------------------------------------------------------------------------------------------|
| `signerDidUri` | the did uri that will be used to sign the verifiable credential created. |
| `signerPrivateJwk` | Json Web Key object associated with the `signerDidUri` which will be used for signing `credential`. |
| `credential` | A JSON object that represents a Verifiable Credential 1.1 according to the [spec](https://www.w3.org/TR/vc-data-model/). |
| Property | Description |
|---------------|--------------------------------------------------------------------------------------------------------------------------|
| `uri` | the Did uri that will be used to sign the verifiable credential created. |
| `privateKeys` | the private keys that will be used to sign the verifiable credential created. |
| `document` | the DidDocument whose verificationMethod will be used to sign the verifiable credential created. |
| `credential` | A JSON object that represents a Verifiable Credential 1.1 according to the [spec](https://www.w3.org/TR/vc-data-model/). |

### Output

The value of `output` is a Verifiable Credential 1.1 encoded as a JSON Web Token (
see [here](https://www.w3.org/TR/vc-data-model/#json-web-token) for more details). The signature is created using
the `signerPrivateJwk` private key.
the `privateKeys` private key.

### Reference implementations

Expand Down
2 changes: 0 additions & 2 deletions test-vectors/credentials/create.json
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,6 @@
}
]
},
"metadata": {},
"credential": {
"@context": [
"https://www.w3.org/2018/credentials/v1"
Expand Down Expand Up @@ -636,7 +635,6 @@
}
]
},
"metadata": {},
"credential": {
"@context": [
"https://www.w3.org/2018/credentials/v1"
Expand Down
167 changes: 167 additions & 0 deletions test-vectors/portable_did/parse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{
"description": "PortableDid resolution",
"vectors": [
{
"description": "Can be successfully parsed in as PortableDid",
"input": {
"uri": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"privateKeys": [
{
"kty": "OKP",
"crv": "Ed25519",
"use": "sig",
"alg": "EdDSA",
"kid": "c4IOrQdnehPwQZ6SyNLp9J942VCXrxgWw4zUxAHQXQE",
"d": "txnECNDxFc0gnD303qLJ6VfWJS8DkgpbxVbOkzzp_M4",
"x": "DzpSEyU0w1Myn3lA_piHAI6OrFAnZuEsTwMUPCTwMc8"
}
],
"document": {
"id": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"verificationMethod": [
{
"id": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY#z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"type": "JsonWebKey2020",
"controller": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"publicKeyJwk": {
"kty": "OKP",
"crv": "Ed25519",
"use": "sig",
"alg": "EdDSA",
"kid": "c4IOrQdnehPwQZ6SyNLp9J942VCXrxgWw4zUxAHQXQE",
"x": "DzpSEyU0w1Myn3lA_piHAI6OrFAnZuEsTwMUPCTwMc8"
}
}
]
},
"metadata": {
"foo": "bar"
}
},
"errors": false
},
{
"description": "Bad PortabieDid - missing uri",
"input": {
"privateKeys": [
{
"kty": "OKP",
"crv": "Ed25519",
"use": "sig",
"alg": "EdDSA",
"kid": "c4IOrQdnehPwQZ6SyNLp9J942VCXrxgWw4zUxAHQXQE",
"d": "txnECNDxFc0gnD303qLJ6VfWJS8DkgpbxVbOkzzp_M4",
"x": "DzpSEyU0w1Myn3lA_piHAI6OrFAnZuEsTwMUPCTwMc8"
}
],
"document": {
"id": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"verificationMethod": [
{
"id": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY#z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"type": "JsonWebKey2020",
"controller": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"publicKeyJwk": {
"kty": "OKP",
"crv": "Ed25519",
"use": "sig",
"alg": "EdDSA",
"kid": "c4IOrQdnehPwQZ6SyNLp9J942VCXrxgWw4zUxAHQXQE",
"x": "DzpSEyU0w1Myn3lA_piHAI6OrFAnZuEsTwMUPCTwMc8"
}
}
]
},
"metadata": {
"foo": "bar"
}
},
"errors": true
},
{
"description": "Bad PortableDid - missing privateKeys",
"input": {
"uri": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"document": {
"id": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"verificationMethod": [
{
"id": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY#z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"type": "JsonWebKey2020",
"controller": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"publicKeyJwk": {
"kty": "OKP",
"crv": "Ed25519",
"use": "sig",
"alg": "EdDSA",
"kid": "c4IOrQdnehPwQZ6SyNLp9J942VCXrxgWw4zUxAHQXQE",
"x": "DzpSEyU0w1Myn3lA_piHAI6OrFAnZuEsTwMUPCTwMc8"
}
}
]
},
"metadata": {
"foo": "bar"
}
},
"errors": true
},
{
"description": "Bad PortableDid - missing document",
"input": {
"uri": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"privateKeys": [
{
"kty": "OKP",
"crv": "Ed25519",
"use": "sig",
"alg": "EdDSA",
"kid": "c4IOrQdnehPwQZ6SyNLp9J942VCXrxgWw4zUxAHQXQE",
"d": "txnECNDxFc0gnD303qLJ6VfWJS8DkgpbxVbOkzzp_M4",
"x": "DzpSEyU0w1Myn3lA_piHAI6OrFAnZuEsTwMUPCTwMc8"
}
],
"metadata": {
"foo": "bar"
}
},
"errors": true
},
{
"description": "Bad PortableDid - missing metadata",
"input": {
"uri": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"privateKeys": [
{
"kty": "OKP",
"crv": "Ed25519",
"use": "sig",
"alg": "EdDSA",
"kid": "c4IOrQdnehPwQZ6SyNLp9J942VCXrxgWw4zUxAHQXQE",
"d": "txnECNDxFc0gnD303qLJ6VfWJS8DkgpbxVbOkzzp_M4",
"x": "DzpSEyU0w1Myn3lA_piHAI6OrFAnZuEsTwMUPCTwMc8"
}
],
"document": {
"id": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"verificationMethod": [
{
"id": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY#z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"type": "JsonWebKey2020",
"controller": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY",
"publicKeyJwk": {
"kty": "OKP",
"crv": "Ed25519",
"use": "sig",
"alg": "EdDSA",
"kid": "c4IOrQdnehPwQZ6SyNLp9J942VCXrxgWw4zUxAHQXQE",
"x": "DzpSEyU0w1Myn3lA_piHAI6OrFAnZuEsTwMUPCTwMc8"
}
}
]
}
},
"errors": true
}
]
}

0 comments on commit 3688a5d

Please sign in to comment.