<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/kSecAttrKeyClass",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@kSecAttrKeyClass"
  },
  "title" : "kSecAttrKeyClass"
}
-->

# kSecAttrKeyClass

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

```
let kSecAttrKeyClass: CFString
```

## Discussion

The corresponding value is of type <doc://com.apple.documentation/documentation/CoreFoundation/CFTypeRef> and specifies a type of cryptographic key. Possible values are listed in [Key Class Values](/documentation/Security/item-attribute-keys-and-values#Key-Class-Values). Read only.

> Note:
> Don’t confuse this attribute with the more general ``doc://com.apple.security/documentation/Security/kSecClass`` attribute that indicates an item’s class (for example password, certificate, or cryptographic key). The ``doc://com.apple.security/documentation/Security/kSecAttrKeyClass`` attribute described here applies only to items of class ``doc://com.apple.security/documentation/Security/kSecClassKey``, indicating what category a cryptographic key fits into (for example, public, private, or symmetric).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)