diff --git a/suites/verify.js b/suites/verify.js index 96798d4..dd2a340 100644 --- a/suites/verify.js +++ b/suites/verify.js @@ -149,6 +149,15 @@ export function runDataIntegrityProofVerifyTests({ 'after issuance.' }); }); + it('The value of the cryptosuite property MUST be a string that ' + + 'identifies the cryptographic suite. If the processing environment ' + + 'supports subtypes of string, the type of the cryptosuite value MUST ' + + 'be the https://w3id.org/security#cryptosuiteString subtype of string.', + async function() { + this.test.link = 'https://w3c.github.io/vc-data-integrity/#introduction:~:text=The%20value%20of%20the%20cryptosuite%20property%20MUST%20be%20a%20string%20that%20identifies%20the%20cryptographic%20suite.%20If%20the%20processing%20environment%20supports%20subtypes%20of%20string%2C%20the%20type%20of%20the%20cryptosuite%20value%20MUST%20be%20the%20https%3A//w3id.org/security%23cryptosuiteString%20subtype%20of%20string.'; + const credential = credentials.clone('invalidCryptosuite'); + await verificationFail({credential, verifier}); + }); if(optionalTests?.created) { it('The date and time the proof was created is OPTIONAL and, if ' + 'included, MUST be specified as an [XMLSCHEMA11-2] dateTimeStamp ' + @@ -159,16 +168,25 @@ export function runDataIntegrityProofVerifyTests({ const credential = credentials.clone('invalidCreated'); await verificationFail({credential, verifier}); }); + // we can't tell if its interpreted correctly but we can ensure their + // verifier at least takes timestamps without Z or an offset. + it('(created) A conforming processor MAY chose to consume time values ' + + 'that were incorrectly serialized without an offset.', async function() { + this.test.link = 'https://www.w3.org/TR/vc-data-integrity/#proofs:~:text=be%20a%20string.-,created,-The%20date%20and'; + await verificationSuccess({ + credential: credentials.clone('noOffsetCreated'), + verifier + }); + }); + it('(expires) A conforming processor MAY chose to consume time values ' + + 'that were incorrectly serialized without an offset.', async function() { + this.test.link = 'https://www.w3.org/TR/vc-data-integrity/#proofs:~:text=interpreted%20as%20UTC.-,expires,-The%20expires%20property'; + await verificationSuccess({ + credential: credentials.clone('noOffsetExpires'), + verifier + }); + }); } - it('The value of the cryptosuite property MUST be a string that ' + - 'identifies the cryptographic suite. If the processing environment ' + - 'supports subtypes of string, the type of the cryptosuite value MUST ' + - 'be the https://w3id.org/security#cryptosuiteString subtype of string.', - async function() { - this.test.link = 'https://w3c.github.io/vc-data-integrity/#introduction:~:text=The%20value%20of%20the%20cryptosuite%20property%20MUST%20be%20a%20string%20that%20identifies%20the%20cryptographic%20suite.%20If%20the%20processing%20environment%20supports%20subtypes%20of%20string%2C%20the%20type%20of%20the%20cryptosuite%20value%20MUST%20be%20the%20https%3A//w3id.org/security%23cryptosuiteString%20subtype%20of%20string.'; - const credential = credentials.clone('invalidCryptosuite'); - await verificationFail({credential, verifier}); - }); if(optionalTests.authentication) { it('If options has a non-null domain item, it MUST be equal to ' + 'proof.domain or an error MUST be raised and SHOULD convey an ' + @@ -193,24 +211,6 @@ export function runDataIntegrityProofVerifyTests({ } }); }); - // we can't tell if its interpreted correctly but we can ensure their - // verifier at least takes timestamps without Z or an offset. - it('(created) A conforming processor MAY chose to consume time values ' + - 'that were incorrectly serialized without an offset.', async function() { - this.test.link = 'https://www.w3.org/TR/vc-data-integrity/#proofs:~:text=be%20a%20string.-,created,-The%20date%20and'; - await verificationSuccess({ - credential: credentials.clone('noOffsetCreated'), - verifier - }); - }); - it('(expires) A conforming processor MAY chose to consume time values ' + - 'that were incorrectly serialized without an offset.', async function() { - this.test.link = 'https://www.w3.org/TR/vc-data-integrity/#proofs:~:text=interpreted%20as%20UTC.-,expires,-The%20expires%20property'; - await verificationSuccess({ - credential: credentials.clone('noOffsetExpires'), - verifier - }); - }); } }); }