verify

Utility to simplify the act of verifying a signature.

Throws

if the key to verify the signature with is not valid (i.e. wrong key type for the signature).

if the signature is invalid (i.e. damaged), or does not match the key (incorrect).

if the signature scheme is not supported or if any of the clear or signature data is empty.


fun PublicKey.verify(signatureData: ByteArray, clearData: ByteArray): Boolean

Helper function to verify a signature.

Parameters

signatureData

the signature on a message.

clearData

the clear data/message that was signed (usually the Merkle root).

Throws

if the key is invalid.

if this signatureData object is not initialized properly, the passed-in signatureData is improperly encoded or of the wrong type, if this signatureData algorithm is unable to process the input data provided, etc.

if the signature scheme is not supported for this private key or if any of the clear or signature data is empty.


fun KeyPair.verify(signatureData: ByteArray, clearData: ByteArray): Boolean

Helper function for the signers to verify their own signature.

Parameters

signatureData

the signature on a message.

clearData

the clear data/message that was signed (usually the Merkle root).

Throws

if the key is invalid.

if this signatureData object is not initialized properly, the passed-in signatureData is improperly encoded or of the wrong type, if this signatureData algorithm is unable to process the input data provided, etc.

if the signature scheme is not supported for this private key or if any of the clear or signature data is empty.