<!--
{
  "documentType" : "article",
  "framework" : "Security",
  "identifier" : "/documentation/Security/item-class-keys-and-values",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Item class keys and values"
}
-->

# Item class keys and values

Specify the class of a keychain item.

## Discussion

Keychain items come in a variety of classes according to the kind of data they hold, such as passwords, cryptographic keys, and certificates. The item’s class dictates which attributes apply and enables the system to decide whether to encrypt the data. For example, the system encrypts passwords, but not certificates because they aren’t secret.

Use the key and one of the corresponding values listed here to specify the class for a new item you create with a call to the [`SecItemAdd(_:_:)`](/documentation/Security/SecItemAdd(_:_:)) function by placing the key/value pair in the `attributes` dictionary.

Later, use this same pair in the `query` dictionary when searching for an item with one of the [`SecItemCopyMatching(_:_:)`](/documentation/Security/SecItemCopyMatching(_:_:)), [`SecItemUpdate(_:_:)`](/documentation/Security/SecItemUpdate(_:_:)), or [`SecItemDelete(_:)`](/documentation/Security/SecItemDelete(_:)) functions.

## Topics

### Item class keys

[`kSecClass`](/documentation/Security/kSecClass)

A dictionary key whose value is the item’s class.

### Item class values

Values you use with the [`kSecClass`](/documentation/Security/kSecClass)

A dictionary key whose value is the item’s class. key.

[`kSecClassGenericPassword`](/documentation/Security/kSecClassGenericPassword)

The value that indicates a generic password item.

[`kSecClassInternetPassword`](/documentation/Security/kSecClassInternetPassword)

The value that indicates an Internet password item.

[`kSecClassCertificate`](/documentation/Security/kSecClassCertificate)

The value that indicates a certificate item.

[`kSecClassKey`](/documentation/Security/kSecClassKey)

The value that indicates a cryptographic key item.

[`kSecClassIdentity`](/documentation/Security/kSecClassIdentity)

The value that indicates an identity item.



---

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)