fromBytes static method

PublicKey fromBytes(
  1. ByteData data
)

Implementation

static PublicKey fromBytes(ByteData data) {
  final nativeData = ByteSlice.fromBytes(data);
  try {
    final pk = DartApi.native.publicKey
        .fromBytes(nativeData.addressOf)
        .extract((res) => res.asPointer<Void>());
    return PublicKey(pk, true);
  } finally {
    nativeData.dispose();
  }
}