fromPersonalSignature static method

TronPublicKey? fromPersonalSignature(
  1. List<int> messageDigest,
  2. String signature, {
  3. bool hashMessage = true,
  4. int? payloadLength,
  5. bool useEthereumPrefix = false,
})

Implementation

static TronPublicKey? fromPersonalSignature(
    List<int> messageDigest, String signature,
    {bool hashMessage = true,
    int? payloadLength,
    bool useEthereumPrefix = false}) {
  final publicKey = TronVerifier.getPublicKey(
      messageDigest, BytesUtils.fromHexString(signature),
      hashMessage: hashMessage,
      payloadLength: payloadLength,
      useEthPrefix: useEthereumPrefix);
  if (publicKey != null) {
    final pubKey =
        Secp256k1PublicKeyEcdsa.fromBytes(publicKey.point.toBytes());
    return TronPublicKey._(pubKey);
  }
  return null;
}