w3c-ccg / data-integrity-test-suite-assertion

Library for Data Integrity related test suites
0 stars 1 forks source link

proof chain tests #67

Open aljones15 opened 1 month ago

aljones15 commented 1 month ago

Start with:

previousProof An OPTIONAL string value or unordered list of string values. Each value identifies another data integrity proof that MUST verify before the current proof is processed. If an unordered list, all referenced proofs in the array MUST verify. This property is used in Section 2.1.2 Proof Chains.

https://w3c.github.io/vc-data-integrity/#proof-chains

has an example.

There is an existing generator that adds a proofId: https://github.com/w3c-ccg/data-integrity-test-suite-assertion/blob/3666beb6e58fc9ec360c4d7b41b5e8741481ae46/vc-generator/generators.js#L174-L177

aljones15 commented 1 month ago

additionally: Whenever this algorithm encodes strings, it MUST use UTF-8 encoding.

aljones15 commented 1 month ago

If options has a previousProof item that is a string, add the element from allProofs with an id attribute matching previousProof to matchingProofs. If a proof with id equal to previousProof does not exist in allProofs, an error MUST be raised and SHOULD convey an error type of PROOF_GENERATION_ERROR.

If options has a previousProof item that is an array, add each element from allProofs with an id attribute that matches an element of that array. If any element of previousProof array has an id attribute that does not match the id attribute of any element of allProofs, an error MUST be raised and SHOULD convey an error type of PROOF_GENERATION_ERROR.