getPrincipalFromECPublicKey function

String getPrincipalFromECPublicKey(
  1. Uint8List publicKey
)

Implementation

String getPrincipalFromECPublicKey(Uint8List publicKey) {
  final secp256k1Pub = Secp256k1PublicKey.fromRaw(publicKey).toDer();
  final auth = Principal.selfAuthenticating(secp256k1Pub);
  return auth.toText();
}