public enum Ed25519CryptoFunction extends java.lang.Enum<Ed25519CryptoFunction> implements CryptoFunction
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
KeyPair |
generateKeyPair()
Generates a private key and a corresponding public key using a random seed.
|
KeyPair |
generateKeyPair(byte[] seed)
Generates a private key and a corresponding public key using a
seed byte array. |
byte[] |
signMessage(byte[] message,
PrivateKey privateKey)
Given a
privateKey , computes and returns a signature for the supplied message . |
static Ed25519CryptoFunction |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Ed25519CryptoFunction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
boolean |
verify(byte[] message,
byte[] signature,
PublicKey publicKey)
Given a
publicKey , verifies that signature is a valid signature for the
supplied message . |
public static final Ed25519CryptoFunction INSTANCE
public static Ed25519CryptoFunction[] values()
for (Ed25519CryptoFunction c : Ed25519CryptoFunction.values()) System.out.println(c);
public static Ed25519CryptoFunction valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic KeyPair generateKeyPair(byte[] seed)
CryptoFunction
seed
byte array.generateKeyPair
in interface CryptoFunction
public KeyPair generateKeyPair()
CryptoFunction
generateKeyPair
in interface CryptoFunction
public byte[] signMessage(byte[] message, PrivateKey privateKey)
CryptoFunction
privateKey
, computes and returns a signature for the supplied message
.signMessage
in interface CryptoFunction
public boolean verify(byte[] message, byte[] signature, PublicKey publicKey)
CryptoFunction
publicKey
, verifies that signature
is a valid signature for the
supplied message
.verify
in interface CryptoFunction
Copyright © 2018 Exonum. All rights reserved.