getECkeyFromPrivateKey function

Future<ECKeys> getECkeyFromPrivateKey(
  1. Uint8List prv
)

Implementation

Future<ECKeys> getECkeyFromPrivateKey(Uint8List prv) async {
  final kp = await secp256K1FromSeed(
    req: Secp256k1FromSeedReq(seed: prv),
  );
  final kpSchnorr = await schnorrFromSeed(
    req: SchnorrFromSeedReq(seed: prv),
  );
  final kpP256 = await p256FromSeed(
    req: P256FromSeedReq(seed: prv),
  );

  return ECKeys(
    ecPrivateKey: prv,
    ecPublicKey: Secp256k1PublicKey.fromDer(kp.derEncodedPublicKey).toRaw(),
    ecSchnorrPublicKey:
        Secp256k1PublicKey.fromRaw(kpSchnorr.publicKeyHash).toRaw(),
    ecP256PublicKey: P256PublicKey.fromDer(kpP256.derEncodedPublicKey).toRaw(),
  );
}