eddsa-2022 renamed to eddsa-rdfc-2022

This commit is contained in:
Xavi Aracil 2023-09-25 09:40:16 +02:00
parent 55c4a5b7fb
commit f6b1dff7d8
2 changed files with 5 additions and 3 deletions

View File

@ -37,6 +37,8 @@ import jakarta.json.JsonValue;
*/ */
public class EmbeddedProofProbe extends Probe<VerifiableCredential> { public class EmbeddedProofProbe extends Probe<VerifiableCredential> {
private final static List<String> ALLOWED_CRYPTOSUITES = List.of("eddsa-2022", "eddsa-rdfc-2022");
public EmbeddedProofProbe() { public EmbeddedProofProbe() {
super(ID); super(ID);
} }
@ -60,11 +62,11 @@ public class EmbeddedProofProbe extends Probe<VerifiableCredential> {
Optional<LdProof> selectedProof = proofs.stream() Optional<LdProof> selectedProof = proofs.stream()
.filter(proof -> proof.getProofPurpose().equals("assertionMethod")) .filter(proof -> proof.getProofPurpose().equals("assertionMethod"))
.filter(proof -> proof.isType("Ed25519Signature2020") || .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(); .findFirst();
if (!selectedProof.isPresent()) { 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(); LdProof proof = selectedProof.get();

View File

@ -39,7 +39,7 @@ public class Eddsa2022LdProof extends LdProof {
super.build(); super.build();
if (addCryptosuite) { if (addCryptosuite) {
JsonLDUtils.jsonLdAdd(this.jsonLdObject, "cryptosuite", "eddsa-2022"); JsonLDUtils.jsonLdAdd(this.jsonLdObject, "cryptosuite", "eddsa-rdfc-2022");
} }
return (LdProof) this.jsonLdObject; return (LdProof) this.jsonLdObject;