Skip to content

Commit

Permalink
fix: constructor arg and type hierarchy (#4173)
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed May 13, 2024
1 parent f3992e2 commit a6a17f5
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -63,6 +64,11 @@ public byte[] privateKey() {
return privateKey;
}

@Override
public String algorithm() {
return type.toString();
}

public byte[] publicKey() {
return publicKey;
}
Expand Down

0 comments on commit a6a17f5

Please sign in to comment.