Merge pull request #68 from imsglc/clr-verification

Update CLR20Inspector to use ConfigurableDocumentLoader
This commit is contained in:
Xavi Aracil 2023-01-02 10:19:19 +01:00 committed by GitHub
commit 4bed4a74ca
2 changed files with 6 additions and 1 deletions

View File

@ -17,6 +17,7 @@ import com.apicatalog.multibase.Multibase;
import com.apicatalog.multicodec.Multicodec;
import com.apicatalog.multicodec.Multicodec.Codec;
import foundation.identity.jsonld.ConfigurableDocumentLoader;
import info.weboftrust.ldsignatures.LdProof;
import info.weboftrust.ldsignatures.verifier.Ed25519Signature2020LdVerifier;
import jakarta.json.JsonObject;
@ -43,7 +44,10 @@ public class EmbeddedProofProbe extends Probe<VerifiableCredential> {
// TODO: What there are multiple proofs?
com.danubetech.verifiablecredentials.VerifiableCredential vc = com.danubetech.verifiablecredentials.VerifiableCredential.fromJson(new StringReader(crd.getJson().toString()));
vc.setDocumentLoader(new CachingDocumentLoader());
ConfigurableDocumentLoader documentLoader = new ConfigurableDocumentLoader();
documentLoader.setEnableHttp(true);
documentLoader.setEnableHttps(true);
vc.setDocumentLoader(documentLoader);
LdProof proof = vc.getLdProof();
if (proof == null) {

View File

@ -40,6 +40,7 @@ public class Samples {
public final static Sample SIMPLE_JSON = new Sample("clr20/simple.json", true);
public final static Sample SIMPLE_JSON_NOPROOF = new Sample("clr20/simple-noproof.json", true);
public final static Sample SIMPLE_JWT = new Sample("clr20/simple.jwt", true);
public final static Sample COMPLEX_JSON = new Sample("clr20/complex.json", true);
}
}