getPublicKey function
Returns the BIP340 public key derived from privateKey
.
An ArgumentError is thrown if privateKey
is invalid.
Implementation
String getPublicKey(String privateKey) {
if (!keyIsValid(privateKey)) {
throw ArgumentError.value(privateKey, 'privateKey', 'Invalid key');
}
return schnorr.getPublicKey(privateKey);
}