hexToPublicKey method
Implementation
@override
PublicKey hexToPublicKey(String hex) {
if (hex.substring(0, 2) != '04') {
throw ('invalid public key hex string');
}
var byteLen = (bitSize + 7) >> 3;
if (hex.length != 2 * (1 + 2 * byteLen)) {
throw ('invalid public key hex string');
}
var x = BigInt.parse(hex.substring(2 * 1, 2 * (1 + byteLen)), radix: 16);
var y = BigInt.parse(hex.substring(2 * (1 + byteLen)), radix: 16);
var pub = PublicKey(this, x, y);
if (!isOnCurve(pub)) {
throw ('public key is not on this curve');
}
return pub;
}