Class VotingKeysGenerator

java.lang.Object
org.symbol.sdk.symbol.VotingKeysGenerator

public final class VotingKeysGenerator extends Object
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 Details

    • VotingKeysGenerator

      public VotingKeysGenerator(KeyPair rootKeyPair)
      Creates a generator around a voting root key pair using CryptoTypes.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.