Function

SecKeyVerifySignature

Verifies the cryptographic signature of a block of data using a public key and specified algorithm.

Declaration

Boolean SecKeyVerifySignature(SecKeyRef key, SecKeyAlgorithm algorithm, CFDataRef signedData, CFDataRef signature, CFErrorRef  _Nullable *error);

Parameters

key

The public key to use in evaluating the signature.

algorithm

The algorithm that was used to create the signature. Use one of the signing algorithms listed in SecKeyAlgorithm. You can use the SecKeyIsAlgorithmSupported function to test that the key is suitable for the algorithm.

signedData

The data that was signed.

signature

The signature that was created with a call to the SecKeyCreateSignature function.

error

The address of a CFError object. If an error occurs, this is set to point at an error instance that describes the failure.

Return Value

A Boolean indicating whether or not the data and signature are intact.

See Also

Digital Signatures

Signing and Verifying

Create and evaluate digital signatures to establish the validity of code or data.

SecKeyCreateSignature

Creates the cryptographic signature for a block of data using a private key and specified algorithm.