-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# `credentials` Test Vectors | ||
|
||
This directory contains test vectors for the `credentials` module. It's important to note that the test vectors ensure | ||
that | ||
the implementations are following the [Verifiable Credential 1.1 specification](https://www.w3.org/TR/vc-data-model/). | ||
|
||
## `create` | ||
|
||
Create test vectors are available for [success](./create_success.json) and [failure](./create_failure.json) test cases. | ||
|
||
### Input | ||
|
||
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/). | | ||
|
||
### 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. | ||
|
||
### Reference implementations | ||
|
||
The reference implementations for: | ||
* `create_success` can be found [here](https://github.com/TBD54566975/web5-kt/blob/466e8d8ca9771ae3a98767e5a4a79ac7b1e7a5d8/credentials/src/test/kotlin/web5/sdk/credentials/VerifiableCredentialTest.kt#L244). | ||
Check failure on line 30 in web5-test-vectors/credentials/README.md GitHub Actions / lintLists should be surrounded by blank lines
|
||
* `create_failure` can be found [here](https://github.com/TBD54566975/web5-kt/blob/466e8d8ca9771ae3a98767e5a4a79ac7b1e7a5d8/credentials/src/test/kotlin/web5/sdk/credentials/VerifiableCredentialTest.kt#L285). | ||
|
||
## `verify` | ||
|
||
Verify test vectors are available for [success](./verify_success.json) and [failure](./verify_failure.json) test cases. | ||
|
||
### Input | ||
Check failure on line 37 in web5-test-vectors/credentials/README.md GitHub Actions / lintMultiple headings with the same content
|
||
|
||
The value of `input` is an object with the single property `vcJwt`. The value of `vcJwt` 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). | ||
|
||
### Output | ||
Check failure on line 42 in web5-test-vectors/credentials/README.md GitHub Actions / lintMultiple headings with the same content
|
||
|
||
Output is empty, signalling that no exception nor errors should be thrown for success cases. For failure cases, the | ||
`errors` property is set to `true`, signalling that an exception or an error should be returned or thrown. | ||
|
||
### Reference implementations | ||
Check failure on line 47 in web5-test-vectors/credentials/README.md GitHub Actions / lintMultiple headings with the same content
|
||
|
||
The reference implementations for: | ||
* `verify_success` can be found [here](https://github.com/TBD54566975/web5-kt/blob/466e8d8ca9771ae3a98767e5a4a79ac7b1e7a5d8/credentials/src/test/kotlin/web5/sdk/credentials/VerifiableCredentialTest.kt#L261). | ||
Check failure on line 50 in web5-test-vectors/credentials/README.md GitHub Actions / lintLists should be surrounded by blank lines
|
||
* `verify_failure` can be found [here](https://github.com/TBD54566975/web5-kt/blob/466e8d8ca9771ae3a98767e5a4a79ac7b1e7a5d8/credentials/src/test/kotlin/web5/sdk/credentials/VerifiableCredentialTest.kt#L273). | ||
Check failure on line 51 in web5-test-vectors/credentials/README.md GitHub Actions / lintFiles should end with a single newline character
|