Package org.symbol.sdk.symbol
Class VotingKeysGenerator
java.lang.Object
org.symbol.sdk.symbol.VotingKeysGenerator
- VotingKeysGenerator
- Generates Symbol voting keys. Binary layout: an 80-byte header followed by a 96-byte entry per epoch (private key + parent signature over the child public key concatenated with the epoch identifier).
-
Constructor Summary
ConstructorsConstructorDescriptionVotingKeysGenerator(KeyPair rootKeyPair) Creates a generator around a voting root key pair usingCryptoTypes.PrivateKey.random()for child key generation.VotingKeysGenerator(KeyPair rootKeyPair, Supplier<CryptoTypes.PrivateKey> privateKeyGenerator) Creates a generator around a voting root key pair with a custom private-key generator. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]generate(long startEpoch, long endEpoch) Generates voting keys for the inclusive epoch range[startEpoch, endEpoch].
-
Constructor Details
-
VotingKeysGenerator
Creates a generator around a voting root key pair usingCryptoTypes.PrivateKey.random()for child key generation.- Parameters:
rootKeyPair- Voting root key pair.
-
VotingKeysGenerator
public VotingKeysGenerator(KeyPair rootKeyPair, Supplier<CryptoTypes.PrivateKey> privateKeyGenerator) Creates a generator around a voting root key pair with a custom private-key generator.- Parameters:
rootKeyPair- Voting root key pair.privateKeyGenerator- Private key generator.
-
-
Method Details
-
generate
public byte[] generate(long startEpoch, long endEpoch) - VotingKeysGenerator.generate
- Generates voting keys for the inclusive epoch range
[startEpoch, endEpoch].
- Parameters:
startEpoch- Start epoch.endEpoch- End epoch.- Returns:
- Serialized voting keys.
-