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

# SecKeychainItemCreateCopy(_:_:_:_:)

Copies a keychain item from one keychain to another.

```
func SecKeychainItemCreateCopy(_ itemRef: SecKeychainItem, _ destKeychainRef: SecKeychain?, _ initialAccess: SecAccess?, _ itemCopy: UnsafeMutablePointer<SecKeychainItem?>) -> OSStatus
```

## Parameters

`itemRef`

A reference to the keychain item to copy.

`destKeychainRef`

A reference to the keychain in which to insert the copied keychain item. Pass `NULL` to specify the default keychain.

`initialAccess`

The initial access for the copied keychain item. Use the [`SecAccessCreate(_:_:_:)`](/documentation/Security/SecAccessCreate(_:_:_:)) function to create an access object or the [`SecKeychainItemCopyAccess(_:_:)`](/documentation/Security/SecKeychainItemCopyAccess(_:_:)) function to copy an access object from another keychain item. If you pass `NULL` for this parameter, the access defaults to the application creating the item.

`itemCopy`

On return, a pointer to a copy of the keychain item referenced by the `itemRef` parameter. You must call the `CFRelease` function to release this object when you are finished using it.

## Return Value

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

## See Also

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

Finds the next keychain item matching the given search criteria.



---

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)