Added tests for eddsa-2022

This commit is contained in:
Xavi Aracil 2023-05-29 11:13:29 +02:00
parent ef5836ecbe
commit f44a4a67bf
3 changed files with 42 additions and 0 deletions

View File

@ -379,4 +379,14 @@ public class OB30Tests {
assertHasProbeID(report, RevocationListProbe.ID, true); assertHasProbeID(report, RevocationListProbe.ID, true);
}); });
} }
@Test
void testEddsa2022Valid() {
assertDoesNotThrow(()->{
Report report = validator.run(Samples.OB30.JSON.SIMPLE_EDDSA_20222_JSON.asFileResource());
if(verbose) PrintHelper.print(report, true);
assertValid(report);
});
}
} }

View File

@ -11,6 +11,7 @@ public class Samples {
public static final class JSON { public static final class JSON {
public final static Sample COMPLETE_JSON = new Sample("ob30/complete.json", false); public final static Sample COMPLETE_JSON = new Sample("ob30/complete.json", false);
public final static Sample SIMPLE_JSON = new Sample("ob30/simple.json", true); public final static Sample SIMPLE_JSON = new Sample("ob30/simple.json", true);
public final static Sample SIMPLE_EDDSA_20222_JSON = new Sample("ob30/simple-eddsa-2022.json", true);
public final static Sample SIMPLE_DID_KEY_METHOD_JSON = new Sample("ob30/simple-did-key-method.json", true); public final static Sample SIMPLE_DID_KEY_METHOD_JSON = new Sample("ob30/simple-did-key-method.json", true);
public final static Sample SIMPLE_DID_WEB_METHOD_JSON = new Sample("ob30/simple-did-web-method.json", true); public final static Sample SIMPLE_DID_WEB_METHOD_JSON = new Sample("ob30/simple-did-web-method.json", true);
public final static Sample SIMPLE_MULTIPLE_PROOF_JSON = new Sample("ob30/simple-multiple-proofs.json", true); public final static Sample SIMPLE_MULTIPLE_PROOF_JSON = new Sample("ob30/simple-multiple-proofs.json", true);

View File

@ -0,0 +1,31 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.1.json",
"https://w3id.org/security/data-integrity/v1"
],
"type": ["VerifiableCredential", "AchievementCredential"],
"id": "http://www.1edtech.org/ob/1",
"issuanceDate": "2022-11-27T00:00:00Z",
"credentialSubject": {
"type": "AchievementSubject",
"id": "did:1edtech:1",
"achievement": {
"id": "did:1edtech:achievement:1",
"type": ["Achievement"],
"criteria": { "narrative": "some narrative" },
"description": "some description",
"name": "some name"
}
},
"name": "Some name",
"issuer": { "id": "https://example.com/issuers/876543", "type": ["Profile"] },
"proof": {
"type": "DataIntegrityProof",
"created": "2023-05-29T08:42:26Z",
"proofPurpose": "assertionMethod",
"verificationMethod": "https://example.com/issuers/876543#z6MkjZRZv3aez3r18pB1RBFJR1kwUVJ5jHt92JmQwXbd5hwi",
"cryptosuite": "eddsa-2022",
"proofValue": "z2H1miRAGKPRCPUSudNTPrsWyvpRZzgtgjPBmnMkbcwR8StwEv8dr3NigviBgvZwBu8yA7wAyF5qLjyo3zN1UqLR2"
}
}