isValid

Utility to simplify the act of verifying a signature. In comparison to verify 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, but this is for uses such as java.security.Signature.verify implementations.

Return

whether the signature is correct for this key.

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).

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

if this is a CompositeKey, because verification of composite key signatures is not supported.