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

# kSecClassIdentity

The value that indicates an identity item.

```
let kSecClassIdentity: CFString
```

## Discussion

An identity is a certificate paired with its associated private key. Keychain services stores the certificate and the private key separately; it represents the pair as an identity if the certificate’s [`kSecAttrPublicKeyHash`](/documentation/Security/kSecAttrPublicKeyHash) attribute matches the key’s [`kSecAttrApplicationLabel`](/documentation/Security/kSecAttrApplicationLabel) attribute.

Because an identity is the combination of a private key and a certificate, this class shares attributes of both [`kSecClassKey`](/documentation/Security/kSecClassKey) and [`kSecClassCertificate`](/documentation/Security/kSecClassCertificate). Multiple certificates can all attest the identity of the same private key, so the attributes that form an identity’s composite primary key are the same as those for a certificate.

The set of identity items available to your app in the keychain can change without explicitly adding, updating, or deleting identity items. For example, if the keychain contains a cryptographic key item and certificate item that form an identity and you delete the key, the identity no longer exists.

---

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)