From a6a17f547e923f590f782ec3629da997d0b7c080 Mon Sep 17 00:00:00 2001 From: Paul Latzelsperger <43503240+paullatzelsperger@users.noreply.github.com> Date: Mon, 13 May 2024 12:56:34 +0200 Subject: [PATCH] fix: constructor arg and type hierarchy (#4173) --- .../linkeddata/DataIntegrityKeyPair.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/extensions/common/crypto/ldp-verifiable-credentials/src/main/java/org/eclipse/edc/verifiablecredentials/linkeddata/DataIntegrityKeyPair.java b/extensions/common/crypto/ldp-verifiable-credentials/src/main/java/org/eclipse/edc/verifiablecredentials/linkeddata/DataIntegrityKeyPair.java index 8047f058402..f2f37dc58f5 100644 --- a/extensions/common/crypto/ldp-verifiable-credentials/src/main/java/org/eclipse/edc/verifiablecredentials/linkeddata/DataIntegrityKeyPair.java +++ b/extensions/common/crypto/ldp-verifiable-credentials/src/main/java/org/eclipse/edc/verifiablecredentials/linkeddata/DataIntegrityKeyPair.java @@ -16,6 +16,7 @@ import com.apicatalog.ld.signature.VerificationMethod; +import com.apicatalog.ld.signature.key.VerificationKey; import java.net.URI; import java.util.Arrays; @@ -24,24 +25,24 @@ /** * Generic adapter object for a {@link VerificationMethod} */ -class DataIntegrityKeyPair implements VerificationMethod { +class DataIntegrityKeyPair implements VerificationKey { private final URI id; private final URI type; private final URI controller; private final byte[] privateKey; private final byte[] publicKey; - DataIntegrityKeyPair(URI id, URI type, URI controller, byte[] privateKey, byte[] publicKey) { + DataIntegrityKeyPair(URI id, URI type, URI controller, byte[] publicKey, byte[] privateKey) { super(); this.id = id; this.type = type; this.controller = controller; - this.privateKey = privateKey; this.publicKey = publicKey; + this.privateKey = privateKey; } - DataIntegrityKeyPair(URI id, URI type, URI controller, byte[] privateKey) { - this(id, type, controller, privateKey, null); + DataIntegrityKeyPair(URI id, URI type, URI controller, byte[] publicKey) { + this(id, type, controller, publicKey, null); } @Override @@ -63,6 +64,11 @@ public byte[] privateKey() { return privateKey; } + @Override + public String algorithm() { + return type.toString(); + } + public byte[] publicKey() { return publicKey; }