TransferObject

Copies an object from one Token to another.

Synopsis

CK_RV TransferObject(
CK_SESSION_HANDLE sTo,
CK_SESSION_HANDLE sFrom,
CK_OBJECT_HANDLE hObj,
CK_OBJECT_HANDLE * phObj,
CK_ATTRIBUTE_PTR pTemplate,
CK_COUNT ulCount);
Parameter Description
sTo Open session handle on destination Token
sFrom Open session handle on source Token
hObj Handle to object to transfer
phObj Reference to handle to hold new object
pTemplate Specifies new values for some attributes of the new object
ulCount Number of attributes in pTemplate

On Successful Return

*phObj — handle to newly copied object

pTemplate — can only overwrite attributes which are ordinarily writeable.

This function tries the following methods to copy the object, in order:

1.Using the CKM_ENCODE_ATTRIBUTES vendor defined key wrapping mechanism to transfer keys.

2.Reading all the attributes of the existing object and creating a new object with them.