corda / net.corda.core.crypto / Crypto / doVerify

# doVerify

`fun doVerify(schemeCodeName: String, publicKey: PublicKey, signatureData: ByteArray, clearData: ByteArray): Boolean`

Utility to simplify the act of verifying a digital signature. It returns true if it succeeds, but it always throws an exception 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).

### Exceptions

`InvalidKeyException` - if the key is invalid.

`SignatureException` - 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.

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

Return
true if verification passes or throws an exception if verification fails.

`fun doVerify(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, but it always throws an exception if verification fails. Strategy on identifying the actual signing scheme is based on the PublicKey type, but if the schemeCodeName is known, then better use doVerify(schemeCodeName: String, publicKey: PublicKey, signatureData: ByteArray, clearData: ByteArray).

### Parameters

`publicKey` - the signer's PublicKey.

`signatureData` - the signatureData on a message.

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

### Exceptions

`InvalidKeyException` - if the key is invalid.

`SignatureException` - 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.

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

Return
true if verification passes or throws an exception if verification fails.

`fun doVerify(publicKey: PublicKey, transactionSignature: TransactionSignature): Boolean`

Utility to simplify the act of verifying a TransactionSignature. It returns true if it succeeds, but it always throws an exception if verification fails.

### Parameters

`publicKey` - the signer's PublicKey.

`transactionSignature` - the signatureData on a message.

### Exceptions

`InvalidKeyException` - if the key is invalid.

`SignatureException` - 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.

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

Return
true if verification passes or throws an exception if verification fails.