Returns a Boolean indicating whether a key is suitable for an operation using a certain algorithm.
SDKs
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10.0+
- watchOS 3.0+
Framework
- Security
Declaration
func SecKeyIsAlgorithmSupported(_ key: Sec Key, _ operation: Sec Key Operation Type, _ algorithm: Sec Key Algorithm) -> 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
Sec
.Key Operation Type algorithm
The algorithm that you want to perform with the key. Use one of the values from
Sec
.Key Algorithm
Return Value
A Boolean indicating whether the key can be used for the given operation and algorithm.