verify_signature
(alias) function verify_signature(data_hash: byte_array, pubkey: byte_array, signature: byte_array): boolean
Verify a signature against a message and public key.
More precisely, verify that signature was obtained with a procedure equivalent to get_signature(data_hash, privkey), where privkey and pubkey form a keypair.
Accepts valid public keys of size 33 or 65 bytes. Note that not all byte arrays of acceptable length constitute valid public keys.
Alias
Alias target
Return
true if the signature is valid, indicating that the message was indeed signed by the private key belonging to the keypair of the given public key; false otherwise
Since
0.10.6
Parameters
data_hash
the original (unsigned) 32-byte array
pubkey
the public key (33, 64 or 65 bytes)
signature
the 64-byte signature to verify
Throws
exception
when:
data_hashdoes not have length32signaturedoes not have length64pubkeydoes not have length33or65pubkeyis not a valid public key