diff options
Diffstat (limited to 'sshlib/src/main/java/com/trilead/ssh2/crypto/key/Ed25519Key.java')
-rw-r--r-- | sshlib/src/main/java/com/trilead/ssh2/crypto/key/Ed25519Key.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sshlib/src/main/java/com/trilead/ssh2/crypto/key/Ed25519Key.java b/sshlib/src/main/java/com/trilead/ssh2/crypto/key/Ed25519Key.java index 5c9e549..2c49350 100644 --- a/sshlib/src/main/java/com/trilead/ssh2/crypto/key/Ed25519Key.java +++ b/sshlib/src/main/java/com/trilead/ssh2/crypto/key/Ed25519Key.java @@ -18,6 +18,7 @@ package com.trilead.ssh2.crypto.key; import java.security.Key; +import java.util.Arrays; /** * Java representation of a native Ed25519 key. @@ -42,4 +43,19 @@ public class Ed25519Key implements Key { public byte[] getEncoded() { return keyBytes; } + + @Override + public int hashCode() { + return Arrays.hashCode(keyBytes); + } + + @Override + public boolean equals(Object other) { + if (!(other instanceof Ed25519Key)) { + return false; + } + + Ed25519Key otherKey = (Ed25519Key) other; + return Arrays.equals(keyBytes, otherKey.keyBytes); + } } |