<!--
{
  "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/kSecClassGenericPassword",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@kSecClassGenericPassword"
  },
  "title" : "kSecClassGenericPassword"
}
-->

# kSecClassGenericPassword

The value that indicates a generic password item.

```
let kSecClassGenericPassword: CFString
```

## Discussion

The following keychain item attributes form the composite primary key of a generic password item:

- [`kSecAttrAccessGroup`](/documentation/Security/kSecAttrAccessGroup) (on macOS, this key only applies if you set [`kSecUseDataProtectionKeychain`](/documentation/Security/kSecUseDataProtectionKeychain) or [`kSecAttrSynchronizable`](/documentation/Security/kSecAttrSynchronizable) to <doc://com.apple.documentation/documentation/Swift/true>)
- [`kSecAttrAccount`](/documentation/Security/kSecAttrAccount)
- [`kSecAttrService`](/documentation/Security/kSecAttrService)
- [`kSecAttrSynchronizable`](/documentation/Security/kSecAttrSynchronizable)

Calls to [`SecItemAdd(_:_:)`](/documentation/Security/SecItemAdd(_:_:)) that add a generic password item with the same values for all of these attributes as an existing item result in [`errSecDuplicateItem`](/documentation/Security/errSecDuplicateItem).

The following keychain item attributes apply to a generic password item, and don’t form part of its composite primary key:

- [`kSecAttrAccess`](/documentation/Security/kSecAttrAccess) (macOS only)
- [`kSecAttrAccessControl`](/documentation/Security/kSecAttrAccessControl)
- [`kSecAttrAccessible`](/documentation/Security/kSecAttrAccessible) (on macOS, this key only applies if you set [`kSecUseDataProtectionKeychain`](/documentation/Security/kSecUseDataProtectionKeychain) or [`kSecAttrSynchronizable`](/documentation/Security/kSecAttrSynchronizable) to <doc://com.apple.documentation/documentation/Swift/true>)
- [`kSecAttrCreationDate`](/documentation/Security/kSecAttrCreationDate)
- [`kSecAttrModificationDate`](/documentation/Security/kSecAttrModificationDate)
- [`kSecAttrDescription`](/documentation/Security/kSecAttrDescription)
- [`kSecAttrComment`](/documentation/Security/kSecAttrComment)
- [`kSecAttrCreator`](/documentation/Security/kSecAttrCreator)
- [`kSecAttrType`](/documentation/Security/kSecAttrType)
- [`kSecAttrLabel`](/documentation/Security/kSecAttrLabel)
- [`kSecAttrIsInvisible`](/documentation/Security/kSecAttrIsInvisible)
- [`kSecAttrIsNegative`](/documentation/Security/kSecAttrIsNegative)
- [`kSecAttrGeneric`](/documentation/Security/kSecAttrGeneric)

---

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)