Function

SecKeychainItemCreateCopy

Copies a keychain item from one keychain to another.

Declaration

OSStatus SecKeychainItemCreateCopy(SecKeychainItemRef itemRef, SecKeychainRef destKeychainRef, SecAccessRef initialAccess, SecKeychainItemRef  _Nullable *itemCopy);

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 function to create an access object or the 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

See Also

Legacy Keychain Item Creation

SecKeychainItemCreateFromContent

Creates a new keychain item from the supplied parameters.

SecKeychainItemCreatePersistentReference

Creates a persistent reference for a keychain item.

SecKeychainItemCopyFromPersistentReference

Provides a keychain item reference, given a persistent reference.

SecItemClass

Specifies a keychain item’s class code.