---
title: kSecAttrKeyClass
framework: security
role: symbol
role_heading: Global Variable
path: security/ksecattrkeyclass
---

# kSecAttrKeyClass

A key whose value indicates the item’s cryptographic key class.

## Declaration

```swift
let kSecAttrKeyClass: CFString
```

## Discussion

Discussion The corresponding value is of type CFTypeRef and specifies a type of cryptographic key. Possible values are listed in Key Class Values. Read only. note: Don’t confuse this attribute with the more general kSecClass attribute that indicates an item’s class (for example password, certificate, or cryptographic key). The kSecAttrKeyClass attribute described here applies only to items of class kSecClassKey, indicating what category a cryptographic key fits into (for example, public, private, or symmetric).
