---
title: kSecClassCertificate
framework: security
role: symbol
role_heading: Global Variable
path: security/ksecclasscertificate
---

# kSecClassCertificate

The value that indicates a certificate item.

## Declaration

```swift
let kSecClassCertificate: CFString
```

## Mentioned in

Storing a Certificate in the Keychain Storing an Identity in the Keychain

## Discussion

Discussion The following keychain item attributes form the composite primary key of a certificate password item: kSecAttrAccessGroup (on macOS, this key only applies if you set kSecUseDataProtectionKeychain or kSecAttrSynchronizable to true) kSecAttrCertificateType kSecAttrIssuer kSecAttrSerialNumber kSecAttrSynchronizable (on iOS 14 and newer, iOS 11 newer, and watchOS 7 and newer) Calls to SecItemAdd(_:_:) that add a certificate item with the same values for all of these attributes as an existing item result in errSecDuplicateItem. The following keychain item attributes apply to a certificate item, and don’t form part of its composite primary key: kSecAttrAccess (macOS only) kSecAttrAccessible (on macOS, this key only applies if you set kSecUseDataProtectionKeychain or kSecAttrSynchronizable to true) kSecAttrCertificateEncoding kSecAttrLabel kSecAttrSubject kSecAttrSubjectKeyID kSecAttrPublicKeyHash
