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


func SecKeyVerifySignature(_ key: SecKey, _ algorithm: SecKeyAlgorithm, _ signedData: CFData, _ signature: CFData, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>?) -> Bool



The public key to use in evaluating the signature.


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.


The data that was signed.


The signature that was created with a call to the SecKeyCreateSignature(_:_:_:_:) function.


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.

func SecKeyCreateSignature(SecKey, SecKeyAlgorithm, CFData, UnsafeMutablePointer<Unmanaged<CFError>?>?) -> CFData?

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software