public final class Ed25519Sign extends Object implements PublicKeySign
Ed25519Sign.KeyPair keyPair = Ed25519Sign.KeyPair.newKeyPair();
// securely store keyPair and share keyPair.getPublicKey()
Ed25519Sign signer = new Ed25519Sign(keyPair.getPrivateKey());
byte[] signature = signer.sign(message);
| Modifier and Type | Class and Description |
|---|---|
static class |
Ed25519Sign.KeyPair
Defines the KeyPair consisting of a private key and its corresponding public key.
|
| Modifier and Type | Field and Description |
|---|---|
static TinkFipsUtil.AlgorithmFipsCompatibility |
FIPS |
static int |
SECRET_KEY_LEN |
| Constructor and Description |
|---|
Ed25519Sign(byte[] privateKey)
Constructs a Ed25519Sign with the
privateKey. |
public static final TinkFipsUtil.AlgorithmFipsCompatibility FIPS
public static final int SECRET_KEY_LEN
public Ed25519Sign(byte[] privateKey)
throws GeneralSecurityException
privateKey.privateKey - 32-byte random sequence.GeneralSecurityException - if there is no SHA-512 algorithm defined in EngineFactory.MESSAGE_DIGEST.public byte[] sign(byte[] data)
throws GeneralSecurityException
PublicKeySigndata.sign in interface PublicKeySigndataGeneralSecurityException