Secp256PublicKey.fromBytes constructor

Secp256PublicKey.fromBytes(
  1. Uint8List publicKey,
  2. int flag
)

Implementation

factory Secp256PublicKey.fromBytes(Uint8List publicKey, int flag) {
  final buffer = Uint8List.fromList(publicKey);
  if (buffer.length != SECP256_PUBLIC_KEY_SIZE) {
    throw ArgumentError(
      "Invalid public key input. Expected $SECP256_PUBLIC_KEY_SIZE bytes, got ${buffer.length}"
    );
  }
  return Secp256PublicKey._(decodeBigIntToUnsigned(buffer), flag);
}