---
title: "SecKeyIsAlgorithmSupported(_:_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/seckeyisalgorithmsupported(_:_:_:)"
---

# SecKeyIsAlgorithmSupported(_:_:_:)

Returns a Boolean indicating whether a key is suitable for an operation using a certain algorithm.

## Declaration

```swift
func SecKeyIsAlgorithmSupported(_ key: SecKey, _ operation: SecKeyOperationType, _ algorithm: SecKeyAlgorithm) -> Bool
```

## Parameters

- `key`: The key whose suitability you want to test.
- `operation`: The operation that you want to perform with the key. Use one of the values from doc://com.apple.security/documentation/Security/SecKeyOperationType.
- `algorithm`: The algorithm that you want to perform with the key. Use one of the values from doc://com.apple.security/documentation/Security/SecKeyAlgorithm.

## Mentioned in

Signing and Verifying Using Keys for Encryption

## Return Value

Return Value A Boolean indicating whether the key can be used for the given operation and algorithm.
