fromEd25519PublicKey static method

AuthenticationKey fromEd25519PublicKey(
  1. Ed25519PublicKey publicKey
)

Implementation

static AuthenticationKey fromEd25519PublicKey(Ed25519PublicKey publicKey) {
  final pubKeyBytes = publicKey.value;

  final bytes = Uint8List(pubKeyBytes.length + 1);
  bytes.setAll(0, pubKeyBytes);
  bytes.setAll(pubKeyBytes.length, [AuthenticationKey.ED25519_SCHEME]);

  final sha3Hash = SHA3Digest(256);
  return AuthenticationKey(sha3Hash.process(bytes));
}