Package com.syntifi.crypto.key
Class Ed25519PublicKey
- java.lang.Object
-
- com.syntifi.crypto.key.AbstractPublicKey
-
- com.syntifi.crypto.key.Ed25519PublicKey
-
public class Ed25519PublicKey extends AbstractPublicKey
ed25519 implementation ofAbstractPublicKey- Since:
- 0.1.0
-
-
Constructor Summary
Constructors Constructor Description Ed25519PublicKey()Ed25519PublicKey(byte[] publicKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)inthashCode()voidloadPublicKey(byte[] publicKey)Loads a public key from a byte arrayvoidreadPublicKey(java.io.Reader reader)Reads the public key from a filejava.lang.Booleanverify(byte[] message, byte[] signature)Verifies message with given signaturevoidwritePublicKey(java.io.Writer writer)Writes the public key to a file-
Methods inherited from class com.syntifi.crypto.key.AbstractPublicKey
getKey, readPublicKey, setKey, toString, writePublicKey
-
-
-
-
Method Detail
-
loadPublicKey
public void loadPublicKey(byte[] publicKey)
Description copied from class:AbstractPublicKeyLoads a public key from a byte array- Specified by:
loadPublicKeyin classAbstractPublicKey- Parameters:
publicKey- the public key bytes
-
readPublicKey
public void readPublicKey(java.io.Reader reader) throws java.io.IOExceptionDescription copied from class:AbstractPublicKeyReads the public key from a file- Specified by:
readPublicKeyin classAbstractPublicKey- Parameters:
reader- the source filename- Throws:
java.io.IOException- thrown if an error occurs reading the file
-
writePublicKey
public void writePublicKey(java.io.Writer writer) throws java.io.IOExceptionDescription copied from class:AbstractPublicKeyWrites the public key to a file- Specified by:
writePublicKeyin classAbstractPublicKey- Parameters:
writer- the target to write the public key- Throws:
java.io.IOException- thrown if an error occurs writing the file
-
verify
public java.lang.Boolean verify(byte[] message, byte[] signature)Description copied from class:AbstractPublicKeyVerifies message with given signature- Specified by:
verifyin classAbstractPublicKey- Parameters:
message- the signed messagesignature- the signature to check against- Returns:
- true if matches, false otherwise
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classAbstractPublicKey
-
canEqual
protected boolean canEqual(java.lang.Object other)
- Overrides:
canEqualin classAbstractPublicKey
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractPublicKey
-
-