---
title: "verify(_:signature:algorithm:completion:)"
framework: localauthentication
role: symbol
role_heading: Instance Method
path: "localauthentication/lapublickey/verify(_:signature:algorithm:completion:)"
---

# verify(_:signature:algorithm:completion:)

Verifies a digital signature for the data you supply.

## Declaration

```swift
func verify(_ signedData: Data, signature: Data, algorithm: SecKeyAlgorithm, completion handler: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func verify(_ signedData: Data, signature: Data, algorithm: SecKeyAlgorithm) async throws
```

## Parameters

- `signedData`: The signed data.
- `signature`: The signature of the data.
- `algorithm`: An algorithm suitable for verifying signatures with this public key.
- `handler`: A completion handler to call when the verification operation completes.

## Discussion

Discussion important: You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration: func verify(_ signedData: Data, signature: Data, algorithm: SecKeyAlgorithm) async throws For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously.

## See Also

### Performing cryptographic operations

- [encrypt(_:algorithm:completion:)](localauthentication/lapublickey/encrypt(_:algorithm:completion:).md)
- [exportBytes(completion:)](localauthentication/lapublickey/exportbytes(completion:).md)
