verifyFromPublicKey method
Verify that this message was signed by the owner of public key in publicKey
publicKey
- Public key to be used in signature verification
sigBuffer
- Base64-encoded Compact Signature
Returns true if the signature is successfully verified using the public Key, false otherwise.
Implementation
bool verifyFromPublicKey(SVPublicKey publicKey, String sigBuffer) {
SVSignature signature = SVSignature.fromCompact(base64Decode(sigBuffer), this.magicHash());
SVPublicKey recoveredKey = signature.publicKey;
//sanity check on public key
if (recoveredKey.point != publicKey.point) {
return false;
}
return this._verify(signature);
}