<!--
{
  "availability" : [
    "macOS: 10.2.0 - 10.10.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecKeychainAttributeInfoForItemID(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecKeychainAttributeInfoForItemID"
  },
  "title" : "SecKeychainAttributeInfoForItemID(_:_:_:)"
}
-->

# SecKeychainAttributeInfoForItemID(_:_:_:)

Obtains tags for all possible attributes of a given item class.

```
func SecKeychainAttributeInfoForItemID(_ keychain: SecKeychain?, _ itemID: UInt32, _ info: UnsafeMutablePointer<UnsafeMutablePointer<SecKeychainAttributeInfo>?>) -> OSStatus
```

## Parameters

`keychain`

A keychain object.

`itemID`

The relation identifier of the item tags. An `itemID` is a `CSSM_DB_RECORDTYPE` type as defined in `cssmtype.h`.

`info`

On return, a pointer to the keychain attribute information. Your application should call the [`SecKeychainFreeAttributeInfo(_:)`](/documentation/Security/SecKeychainFreeAttributeInfo(_:)) function to release this structure when done with it.

## Return Value

A result code. See [Security Framework Result Codes](/documentation/Security/security-framework-result-codes).

## Discussion

This call returns more attributes than are supported by the old style Keychain API and passing them into older calls yields an invalid attribute error. The recommended call to retrieve the attribute values is the [`SecKeychainItemCopyAttributesAndData(_:_:_:_:_:_:)`](/documentation/Security/SecKeychainItemCopyAttributesAndData(_:_:_:_:_:_:)) function.

> Note:
> This is a CSSM-based API. CSSM is deprecated.
> 
> For new development, where possible, you should generally use ``doc://com.apple.security/documentation/Security/SecItemCopyMatching(_:_:)`` to obtain the attributes of keychain items instead, because that function is based on Core Foundation types.

---

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)