Package com.horizen.schnorrnative
Class SchnorrKeyPair
- java.lang.Object
-
- com.horizen.schnorrnative.SchnorrKeyPair
-
- All Implemented Interfaces:
AutoCloseable
public class SchnorrKeyPair extends Object implements AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description SchnorrKeyPair(SchnorrSecretKey secretKey)SchnorrKeyPair(SchnorrSecretKey secretKey, SchnorrPublicKey publicKey)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static SchnorrKeyPairgenerate()static SchnorrKeyPairgenerate(byte[] seed)Generate a fresh Schnorr key-pair from a seed.SchnorrPublicKeygetPublicKey()SchnorrSecretKeygetSecretKey()SchnorrSignaturesignMessage(FieldElement message)
-
-
-
Constructor Detail
-
SchnorrKeyPair
public SchnorrKeyPair(SchnorrSecretKey secretKey, SchnorrPublicKey publicKey)
-
SchnorrKeyPair
public SchnorrKeyPair(SchnorrSecretKey secretKey)
-
-
Method Detail
-
generate
public static SchnorrKeyPair generate(byte[] seed)
Generate a fresh Schnorr key-pair from a seed.- Parameters:
seed- - The seed used to generate the key-pair. WARNING: It's caller responsibility to pass a seed of appropriate length. No checks are performed Rust-side.- Returns:
- the new Schnorr key-pair
-
generate
public static SchnorrKeyPair generate()
-
signMessage
public SchnorrSignature signMessage(FieldElement message)
-
getSecretKey
public SchnorrSecretKey getSecretKey()
-
getPublicKey
public SchnorrPublicKey getPublicKey()
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-