fromSeckeySync method

Ed25519Keypair fromSeckeySync(
  1. Uint8List seckey
)

Creates a keypair from a seckey byte array.

This method should only be used to recreate a keypair from a previously generated seckey. Generating keypairs from a random seed should be done using the fromSeedSync method.

Throws an AssertionError if the seckey is invalid.

Implementation

Ed25519Keypair fromSeckeySync(final Uint8List seckey) {
  check(
    seckey.length == seckeyLength,
    'Invalid secret key length ${seckey.length}.',
  );
  final Uint8List pubkey = seckey.sublist(seckey.length - pubkeyLength);
  return Ed25519Keypair(pubkey: pubkey, seckey: seckey);
}