Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IKMIPRequest::addRegisterKeyRequest ( p6ICryptoKey pKey,
P6UINT32 pKeyFormatType,
P6KMIP_TEMPLATEATTRIBUTE  attributes,
P6KMIP_MSGEXTENSION pExtension 
)
pure virtual

Add the register batch item for an unwrapped p6ICryptoKey (i.e., not encrypted nor signed).

A successful startRequestMsg function must be called first.

Register (Section 4.3 KMIP spec), allows the KMIP client to send one of several objects to the server for storage. This call is used to send one of the following objects: {Symmetric Key, Private Key, Public Key}. This function selects a default encoding for the pKey parameter, but the caller can request to override the default (e.g., selecting "KMIP_KEYFORMAT_PKCS1" which is PKCS#1 instead of "KMIP_KEYFORMAT_TRANRSAPUBKEY" which is Transparent RSA Public Key).

Parameters
pKey[ in ] key material to be sent to a KMIP server for storage
pKeyFormatType[ in ] optional can be NULL, see Section 9.1.3.2.3 in p6kmip.h, Key Format Type Enumeration, if the caller wants to override default key encoding
attrbutes[ in ] The required attribues {Cryptographic Algorithm, Cryptographic Length, Cryptographic Usage}, and any other attributes to be associated with the new key object (e.g., Object Group)
pExtension[ in ] optional can be NULL, vendor defined extension to the operation
Returns
SuccessP6R::eOk 
FailureP6R::eNotInitializedA successful call to intialize() must be made before calling this funciton.
P6R::eTooSmallThe configured buffer size in pPool is too small to hold the generated message.
P6R::eInvalidStateA successful call to startRequestMsg() must be made before calling this function.
P6R::eNotSupportedValue for pKeyFormatType is not supported.
P6R::eWrongKeyClassValue for pKeyFormatType is not appropriate for the pKey class (e.g., for PKCS key must be asymmetric).
P6R::eRangepExtension->encodedExtension.length must be a multiple of 8, since encoded as the Vendor Extension Structure