From f6b1dff7d8edfb839104b865b6aff76427811ef9 Mon Sep 17 00:00:00 2001 From: Xavi Aracil Date: Mon, 25 Sep 2023 09:40:16 +0200 Subject: [PATCH] eddsa-2022 renamed to eddsa-rdfc-2022 --- .../org/oneedtech/inspect/vc/probe/EmbeddedProofProbe.java | 6 ++++-- .../oneedtech/inspect/vc/verification/Eddsa2022LdProof.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) 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 fda8378..2b57b1e 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 @@ -37,6 +37,8 @@ import jakarta.json.JsonValue; */ public class EmbeddedProofProbe extends Probe { + private final static List ALLOWED_CRYPTOSUITES = List.of("eddsa-2022", "eddsa-rdfc-2022"); + public EmbeddedProofProbe() { super(ID); } @@ -60,11 +62,11 @@ public class EmbeddedProofProbe extends Probe { Optional selectedProof = proofs.stream() .filter(proof -> proof.getProofPurpose().equals("assertionMethod")) .filter(proof -> proof.isType("Ed25519Signature2020") || - (proof.isType("DataIntegrityProof") && proof.getJsonObject().containsKey("cryptosuite") && proof.getJsonObject().get("cryptosuite").equals("eddsa-2022"))) + (proof.isType("DataIntegrityProof") && proof.getJsonObject().containsKey("cryptosuite") && ALLOWED_CRYPTOSUITES.contains(proof.getJsonObject().get("cryptosuite")))) .findFirst(); if (!selectedProof.isPresent()) { - return error("No proof with type any of (\"Ed25519Signature2020\", \"DataIntegrityProof\" with cryptosuite attr of \"eddsa-2022\") or proof purpose \"assertionMethod\" found", ctx); + return error("No proof with type any of (\"Ed25519Signature2020\", \"DataIntegrityProof\" with cryptosuite attr of \"eddsa-rdfc-2022\" or \"eddsa-2022\") or proof purpose \"assertionMethod\" found", ctx); } LdProof proof = selectedProof.get(); diff --git a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/verification/Eddsa2022LdProof.java b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/verification/Eddsa2022LdProof.java index b163d3e..5eb64b0 100644 --- a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/verification/Eddsa2022LdProof.java +++ b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/verification/Eddsa2022LdProof.java @@ -39,7 +39,7 @@ public class Eddsa2022LdProof extends LdProof { super.build(); if (addCryptosuite) { - JsonLDUtils.jsonLdAdd(this.jsonLdObject, "cryptosuite", "eddsa-2022"); + JsonLDUtils.jsonLdAdd(this.jsonLdObject, "cryptosuite", "eddsa-rdfc-2022"); } return (LdProof) this.jsonLdObject;