---
title: "SecKeyVerifySignature(_:_:_:_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/seckeyverifysignature(_:_:_:_:_:)"
---

# SecKeyVerifySignature(_:_:_:_:_:)

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

## Declaration

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

## 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 doc://com.apple.security/documentation/Security/SecKeyAlgorithm. You can use the doc://com.apple.security/documentation/Security/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 doc://com.apple.security/documentation/Security/SecKeyCreateSignature(_:_:_:_:) function.
- `error`: The address of a doc://com.apple.documentation/documentation/CoreFoundation/CFError object. If an error occurs, this is set to point at an error instance that describes the failure.

## Mentioned in

Signing and Verifying

## Return Value

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