Skip to content

Commit

Permalink
CryptoKey: remove odd unused methods from DSAPublicKey
Browse files Browse the repository at this point in the history
The `keyId` method has no reasonable use, whereas `compareTo` exists
without implementing the Comparable interface. Remove both.
  • Loading branch information
bertm committed Oct 5, 2024
1 parent e263cd5 commit 88d3fb4
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/freenet/crypt/DSAPublicKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ public static CryptoKey read(InputStream i) throws IOException, CryptFormatExcep
return new DSAPublicKey(i);
}

public int keyId() {
return y.intValue();
}

@Override
public String toLongString() {
return "y=" + HexUtil.biToHex(y);
Expand Down Expand Up @@ -155,13 +151,6 @@ public boolean equals(Object o) {
return o instanceof DSAPublicKey && equals((DSAPublicKey) o);
}

public int compareTo(Object other) {
if(other instanceof DSAPublicKey)
return getY().compareTo(((DSAPublicKey) other).getY());
else
return -1;
}

public SimpleFieldSet asFieldSet() {
SimpleFieldSet fs = new SimpleFieldSet(true);
fs.putSingle("y", Base64.encode(y.toByteArray()));
Expand Down

0 comments on commit 88d3fb4

Please sign in to comment.