Ed25519Blake2bPublicKey.fromBytes constructor

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

Factory constructor to create an Ed25519Blake2bPublicKey from raw key bytes.

Implementation

factory Ed25519Blake2bPublicKey.fromBytes(List<int> keyBytes) {
  if (keyBytes.length ==
          Ed25519KeysConst.pubKeyByteLen +
              Ed25519KeysConst.pubKeyPrefix.length &&
      keyBytes[0] == Ed25519KeysConst.pubKeyPrefix[0]) {
    keyBytes = keyBytes.sublist(1);
  }
  return Ed25519Blake2bPublicKey._(
      EDDSAPublicKey(Curves.generatorED25519, keyBytes));
}