MoneroPublicKey.fromBytes constructor

MoneroPublicKey.fromBytes(
  1. List<int> keyBytes
)

Factory method for creating an MoneroPublicKey from a byte array.

Implementation

factory MoneroPublicKey.fromBytes(List<int> keyBytes) {
  if (keyBytes.length ==
      Ed25519KeysConst.pubKeyByteLen + Ed25519KeysConst.pubKeyPrefix.length) {
    keyBytes = keyBytes.sublist(Ed25519KeysConst.pubKeyPrefix.length);
  }
  return MoneroPublicKey._(EDDSAPublicKey(Curves.generatorED25519, keyBytes));
}