isValid

fun isValid(txId: SecureHash, transactionSignature: TransactionSignature): Boolean

Utility to simplify the act of verifying a digital signature by identifying the signature scheme used from the input public key's type. It returns true if it succeeds and false if not. In comparison to doVerify if the key and signature do not match it returns false rather than throwing an exception. Normally you should use the function which throws, as it avoids the risk of failing to test the result.

Parameters

txId

transaction's id.

transactionSignature

the signature on the transaction.

Throws

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


fun isValid(publicKey: PublicKey, signatureData: ByteArray, clearData: ByteArray): Boolean

Utility to simplify the act of verifying a digital signature by identifying the signature scheme used from the input public key's type. It returns true if it succeeds and false if not. In comparison to doVerify if the key and signature do not match it returns false rather than throwing an exception. Normally you should use the function which throws, as it avoids the risk of failing to test the result. Use this method if the signature scheme is not a-priori known.

Return

true if verification passes or false if verification fails.

Parameters

publicKey

the signer's PublicKey.

signatureData

the signatureData on a message.

clearData

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

Throws

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


fun isValid(signatureScheme: SignatureScheme, publicKey: PublicKey, signatureData: ByteArray, clearData: ByteArray): Boolean

Method to verify a digital signature. In comparison to doVerify if the key and signature do not match it returns false rather than throwing an exception. Use this method if the signature scheme type is a-priori unknown.

Return

true if verification passes or false if verification fails.

Parameters

signatureScheme

a SignatureScheme object, retrieved from supported signature schemes, see Crypto.

publicKey

the signer's PublicKey.

signatureData

the signatureData on a message.

clearData

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

Throws

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

if the requested signature scheme is not supported.