From 5295c3046f9829c8337bcdd5413c5898b30977e0 Mon Sep 17 00:00:00 2001 From: Neal Date: Mon, 1 Apr 2024 12:14:48 -0500 Subject: [PATCH 1/6] add-error-message --- test-vectors/credentials/verify.json | 48 +++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/test-vectors/credentials/verify.json b/test-vectors/credentials/verify.json index bf7c0ac..e634ad5 100644 --- a/test-vectors/credentials/verify.json +++ b/test-vectors/credentials/verify.json @@ -6,28 +6,66 @@ "input": { "vcJwt": "foo.bar" }, - "errors": true + "errors": true, + "errorMessage":{ + "web5-js":"Verification failed: Malformed JWT. expected 3 parts. got 2", + "web5-kt":"TODO" + } }, { "description": "bad missing alg", "input": { "vcJwt": "eyJraWQiOiJkaWQ6a2V5OnpRM3NoTkx0MWFNV1BiV1JHYThWb2VFYkpvZko3eEplNEZDUHBES3hxMU5aeWdwaXkjelEzc2hOTHQxYU1XUGJXUkdhOFZvZUViSm9mSjd4SmU0RkNQcERLeHExTlp5Z3BpeSIsInR5cCI6IkpXVCJ9.eyJraWQiOiJkaWQ6a2V5OnpRM3NoTkx0MWFNV1BiV1JHYThWb2VFYkpvZko3eEplNEZDUHBES3hxMU5aeWdwaXkjelEzc2hOTHQxYU1XUGJXUkdhOFZvZUViSm9mSjd4SmU0RkNQcERLeHExTlp5Z3BpeSIsInR5cCI6IkpXVCJ9.cbK62TrzOfbVDy06OWQUxkz--hKGGuG_Ch5on_SkiuU" }, - "errors": true + "errors": true, + "errorMessage":{ + "web5-js":"Verification failed: Expected JWT header to contain alg and kid", + "web5-kt":"TODO" + } }, { "description": "bad missing kid", "input": { "vcJwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksifQ.eyJraWQiOiJkaWQ6a2V5OnpRM3NoTkx0MWFNV1BiV1JHYThWb2VFYkpvZko3eEplNEZDUHBES3hxMU5aeWdwaXkjelEzc2hOTHQxYU1XUGJXUkdhOFZvZUViSm9mSjd4SmU0RkNQcERLeHExTlp5Z3BpeSIsInR5cCI6IkpXVCJ9.cbK62TrzOfbVDy06OWQUxkz--hKGGuG_Ch5on_SkiuU" }, - "errors": true + "errors": true, + "errorMessage":{ + "web5-js":"Verification failed: Expected JWT header to contain alg and kid", + "web5-kt":"TODO" + } }, { "description": "bad signature", "input": { - "vcJwt": "eyJraWQiOiJkaWQ6a2V5OnpRM3NoTkx0MWFNV1BiV1JHYThWb2VFYkpvZko3eEplNEZDUHBES3hxMU5aeWdwaXkjelEzc2hOTHQxYU1XUGJXUkdhOFZvZUViSm9mSjd4SmU0RkNQcERLeHExTlp5Z3BpeSIsInR5cCI6IkpXVCJ9.eyJraWQiOiJkaWQ6a2V5OnpRM3NoTkx0MWFNV1BiV1JHYThWb2VFYkpvZko3eEplNEZDUHBES3hxMU5aeWdwaXkjelEzc2hOTHQxYU1XUGJXUkdhOFZvZUViSm9mSjd4SmU0RkNQcERLeHExTlp5Z3BpeSIsInR5cCI6IkpXVCJ9.8AehkiboIK6SZy6LHC9ugy_OcT2VsjluzH4qzsgjfTtq9fEsGyY-cOW_xekNUa2RE2VzlP6FXk0gDn4xf6_r4g" + "vcJwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKamNuWWlPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aWVDSTZJa0pWTm5KcVlqa3liR015ZVhJMVMwSkJkazE1U2xsUE1qVmlSVWxGTWpCdVltbzFTR1JGZW5RNWRtOGlMQ0pyYVdRaU9pSlJkVmhhVjNCM1J5MDNNMlk1TmtZMlkxcE9TMWQyZG1ablpVTnpla05MWjFFNGNXRkZTR0ZHYUZrNElpd2lZV3huSWpvaVJXUkVVMEVpZlEjMCJ9.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiVEJEZXZ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NU5rWTJZMXBPUzFkMmRtWm5aVU56ZWtOTFoxRTRjV0ZGU0dGR2FGazRJaXdpWVd4bklqb2lSV1JFVTBFaWZRIiwic3ViIjoiZGlkOmp3azpleUpqY25ZaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpZUNJNklrSlZObkpxWWpreWJHTXllWEkxUzBKQmRrMTVTbGxQTWpWaVJVbEZNakJ1WW1vMVNHUkZlblE1ZG04aUxDSnJhV1FpT2lKUmRWaGFWM0IzUnkwM00yWTVOa1kyWTFwT1MxZDJkbVpuWlVOemVrTkxaMUU0Y1dGRlNHRkdhRms0SWl3aVlXeG5Jam9pUldSRVUwRWlmUSIsImlhdCI6MTcwOTY3ODMwOX0.badsig" }, - "errors": true + "errors": true, + "errorMessage":{ + "web5-js":"signature expected 64 bytes, got 4", + "web5-kt":"TODO" + } + }, + { + "description": "bad signature 2", + "input": { + "vcJwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKamNuWWlPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aWVDSTZJa0pWTm5KcVlqa3liR015ZVhJMVMwSkJkazE1U2xsUE1qVmlSVWxGTWpCdVltbzFTR1JGZW5RNWRtOGlMQ0pyYVdRaU9pSlJkVmhhVjNCM1J5MDNNMlk1TmtZMlkxcE9TMWQyZG1ablpVTnpla05MWjFFNGNXRkZTR0ZHYUZrNElpd2lZV3huSWpvaVJXUkVVMEVpZlEjMCJ9.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiVEJEZXZlbG9wZXJDcmVkZW50aWFsIl0sImlkIjoidXJuOnV1aWQ6YjA0NGFiMzItYzUxNS00ZTgwLWFkNTAtYTIxZWI0NTBlMTU3IiwiaXNzdWVyIjoiZGlkOmp3az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pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpZUNJNklrSlZObkpxWWpreWJHTXllWEkxUzBKQmRrMTVTbGxQTWpWaVJVbEZNakJ1WW1vMVNHUkZlblE1ZG04aUxDSnJhV1FpT2lKUmRWaGFWM0IzUnkwM00yWTVOa1kyWTFwT1MxZDJkbVpuWlVOemVrTkxaMUU0Y1dGRlNHRkdhRms0SWl3aVlXeG5Jam9pUldSRVUwRWlmUSIsImlhdCI6MTcwOTY3ODMwOX0.wn3yaMfDws75mgRX8L-ET06gaLBxUKFr3wD-FqxCTiNNyVlfPXigvcucSGLoS2i5VGYj-j_4JSn87ocEm_olzA" + }, + "errors": true, + "errorMessage":{ + "web5-js":"Signature verification failed: Integrity mismatch", + "web5-kt":"TODO" + } + }, + { + "description": "invalid issuer", + "input": { + "vcJwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDprZXk6ejZNa201UnlmTkZqNUFWNGlXQ3BKYmc1VkFId21ZRXROd25XdlVpeWZKS1VHd0djI3o2TWttNVJ5Zk5GajVBVjRpV0NwSmJnNVZBSHdtWUV0TnduV3ZVaXlmSktVR3dHYyJ9.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiU3RyZWV0Q3JlZCJdLCJpZCI6InVybjp1dWlkOmRmNTYwZDk2LTFkOTgtNDY2Zi05MGQ0LTNlODFiNmFkN2QyNSIsImlzc3VlciI6ImRpZDpmYWtlaXNzdWVyOjEyMyIsImlzc3VhbmNlRGF0ZSI6IjIwMjQtMDQtMDFUMTY6NTY6MzRaIiwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6c3ViamVjdDoxMjMiLCJsb2NhbFJlc3BlY3QiOiJoaWdoIiwibGVnaXQiOnRydWV9fSwibmJmIjoxNzExOTkwNTk0LCJqdGkiOiJ1cm46dXVpZDpkZjU2MGQ5Ni0xZDk4LTQ2NmYtOTBkNC0zZTgxYjZhZDdkMjUiLCJpc3MiOiJkaWQ6a2V5Ono2TWttNVJ5Zk5GajVBVjRpV0NwSmJnNVZBSHdtWUV0TnduV3ZVaXlmSktVR3dHYyIsInN1YiI6ImRpZDpzdWJqZWN0OjEyMyIsImlhdCI6MTcxMTk5MDU5NH0.k2AlBo9r6_OEsDZbu0-jGbXCYLK9npfbRs6aVj4R_W5YjvPaISY0ZCu81KTcARFhUvneUZrdVFbl6acDECexDA" + }, + "errors": true, + "errorMessage":{ + "web5-js":"Verification failed: iss claim does not match expected issuer", + "web5-kt":"TODO" + } }, { "description": "verify a jwt verifiable credential signed with a did:key", From 8d6bd666e19d56eef4c17b1c8c4bf206052cf6fb Mon Sep 17 00:00:00 2001 From: Neal Date: Mon, 1 Apr 2024 15:45:24 -0500 Subject: [PATCH 2/6] updates --- test-vectors/credentials/create.json | 8 ++++---- test-vectors/credentials/verify.json | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test-vectors/credentials/create.json b/test-vectors/credentials/create.json index 79362ce..b2941b4 100644 --- a/test-vectors/credentials/create.json +++ b/test-vectors/credentials/create.json @@ -594,7 +594,7 @@ "StreetCred" ], "id": "urn:uuid:6c8bbcf4-87af-449a-9bfb-30bf29976227", - "issuer": "did:key:zQ3shNLt1aMWPbWRGa8VoeEbJofJ7xJe4FCPpDKxq1NZygpiy", + "issuer": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY", "issuanceDate": "2023-11-30T00:03:13Z", "credentialSubject": { "id": "did:key:zQ3shkpavjKRewoBk6arPJnhA87ZzhLDEWgVvZKNHK6QqVJDB", @@ -603,7 +603,7 @@ } } }, - "output": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZDI1NTE5Iiwia2lkIjoiZGlkOmtleTp6Nk1rZlVoanNaVUpremlvR0RVTHBjcX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ppb0dEVUxwY3F4WEZTTnM2TWNNSm8zMXR4WW5FYXFuOWRZIn0.eyJpc3MiOiJkaWQ6a2V5Ono2TWtmVWhqc1pVSmt6aW9HRFVMcGNxeFhGU05zNk1jTUpvMzF0eFluRWFxbjlkWSIsInN1YiI6ImRpZDprZXk6elEzc2hrcGF2aktSZXdvQms2YXJQSm5oQTg3WnpoTERFV2dWdlpLTkhLNlFxVkpEQiIsImlhdCI6MTcwMTMwMjU5MzAwMCwidmMiOnsiaXNzdWFuY2VEYXRlIjoiMjAyMy0xMS0zMFQwMDowMzoxM1oiLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDprZXk6elEzc2hrcGF2aktSZXdvQms2YXJQSm5oQTg3WnpoTERFV2dWdlpLTkhLNlFxVkpEQiIsImxvY2FsUmVzcGVjdCI6ImhpZ2giLCJsZWdpdCI6dHJ1ZX0sImlkIjoidXJuOnV1aWQ6NmM4YmJjZjQtODdhZi00NDlhLTliZmItMzBiZjI5OTc2MjI3IiwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIlN0cmVldENyZWQiXSwiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiXSwiaXNzdWVyIjoiZGlkOmtleTp6Nk1rZlVoanNaVUpremlvR0RVTHBjcXhYRlNOczZNY01KbzMxdHhZbkVhcW45ZFkifX0.rbXxa-vxIWG_uq7kACR-7OjJEFbyh9hDaok-QuJhyp_2KPFUXLqNe0LoIuJZA9eUcIVRUDdk_N7-zVvTdXdTAg" }, { "description": "creates a verifiable credential as a jwt with a did:jwk", @@ -650,7 +650,7 @@ "StreetCred" ], "id": "urn:uuid:6c8bbcf4-87af-449a-9bfb-30bf29976227", - "issuer": "did:jwk:eyJrdHkiOiJFQyIsInVzZSI6InNpZyIsImNydiI6InNlY3AyNTZrMSIsImtpZCI6Ik5CX3FsVUlyMDYtQWlrVlZNRnJlcTBsYy1vbVF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2dWdlpLTkhLNlFxVkpEQiIsImxvY2FsUmVzcGVjdCI6ImhpZ2giLCJsZWdpdCI6dHJ1ZX0sImlkIjoidXJuOnV1aWQ6NmM4YmJjZjQtODdhZi00NDlhLTliZmItMzBiZjI5OTc2MjI3IiwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIlN0cmVldENyZWQiXSwiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpyZEhraU9pSlBTMUFpTENKamNuWWlPaUpGWkRJMU5URTVJaXdpZFhObElqb2ljMmxuSWl3aVlXeG5Jam9pUldSRVUwRWlMQ0pyYVdRaU9pSktVVll6UTBWYVEzQldXbkJDV21RME4wRXpMV2xsVFVNMVQxQnZPSEo1UWxRNWNIZExYM05ETFV0Qklpd2llQ0k2SWxVeldYTkROakZKWm5CeFJqbHFVSE5SWDAxVU1EQkZUVFJCUVhWSFltczBTRE4xVlZaUmN6QkZlbEVpZlEifX0.A_zCrL8pKwMCnJWMKkeZnA5VT6-WC_5VTE7xy9ZF2IH-ZY1ypZvUkw2_oMzZkOCS_bMmNM2_ilwSZak1S2EfCA" } ] } \ No newline at end of file diff --git a/test-vectors/credentials/verify.json b/test-vectors/credentials/verify.json index e634ad5..9fd5f33 100644 --- a/test-vectors/credentials/verify.json +++ b/test-vectors/credentials/verify.json @@ -9,7 +9,7 @@ "errors": true, "errorMessage":{ "web5-js":"Verification failed: Malformed JWT. expected 3 parts. got 2", - "web5-kt":"TODO" + "web5-kt":"Malformed JWT. Expected 3 parts, got 2" } }, { @@ -20,7 +20,7 @@ "errors": true, "errorMessage":{ "web5-js":"Verification failed: Expected JWT header to contain alg and kid", - "web5-kt":"TODO" + "web5-kt":"jwt payload missing vc property" } }, { @@ -31,7 +31,7 @@ "errors": true, "errorMessage":{ "web5-js":"Verification failed: Expected JWT header to contain alg and kid", - "web5-kt":"TODO" + "web5-kt":"Malformed JWS. Expected header to contain kid." } }, { @@ -42,7 +42,7 @@ "errors": true, "errorMessage":{ "web5-js":"signature expected 64 bytes, got 4", - "web5-kt":"TODO" + "web5-kt":"The length of the signature is not 64." } }, { @@ -53,7 +53,7 @@ "errors": true, "errorMessage":{ "web5-js":"Signature verification failed: Integrity mismatch", - "web5-kt":"TODO" + "web5-kt":"Signature check failed." } }, { @@ -64,7 +64,7 @@ "errors": true, "errorMessage":{ "web5-js":"Verification failed: iss claim does not match expected issuer", - "web5-kt":"TODO" + "web5-kt":"Verification failed: iss claim does not match expected issuer" } }, { From fd2c68cc606b7c8f68e80e7fa8c22d5a13a09bcf Mon Sep 17 00:00:00 2001 From: Jiyoon Koo Date: Mon, 1 Apr 2024 17:54:08 -0400 Subject: [PATCH 3/6] adding invalid signature test vector --- test-vectors/credentials/verify.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test-vectors/credentials/verify.json b/test-vectors/credentials/verify.json index 9fd5f33..4e122f8 100644 --- a/test-vectors/credentials/verify.json +++ b/test-vectors/credentials/verify.json @@ -67,6 +67,13 @@ "web5-kt":"Verification failed: iss claim does not match expected issuer" } }, + { + "description": "signature from a different jwt", + "input": { + "vcJwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKamNuWWlPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aWVDSTZJa0pWTm5KcVlqa3liR015ZVhJMVMwSkJkazE1U2xsUE1qVmlSVWxGTWpCdVltbzFTR1JGZW5RNWRtOGlMQ0pyYVdRaU9pSlJkVmhhVjNCM1J5MDNNMlk1TmtZMlkxcE9TMWQyZG1ablpVTnpla05MWjFFNGNXRkZTR0ZHYUZrNElpd2lZV3huSWpvaVJXUkVVMEVpZlEjMCJ9.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJ0eXBlI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VkbThpTENKcmFXUWlPaUpSZFZoYVYzQjNSeTAzTTJZNU5rWTJZMXBPUzFkMmRtWm5aVU56ZWtOTFoxRTRjV0ZGU0dGR2FGazRJaXdpWVd4bklqb2lSV1JFVTBFaWZRIiwic3ViIjoiZGlkOmp3azpleUpqY25ZaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpZUNJNklrSlZObkpxWWpreWJHTXllWEkxUzBKQmRrMTVTbGxQTWpWaVJVbEZNakJ1WW1vMVNHUkZlblE1ZG04aUxDSnJhV1FpT2lKUmRWaGFWM0IzUnkwM00yWTVOa1kyWTFwT1MxZDJkbVpuWlVOemVrTkxaMUU0Y1dGRlNHRkdhRms0SWl3aVlXeG5Jam9pUldSRVUwRWlmUSIsImlhdCI6MTcwOTY3ODMwOX0.wn3yaMfDws75mgRX8L-ET06gaLBxUKFr3wD-FqxCTiNNyVlfPXigvcucSGLoS2i5VGYj-j_4JSn87ocEm_olzA" + }, + "errors": true + }, { "description": "verify a jwt verifiable credential signed with a did:key", "input": { From a5f16833ee538c605ca9526cd06bf5ad478bf343 Mon Sep 17 00:00:00 2001 From: Neal Date: Mon, 1 Apr 2024 17:00:44 -0500 Subject: [PATCH 4/6] remove error messages --- test-vectors/credentials/verify.json | 36 +++++----------------------- 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/test-vectors/credentials/verify.json b/test-vectors/credentials/verify.json index 4e122f8..27c0009 100644 --- a/test-vectors/credentials/verify.json +++ b/test-vectors/credentials/verify.json @@ -6,66 +6,42 @@ "input": { "vcJwt": "foo.bar" }, - "errors": true, - "errorMessage":{ - "web5-js":"Verification failed: Malformed JWT. expected 3 parts. got 2", - "web5-kt":"Malformed JWT. Expected 3 parts, got 2" - } + "errors": true }, { "description": "bad missing alg", "input": { "vcJwt": "eyJraWQiOiJkaWQ6a2V5OnpRM3NoTkx0MWFNV1BiV1JHYThWb2VFYkpvZko3eEplNEZDUHBES3hxMU5aeWdwaXkjelEzc2hOTHQxYU1XUGJXUkdhOFZvZUViSm9mSjd4SmU0RkNQcERLeHExTlp5Z3BpeSIsInR5cCI6IkpXVCJ9.eyJraWQiOiJkaWQ6a2V5OnpRM3NoTkx0MWFNV1BiV1JHYThWb2VFYkpvZko3eEplNEZDUHBES3hxMU5aeWdwaXkjelEzc2hOTHQxYU1XUGJXUkdhOFZvZUViSm9mSjd4SmU0RkNQcERLeHExTlp5Z3BpeSIsInR5cCI6IkpXVCJ9.cbK62TrzOfbVDy06OWQUxkz--hKGGuG_Ch5on_SkiuU" }, - "errors": true, - "errorMessage":{ - "web5-js":"Verification failed: Expected JWT header to contain alg and kid", - "web5-kt":"jwt payload missing vc property" - } + "errors": true }, { "description": "bad missing kid", "input": { "vcJwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksifQ.eyJraWQiOiJkaWQ6a2V5OnpRM3NoTkx0MWFNV1BiV1JHYThWb2VFYkpvZko3eEplNEZDUHBES3hxMU5aeWdwaXkjelEzc2hOTHQxYU1XUGJXUkdhOFZvZUViSm9mSjd4SmU0RkNQcERLeHExTlp5Z3BpeSIsInR5cCI6IkpXVCJ9.cbK62TrzOfbVDy06OWQUxkz--hKGGuG_Ch5on_SkiuU" }, - "errors": true, - "errorMessage":{ - "web5-js":"Verification failed: Expected JWT header to contain alg and kid", - "web5-kt":"Malformed JWS. Expected header to contain kid." - } + "errors": true }, { "description": "bad signature", "input": { "vcJwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKamNuWWlPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aWVDSTZJa0pWTm5KcVlqa3liR015ZVhJMVMwSkJkazE1U2xsUE1qVmlSVWxGTWpCdVltbzFTR1JGZW5RNWRtOGlMQ0pyYVdRaU9pSlJkVmhhVjNCM1J5MDNNMlk1TmtZMlkxcE9TMWQyZG1ablpVTnpla05MWjFFNGNXRkZTR0ZHYUZrNElpd2lZV3huSWpv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SWl3aWEzUjVJam9pVDB0UUlpd2llQ0k2SWtKVk5uSnFZamt5YkdNeWVYSTFTMEpCZGsxNVNsbFBNalZpUlVsRk1qQnVZbW8xU0dSRmVuUTVkbThpTENKcmFXUWlPaUpSZFZoYVYzQjNSeTAzTTJZNU5rWTJZMXBPUzFkMmRtWm5aVU56ZWtOTFoxRTRjV0ZGU0dGR2FGazRJaXdpWVd4bklqb2lSV1JFVTBFaWZRIiwic3ViIjoiZGlkOmp3azpleUpqY25ZaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpZUNJNklrSlZObkpxWWpreWJHTXllWEkxUzBKQmRrMTVTbGxQTWpWaVJVbEZNakJ1WW1vMVNHUkZlblE1ZG04aUxDSnJhV1FpT2lKUmRWaGFWM0IzUnkwM00yWTVOa1kyWTFwT1MxZDJkbVpuWlVOemVrTkxaMUU0Y1dGRlNHRkdhRms0SWl3aVlXeG5Jam9pUldSRVUwRWlmUSIsImlhdCI6MTcwOTY3ODMwOX0.badsig" }, - "errors": true, - "errorMessage":{ - "web5-js":"signature expected 64 bytes, got 4", - "web5-kt":"The length of the signature is not 64." - } + "errors": true }, { "description": "bad signature 2", "input": { "vcJwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKamNuWWlPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aWVDSTZJa0pWTm5KcVlqa3liR015ZVhJMVMwSkJkazE1U2xsUE1qVmlSVWxGTWpCdVltbzFTR1JGZW5RNWRtOGlMQ0pyYVdRaU9pSlJkVmhhVjNCM1J5MDNNMlk1TmtZMlkxcE9TMWQyZG1ablpVTnpla05MWjFFNGNXRkZTR0ZHYUZrNElpd2lZV3huSWpvaVJXUkVVMEVpZlEjMCJ9.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJ0eXBlIjpbIlZlcml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FXUWlPaUpSZFZoYVYzQjNSeTAzTTJZNU5rWTJZMXBPUzFkMmRtWm5aVU56ZWtOTFoxRTRjV0ZGU0dGR2FGazRJaXdpWVd4bklqb2lSV1JFVTBFaWZRIiwic3ViIjoiZGlkOmp3azpleUpqY25ZaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpZUNJNklrSlZObkpxWWpreWJHTXllWEkxUzBKQmRrMTVTbGxQTWpWaVJVbEZNakJ1WW1vMVNHUkZlblE1ZG04aUxDSnJhV1FpT2lKUmRWaGFWM0IzUnkwM00yWTVOa1kyWTFwT1MxZDJkbVpuWlVOemVrTkxaMUU0Y1dGRlNHRkdhRms0SWl3aVlXeG5Jam9pUldSRVUwRWlmUSIsImlhdCI6MTcwOTY3ODMwOX0.wn3yaMfDws75mgRX8L-ET06gaLBxUKFr3wD-FqxCTiNNyVlfPXigvcucSGLoS2i5VGYj-j_4JSn87ocEm_olzA" }, - "errors": true, - "errorMessage":{ - "web5-js":"Signature verification failed: Integrity mismatch", - "web5-kt":"Signature check failed." - } + "errors": true }, { "description": "invalid issuer", "input": { "vcJwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDprZXk6ejZNa201UnlmTkZqNUFWNGlXQ3BKYmc1VkFId21ZRXROd25XdlVpeWZKS1VHd0djI3o2TWttNVJ5Zk5GajVBVjRpV0NwSmJnNVZBSHdtWUV0TnduV3ZVaXlmSktVR3dHYyJ9.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiU3RyZWV0Q3JlZCJdLCJpZCI6InVybjp1dWlkOmRmNTYwZDk2LTFkOTgtNDY2Zi05MGQ0LTNlODFiNmFkN2QyNSIsImlzc3VlciI6ImRpZDpmYWtlaXNzdWVyOjEyMyIsImlzc3VhbmNlRGF0ZSI6IjIwMjQtMDQtMDFUMTY6NTY6MzRaIiwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6c3ViamVjdDoxMjMiLCJsb2NhbFJlc3BlY3QiOiJoaWdoIiwibGVnaXQiOnRydWV9fSwibmJmIjoxNzExOTkwNTk0LCJqdGkiOiJ1cm46dXVpZDpkZjU2MGQ5Ni0xZDk4LTQ2NmYtOTBkNC0zZTgxYjZhZDdkMjUiLCJpc3MiOiJkaWQ6a2V5Ono2TWttNVJ5Zk5GajVBVjRpV0NwSmJnNVZBSHdtWUV0TnduV3ZVaXlmSktVR3dHYyIsInN1YiI6ImRpZDpzdWJqZWN0OjEyMyIsImlhdCI6MTcxMTk5MDU5NH0.k2AlBo9r6_OEsDZbu0-jGbXCYLK9npfbRs6aVj4R_W5YjvPaISY0ZCu81KTcARFhUvneUZrdVFbl6acDECexDA" }, - "errors": true, - "errorMessage":{ - "web5-js":"Verification failed: iss claim does not match expected issuer", - "web5-kt":"Verification failed: iss claim does not match expected issuer" - } + "errors": true }, { "description": "signature from a different jwt", From 671fc29071dc68a8584b06c8edd9d10cb68aa4cd Mon Sep 17 00:00:00 2001 From: Neal Date: Mon, 1 Apr 2024 17:02:46 -0500 Subject: [PATCH 5/6] update --- test-vectors/credentials/verify.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-vectors/credentials/verify.json b/test-vectors/credentials/verify.json index 27c0009..8093947 100644 --- a/test-vectors/credentials/verify.json +++ b/test-vectors/credentials/verify.json @@ -23,14 +23,14 @@ "errors": true }, { - "description": "bad signature", + "description": "invalid signature", "input": { "vcJwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKamNuWWlPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aWVDSTZJa0pWTm5KcVlqa3liR015ZVhJMVMwSkJkazE1U2xsUE1qVmlSVWxGTWpCdVltbzFTR1JGZW5RNWRtOGlM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XVpZDpiMDQ0YWIzMi1jNTE1LTRlODAtYWQ1MC1hMjFlYjQ1MGUxNTciLCJpc3MiOiJkaWQ6andrOmV5SmpjbllpT2lKRlpESTFOVEU1SWl3aWEzUjVJam9pVDB0UUlpd2llQ0k2SWtKVk5uSnFZamt5YkdNeWVYSTFTMEpCZGsxNVNsbFBNalZpUlVsRk1qQnVZbW8xU0dSRmVuUTVkbThpTENKcmFXUWlPaUpSZFZoYVYzQjNSeTAzTTJZNU5rWTJZMXBPUzFkMmRtWm5aVU56ZWtOTFoxRTRjV0ZGU0dGR2FGazRJaXdpWVd4bklqb2lSV1JFVTBFaWZRIiwic3ViIjoiZGlkOmp3azpleUpqY25ZaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpZUNJNklrSlZObkpxWWpreWJHTXllWEkxUzBKQmRrMTVTbGxQTWpWaVJVbEZNakJ1WW1vMVNHUkZlblE1ZG04aUxDSnJhV1FpT2lKUmRWaGFWM0IzUnkwM00yWTVOa1kyWTFwT1MxZDJkbVpuWlVOemVrTkxaMUU0Y1dGRlNHRkdhRms0SWl3aVlXeG5Jam9pUldSRVUwRWlmUSIsImlhdCI6MTcwOTY3ODMwOX0.badsig" }, "errors": true }, { - "description": "bad signature 2", + "description": "invalid signature from another jwt", "input": { "vcJwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKamNuWWlPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aWVDSTZJa0pWTm5KcVlqa3liR015ZVhJMVMwSkJkazE1U2xsUE1qVmlSVWxGTWpCdVltbzFTR1JGZW5RNWRtOGlMQ0pyYVdRaU9pSlJkVmhhVjNCM1J5MDNNMlk1TmtZMlkxcE9TMWQyZG1ablpVTnpla05MWjFFNGNXRkZTR0ZHYUZrNElpd2lZV3huSWpvaVJXUkVVMEVpZlEjMCJ9.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3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MEpCZGsxNVNsbFBNalZpUlVsRk1qQnVZbW8xU0dSRmVuUTVkbThpTENKcmFXUWlPaUpSZFZoYVYzQjNSeTAzTTJZNU5rWTJZMXBPUzFkMmRtWm5aVU56ZWtOTFoxRTRjV0ZGU0dGR2FGazRJaXdpWVd4bklqb2lSV1JFVTBFaWZRIiwic3ViIjoiZGlkOmp3azpleUpqY25ZaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpZUNJNklrSlZObkpxWWpreWJHTXllWEkxUzBKQmRrMTVTbGxQTWpWaVJVbEZNakJ1WW1vMVNHUkZlblE1ZG04aUxDSnJhV1FpT2lKUmRWaGFWM0IzUnkwM00yWTVOa1kyWTFwT1MxZDJkbVpuWlVOemVrTkxaMUU0Y1dGRlNHRkdhRms0SWl3aVlXeG5Jam9pUldSRVUwRWlmUSIsImlhdCI6MTcwOTY3ODMwOX0.wn3yaMfDws75mgRX8L-ET06gaLBxUKFr3wD-FqxCTiNNyVlfPXigvcucSGLoS2i5VGYj-j_4JSn87ocEm_olzA" }, From 259415699e8e5d3cac3f50950f4738b4b8e2b4f7 Mon Sep 17 00:00:00 2001 From: Neal Date: Wed, 3 Apr 2024 11:47:36 -0500 Subject: [PATCH 6/6] update create --- test-vectors/credentials/create.json | 723 +++------------------------ 1 file changed, 65 insertions(+), 658 deletions(-) diff --git a/test-vectors/credentials/create.json b/test-vectors/credentials/create.json index b2941b4..c0283a9 100644 --- a/test-vectors/credentials/create.json +++ b/test-vectors/credentials/create.json @@ -1,665 +1,72 @@ { - "description": "verifiable credential 1.1 signing", - "vectors": [ - { - "description": "bad no credential subject", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/58473", - "type": [ - "VerifiableCredential", - "AlumniCredential" - ], - "issuer": "https://example.edu/issuers/14", - "issuanceDate": "2010-01-01T19:23:24Z", - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad missing context", - "input": { - "credential": { - "@context": [ - ], - "id": "http://example.edu/credentials/58473", - "type": [ - "VerifiableCredential", - "AlumniCredential" - ], - "issuer": "https://example.edu/issuers/14", - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "alumniOf": "Example University" - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad first context item", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/examples/v1", - "https://www.w3.org/2018/credentials/v1" - ], - "id": "http://example.edu/credentials/58473", - "type": [ - "VerifiableCredential", - "AlumniCredential" - ], - "issuer": "https://example.edu/issuers/14", - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "alumniOf": "Example University" - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad multiple id values", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": [ - "http://example.edu/credentials/3731", - "http://example.edu/credentials/3732" - ], - "type": [ - "VerifiableCredential", - "UniversityDegreeCredential" - ], - "issuer": "https://example.edu/issuers/14", - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad id must be a uri", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "example", - "type": [ - "VerifiableCredential", - "UniversityDegreeCredential" - ], - "issuer": "https://example.edu/issuers/14", - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad type must have at least one value", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/3732", - "type": [], - "issuer": "https://example.edu/issuers/14", - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad type must have VerifiableCredential as first value", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/3732", - "type": [ - "UniversityDegreeCredential" - ], - "issuer": "https://example.edu/issuers/14", - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad issuance date", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/3732", - "type": [ - "VerifiableCredential", - "UniversityDegreeCredential" - ], - "issuer": "https://example.edu/issuers/14", - "issuanceDate": "01/01/2010", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad multiple issuers", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/3732", - "type": [ - "VerifiableCredential", - "UniversityDegreeCredential" - ], - "issuer": [ - "https://example.edu/issuers/14", - "https://example.edu/issuers/20" - ], - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad issuer must be uri", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/3732", - "type": [ - "VerifiableCredential", - "UniversityDegreeCredential" - ], - "issuer": "example", - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad issuer as object without id", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/3732", - "type": [ - "VerifiableCredential", - "UniversityDegreeCredential" - ], - "issuer": {}, - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad issuer as numeric id", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/3732", - "type": [ - "VerifiableCredential", - "UniversityDegreeCredential" - ], - "issuer": 12345, - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad missing issuance date", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/3732", - "type": [ - "VerifiableCredential", - "UniversityDegreeCredential" - ], - "issuer": "https://example.edu/issuers/14", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad missing issuer", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/3732", - "type": [ - "VerifiableCredential", - "UniversityDegreeCredential" - ], - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad expiration date with multiple values", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/3732", - "type": [ - "VerifiableCredential", - "UniversityDegreeCredential" - ], - "issuer": "https://example.edu/issuers/14", - "issuanceDate": "2010-01-01T19:23:24Z", - "expirationDate": [ - "2020-01-01T19:23:24Z", - "2021-01-01T19:23:24Z" - ], - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad expiration date value", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/3732", - "type": [ - "VerifiableCredential", - "UniversityDegreeCredential" - ], - "issuer": "https://example.edu/issuers/14", - "issuanceDate": "2010-01-01T19:23:24Z", - "expirationDate": "01/01/2020", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad credential status with missing id", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/3732", - "type": [ - "VerifiableCredential", - "UniversityDegreeCredential" - ], - "issuer": "https://example.edu/issuers/14", - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "credentialStatus": { - "type": "CredentialStatusList2017" - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad credential status with missing type", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/3732", - "type": [ - "VerifiableCredential", - "UniversityDegreeCredential" - ], - "issuer": "https://example.edu/issuers/14", - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "credentialStatus": { - "id": "https://example.edu/status/24" - }, - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "bad credential status as a string", - "input": { - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1" - ], - "id": "http://example.edu/credentials/3732", - "type": [ - "VerifiableCredential", - "UniversityDegreeCredential" - ], - "issuer": "https://example.edu/issuers/14", - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": { - "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science in Mechanical Engineering" - } - }, - "credentialStatus": "false", - "proof": { - "type": "RsaSignature2018" - } - } - }, - "errors": true - }, - { - "description": "creates a verifiable credential as a jwt with a did:key", - "input": { - "signerPortableDid": { - "uri": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY", - "privateKeys": [ + "description":"verifiable credential 1.1 creation", + "vectors":[ + { + "description":"valid simple credential", + "input":{ + "credential":{ + "type":"SimpleCred", + "issuer":"did:example:issuer", + "subject":"did:example:subject", + "credentialSubject":{ + "legit":true + } + } + }, + "output":{ + "@context":[ + "https://www.w3.org/2018/credentials/v1" + ], + "type":[ + "VerifiableCredential", + "SimpleCred" + ], + "id":"urn:uuid:ea74b564-fbe0-4b80-bd60-cd465d433e12", + "issuer":"did:example:issuer", + "credentialSubject":{ + "id":"did:example:subject", + "legit":true + } + } + }, + { + "description":"full featured credential ", + "input":{ + "credential":{ + "type":"SimpleCred", + "issuer":"did:example:issuer", + "subject":"did:example:subject", + "credentialSubject":{ + "legit":true + }, + "issuanceDate":"2024-04-02T16:16:54Z", + "expirationDate":"2050-04-02T16:16:54Z", + "evidence":[ { - "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" - } + "myevidence":{ + "random":"evidence" } - ] - }, - "metadata": {} - }, - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1" - ], - "type": [ - "VerifiableCredential", - "StreetCred" - ], - "id": "urn:uuid:6c8bbcf4-87af-449a-9bfb-30bf29976227", - "issuer": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY", - "issuanceDate": "2023-11-30T00:03:13Z", - "credentialSubject": { - "id": "did:key:zQ3shkpavjKRewoBk6arPJnhA87ZzhLDEWgVvZKNHK6QqVJDB", - "localRespect": "high", - "legit": true - } - } - }, - "output": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZDI1NTE5Iiwia2lkIjoiZGlkOmtleTp6Nk1rZlVoanNaVUpremlvR0RVTHBjcXhYRlNOczZNY01KbzMxdHhZbkVhcW45ZFkjejZNa2ZVaGpzWlVKa3ppb0dEVUxwY3F4WEZTTnM2TWNNSm8zMXR4WW5FYXFuOWRZIn0.eyJpc3MiOiJkaWQ6a2V5Ono2TWtmVWhqc1pVSmt6aW9HRFVMcGNxeFhGU05zNk1jTUpvMzF0eFluRWFxbjlkWSIsInN1YiI6ImRpZDprZXk6elEzc2hrcGF2aktSZXdvQms2YXJQSm5oQTg3WnpoTERFV2dWdlpLTkhLNlFxVkpEQiIsImlhdCI6MTcwMTMwMjU5MzAwMCwidmMiOnsiaXNzdWFuY2VEYXRlIjoiMjAyMy0xMS0zMFQwMDowMzoxM1oiLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDprZXk6elEzc2hrcGF2aktSZXdvQms2YXJQSm5oQTg3WnpoTERFV2dWdlpLTkhLNlFxVkpEQiIsImxvY2FsUmVzcGVjdCI6ImhpZ2giLCJsZWdpdCI6dHJ1ZX0sImlkIjoidXJuOnV1aWQ6NmM4YmJjZjQtODdhZi00NDlhLTliZmItMzBiZjI5OTc2MjI3IiwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIlN0cmVldENyZWQiXSwiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiXSwiaXNzdWVyIjoiZGlkOmtleTp6Nk1rZlVoanNaVUpremlvR0RVTHBjcXhYRlNOczZNY01KbzMxdHhZbkVhcW45ZFkifX0.rbXxa-vxIWG_uq7kACR-7OjJEFbyh9hDaok-QuJhyp_2KPFUXLqNe0LoIuJZA9eUcIVRUDdk_N7-zVvTdXdTAg" - }, - { - "description": "creates a verifiable credential as a jwt with a did:jwk", - "input": { - "signerPortableDid": { - "uri": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwidXNlIjoic2lnIiwiYWxnIjoiRWREU0EiLCJraWQiOiJKUVYzQ0VaQ3BWWnBCWmQ0N0EzLWllTUM1T1BvOHJ5QlQ5cHdLX3NDLUtBIiwieCI6IlUzWXNDNjFJZnBxRjlqUHNRX01UMDBFTTRBQXVHYms0SDN1VVZRczBFelEifQ", - "privateKeys": [ - { - "kty": "OKP", - "crv": "Ed25519", - "use": "sig", - "alg": "EdDSA", - "kid": "JQV3CEZCpVZpBZd47A3-ieMC5OPo8ryBT9pwK_sC-KA", - "d": "8L5Y7M4ZNc9Jy5IooJNFaRGatXHZzRRXxGsVidrAsfE", - "x": "U3YsC61IfpqF9jPsQ_MT00EM4AAuGbk4H3uUVQs0EzQ" } - ], - "document": { - "id": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwidXNlIjoic2lnIiwiYWxnIjoiRWREU0EiLCJraWQiOiJKUVYzQ0VaQ3BWWnBCWmQ0N0EzLWllTUM1T1BvOHJ5QlQ5cHdLX3NDLUtBIiwieCI6IlUzWXNDNjFJZnBxRjlqUHNRX01UMDBFTTRBQXVHYms0SDN1VVZRczBFelEifQ", - "verificationMethod": [ - { - "id": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwidXNlIjoic2lnIiwiYWxnIjoiRWREU0EiLCJraWQiOiJKUVYzQ0VaQ3BWWnBCWmQ0N0EzLWllTUM1T1BvOHJ5QlQ5cHdLX3NDLUtBIiwieCI6IlUzWXNDNjFJZnBxRjlqUHNRX01UMDBFTTRBQXVHYms0SDN1VVZRczBFelEifQ#0", - "type": "JsonWebKey", - "controller": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwidXNlIjoic2lnIiwiYWxnIjoiRWREU0EiLCJraWQiOiJKUVYzQ0VaQ3BWWnBCWmQ0N0EzLWllTUM1T1BvOHJ5QlQ5cHdLX3NDLUtBIiwieCI6IlUzWXNDNjFJZnBxRjlqUHNRX01UMDBFTTRBQXVHYms0SDN1VVZRczBFelEifQ", - "publicKeyJwk": { - "kty": "OKP", - "crv": "Ed25519", - "use": "sig", - "alg": "EdDSA", - "kid": "JQV3CEZCpVZpBZd47A3-ieMC5OPo8ryBT9pwK_sC-KA", - "x": "U3YsC61IfpqF9jPsQ_MT00EM4AAuGbk4H3uUVQs0EzQ" - } - } - ] - }, - "metadata": {} - }, - "credential": { - "@context": [ - "https://www.w3.org/2018/credentials/v1" - ], - "type": [ - "VerifiableCredential", - "StreetCred" - ], - "id": "urn:uuid:6c8bbcf4-87af-449a-9bfb-30bf29976227", - "issuer": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwidXNlIjoic2lnIiwiYWxnIjoiRWREU0EiLCJraWQiOiJKUVYzQ0VaQ3BWWnBCWmQ0N0EzLWllTUM1T1BvOHJ5QlQ5cHdLX3NDLUtBIiwieCI6IlUzWXNDNjFJZnBxRjlqUHNRX01UMDBFTTRBQXVHYms0SDN1VVZRczBFelEifQ", - "issuanceDate": "2023-11-30T00:03:13Z", - "credentialSubject": { - "id": "did:key:zQ3shkpavjKRewoBk6arPJnhA87ZzhLDEWgVvZKNHK6QqVJDB", - "localRespect": "high", - "legit": true - } - } - }, - "output": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZDI1NTE5Iiwia2lkIjoiZGlkOmp3azpleUpyZEhraU9pSlBTMUFpTENKamNuWWlPaUpGWkRJMU5URTVJaXdpZFhObElqb2ljMmxuSWl3aVlXeG5Jam9pUldSRVUwRWlMQ0pyYVdRaU9pSktVVll6UTBWYVEzQldXbkJDV21RME4wRXpMV2xsVFVNMVQxQnZPSEo1UWxRNWNIZExYM05ETFV0Qklpd2llQ0k2SWxVeldYTkROakZKWm5CeFJqbHFVSE5SWDAxVU1EQkZUVFJCUVhWSFltczBTRE4xVlZaUmN6QkZlbEVpZlEjMCJ9.eyJpc3MiOiJkaWQ6andrOmV5SnJkSGtpT2lKUFMxQWlMQ0pqY25ZaU9pSkZaREkxTlRFNUlpd2lkWE5sSWpvaWMybG5JaXdpWVd4bklqb2lSV1JFVTBFaUxDSnJhV1FpT2lKS1VWWXpRMFZhUTNCV1duQkNXbVEwTjBFekxXbGxUVU0xVDFCdk9ISjVRbFE1Y0hkTFgzTkRMVXRCSWl3aWVDSTZJbFV6V1hORE5qRkpabkJ4UmpscVVITlJYMDFVTURCRlRUUkJRWFZIWW1zMFNETjFWVlpSY3pCRmVsRWlmUSIsInN1YiI6ImRpZDprZXk6elEzc2hrcGF2aktSZXdvQms2YXJQSm5oQTg3WnpoTERFV2dWdlpLTkhLNlFxVkpEQiIsImlhdCI6MTcwMTMwMjU5MzAwMCwidmMiOnsiaXNzdWFuY2VEYXRlIjoiMjAyMy0xMS0zMFQwMDowMzoxM1oiLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDprZXk6elEzc2hrcGF2aktSZXdvQms2YXJQSm5oQTg3WnpoTERFV2dWdlpLTkhLNlFxVkpEQiIsImxvY2FsUmVzcGVjdCI6ImhpZ2giLCJsZWdpdCI6dHJ1ZX0sImlkIjoidXJuOnV1aWQ6NmM4YmJjZjQtODdhZi00NDlhLTliZmItMzBiZjI5OTc2MjI3IiwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIlN0cmVldENyZWQiXSwiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpyZEhraU9pSlBTMUFpTENKamNuWWlPaUpGWkRJMU5URTVJaXdpZFhObElqb2ljMmxuSWl3aVlXeG5Jam9pUldSRVUwRWlMQ0pyYVdRaU9pSktVVll6UTBWYVEzQldXbkJDV21RME4wRXpMV2xsVFVNMVQxQnZPSEo1UWxRNWNIZExYM05ETFV0Qklpd2llQ0k2SWxVeldYTkROakZKWm5CeFJqbHFVSE5SWDAxVU1EQkZUVFJCUVhWSFltczBTRE4xVlZaUmN6QkZlbEVpZlEifX0.A_zCrL8pKwMCnJWMKkeZnA5VT6-WC_5VTE7xy9ZF2IH-ZY1ypZvUkw2_oMzZkOCS_bMmNM2_ilwSZak1S2EfCA" + ] + } + }, + "output":{ + "@context":[ + "https://www.w3.org/2018/credentials/v1" + ], + "type":[ + "VerifiableCredential", + "SimpleCred" + ], + "id":"urn:uuid:ea74b564-fbe0-4b80-bd60-cd465d433e12", + "issuer":"did:example:issuer", + "issuanceDate":"2024-04-02T16:16:54Z", + "expirationDate":"2050-04-02T16:16:54Z", + "credentialSubject":{ + "id":"did:example:subject", + "legit":true + } + } } ] } \ No newline at end of file