---
title: Keychain items
framework: security
role: collectionGroup
role_heading: API Collection
path: security/keychain-items
---

# Keychain items

Embed confidential information in items that you store in a keychain.

## Overview

Overview When you want to store a secret such as a password or cryptographic key, you package it as a keychain item. Along with the data itself, you provide a set of publicly visible attributes both to control the item’s accessibility and to make it searchable. As shown in Figure 1, keychain services handles data encryption and storage (including data attributes) in a keychain, which is an encrypted database stored on disk. Later, authorized processes use keychain services to find the item and decrypt its data.

## Topics

### Essentials

- [Using the keychain to manage user secrets](security/using-the-keychain-to-manage-user-secrets.md)
- [TN3137: On Mac keychain APIs and implementations](technotes/tn3137-on-mac-keychains.md)
- [SecKeychainItem](security/seckeychainitem.md)
- [SecKeychainItemGetTypeID()](security/seckeychainitemgettypeid().md)

### Adding keychain items

- [Adding a password to the keychain](security/adding-a-password-to-the-keychain.md)
- [SecItemAdd(_:_:)](security/secitemadd(_:_:).md)
- [Item class keys and values](security/item-class-keys-and-values.md)
- [Item attribute keys and values](security/item-attribute-keys-and-values.md)

### Keychain item search

- [Searching for keychain items](security/searching-for-keychain-items.md)
- [SecItemCopyMatching(_:_:)](security/secitemcopymatching(_:_:).md)
- [Search attribute keys and values](security/search-attribute-keys-and-values.md)
- [Item return result keys](security/item-return-result-keys.md)

### Keychain item modification

- [Updating and deleting keychain items](security/updating-and-deleting-keychain-items.md)
- [SecItemUpdate(_:_:)](security/secitemupdate(_:_:).md)
- [SecItemDelete(_:)](security/secitemdelete(_:).md)

### Keychain item access

- [Sharing access to keychain items among a collection of apps](security/sharing-access-to-keychain-items-among-a-collection-of-apps.md)
- [Keychain Access Groups Entitlement](bundleresources/entitlements/keychain-access-groups.md)
- [Restricting keychain item accessibility](security/restricting-keychain-item-accessibility.md)
- [SecAccessControlCreateWithFlags(_:_:_:_:)](security/secaccesscontrolcreatewithflags(_:_:_:_:).md)
- [SecAccessControlCreateFlags](security/secaccesscontrolcreateflags.md)
- [SecAccessControl](security/secaccesscontrol.md)
- [SecAccessControlGetTypeID()](security/secaccesscontrolgettypeid().md)

### Import and export

- [SecItemImport(_:_:_:_:_:_:_:_:)](security/secitemimport(_:_:_:_:_:_:_:_:).md)
- [SecItemExport(_:_:_:_:_:)](security/secitemexport(_:_:_:_:_:).md)
- [SecExternalFormat](security/secexternalformat.md)
- [SecExternalItemType](security/secexternalitemtype.md)
- [SecItemImportExportFlags](security/secitemimportexportflags.md)
- [SecItemImportExportKeyParameters](security/secitemimportexportkeyparameters.md)
- [SecKeyImportExportFlags](security/seckeyimportexportflags.md)
- [SEC_KEY_IMPORT_EXPORT_PARAMS_VERSION](security/sec_key_import_export_params_version.md)
- [SecKeyImportExportParameters](security/seckeyimportexportparameters.md)

### Legacy keychain item creation

- [SecKeychainItemCreateFromContent(_:_:_:_:_:_:_:)](security/seckeychainitemcreatefromcontent(_:_:_:_:_:_:_:).md)
- [SecKeychainItemCreateCopy(_:_:_:_:)](security/seckeychainitemcreatecopy(_:_:_:_:).md)
- [SecKeychainItemCreatePersistentReference(_:_:)](security/seckeychainitemcreatepersistentreference(_:_:).md)
- [SecKeychainItemCopyFromPersistentReference(_:_:)](security/seckeychainitemcopyfrompersistentreference(_:_:).md)
- [SecItemClass](security/secitemclass.md)

### Legacy keychain item management

- [SecKeychainItemCopyAttributesAndData(_:_:_:_:_:_:)](security/seckeychainitemcopyattributesanddata(_:_:_:_:_:_:).md)
- [SecKeychainItemModifyAttributesAndData(_:_:_:_:)](security/seckeychainitemmodifyattributesanddata(_:_:_:_:).md)
- [SecKeychainItemFreeAttributesAndData(_:_:)](security/seckeychainitemfreeattributesanddata(_:_:).md)
- [SecKeychainItemCopyContent(_:_:_:_:_:)](security/seckeychainitemcopycontent(_:_:_:_:_:).md)
- [SecKeychainItemModifyContent(_:_:_:_:)](security/seckeychainitemmodifycontent(_:_:_:_:).md)
- [SecKeychainItemFreeContent(_:_:)](security/seckeychainitemfreecontent(_:_:).md)
- [SecKeychainItemCopyKeychain(_:_:)](security/seckeychainitemcopykeychain(_:_:).md)
- [SecKeychainItemDelete(_:)](security/seckeychainitemdelete(_:).md)
- [SecKeychainAttrType](security/seckeychainattrtype.md)
- [SecKeychainAttribute](security/seckeychainattribute.md)
- [SecKeychainAttributePtr](security/seckeychainattributeptr.md)
- [SecKeychainAttributeList](security/seckeychainattributelist.md)

### Legacy attribute info

- [SecKeychainAttributeInfoForItemID(_:_:_:)](security/seckeychainattributeinfoforitemid(_:_:_:).md)
- [SecKeychainFreeAttributeInfo(_:)](security/seckeychainfreeattributeinfo(_:).md)
- [SecKeychainAttributeInfo](security/seckeychainattributeinfo.md)
- [SecItemAttr](security/secitemattr.md)
- [Keychain Item Attribute Constants For Keys](security/keychain-item-attribute-constants-for-keys.md)
- [SecAFPServerSignature](security/secafpserversignature.md)

### Legacy password storage

- [SecKeychainAddInternetPassword(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)](security/seckeychainaddinternetpassword(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:).md)
- [SecKeychainFindInternetPassword(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)](security/seckeychainfindinternetpassword(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:).md)
- [SecKeychainAddGenericPassword(_:_:_:_:_:_:_:_:)](security/seckeychainaddgenericpassword(_:_:_:_:_:_:_:_:).md)
- [SecKeychainFindGenericPassword(_:_:_:_:_:_:_:_:)](security/seckeychainfindgenericpassword(_:_:_:_:_:_:_:_:).md)
- [SecProtocolType](security/secprotocoltype.md)
- [SecAuthenticationType](security/secauthenticationtype.md)
- [SecPassword](security/secpassword.md)
