diff --git a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/EmbeddedProofProbe.java b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/EmbeddedProofProbe.java index cd6e6fa..6b98ab9 100644 --- a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/EmbeddedProofProbe.java +++ b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/EmbeddedProofProbe.java @@ -25,7 +25,7 @@ import jakarta.json.JsonStructure; /** * A Probe that verifies a credential's embedded proof. - * + * * @author mgylling */ public class EmbeddedProofProbe extends Probe { @@ -40,16 +40,14 @@ public class EmbeddedProofProbe extends Probe { */ @Override public ReportItems run(Credential crd, RunContext ctx) throws Exception { - + // TODO: What there are multiple proofs? VerifiableCredential vc = VerifiableCredential.fromJson(new StringReader(crd.getJson().toString())); ConfigurableDocumentLoader documentLoader = new ConfigurableDocumentLoader(); documentLoader.setEnableHttp(true); documentLoader.setEnableHttps(true); - vc.setDocumentLoader(new CachingDocumentLoader()); - vc.setDocumentLoader(documentLoader); - URI method = vc.getLdProof().getVerificationMethod(); + vc.setDocumentLoader(documentLoader); LdProof proof = vc.getLdProof(); if (proof == null) { @@ -93,11 +91,11 @@ public class EmbeddedProofProbe extends Probe { } } else if (method.getScheme().equals("http") || method.getScheme().equals("https")) { // TODO: Can we use proof.getDocumentLoader()? - ConfigurableDocumentLoader documentLoader = new ConfigurableDocumentLoader(); - documentLoader.setEnableHttp(true); - documentLoader.setEnableHttps(true); + ConfigurableDocumentLoader keyDocumentLoader = new ConfigurableDocumentLoader(); + keyDocumentLoader.setEnableHttp(true); + keyDocumentLoader.setEnableHttps(true); - Document keyDocument = documentLoader.loadDocument(method, new DocumentLoaderOptions()); + Document keyDocument = keyDocumentLoader.loadDocument(method, new DocumentLoaderOptions()); Optional keyStructure = keyDocument.getJsonContent(); if (keyStructure.isEmpty()) { return error("Key document not found at " + method, ctx);