Skip to main content

ERUCES::TEKey

#include <tekey.h>

The TEKey class provides operations for creating, exporting and importing keys.

Inheritance

Public Types

enum @244334034062313320313101340144240072205047154066

ValueDescription
NATIVEKey blob format.
SMIMESMIME format.
XMLXML format.

Public Member Functions

MemberDescription
void createKey(_TESTD string &strHiddenLink, const _TESTD string &strACLTemplateName)The createKey method creates a new key on the server and creates an ACL based on the name of the template. If the name of the template is not provided then default ACL is created.
void createKey4File(const _TESTD string &path, _TESTD string &ttag)The createKey4File method creates a new key on the server and creates ACL based on the name of a file path. If the name of the file path is not provided then default ACL is created.
void getKey(void *keyData, unsigned int keyDataMaxLength, unsigned int &keyDataLength, _TESTD string &hiddenLink)The getKey method retrieves a key.
void exportKey(unsigned int certSystemId, unsigned int certPrincipalId, KeyPair keyArray[], unsigned int numOfPairs)The exportKey method exports key and uses the Key Service export blob specification. The user provides certificate id of the recipient, TTag and gets the export blob back.
void exportKey(_TESTD string &trustedServerName, KeyPair keyArray[], unsigned int numOfPairs)The exportKey method exports a key and uses the Key Service export blob specification. The user provides certificate id of the recipient, TTag and gets the export blob back.
void exportKeyFormatted(unsigned int certSystemId, unsigned int certPrincipalId, _TESTD string *hlArray[], unsigned int numOfLinks, _TESTD string &keyBlob, unsigned int formatType)The exportKeyFormatted method exports key using SMIME and XML export specification. The user provides certificate id of the recipient, TTag and gets the export blob back.
void exportKeyFormatted(_TESTD string &trustedServerName, _TESTD string *hlArray[], unsigned int numOfLinks, _TESTD string &keyBlob, unsigned int formatType)The exportKeyFormatted method exports key using SMIME and XML export specification. The user provides certificate id of the recipient, TTag and gets the export blob back.
void importKey(KeyPair keyArray[], unsigned int numOfPairs)The importKey method imports key exported by the Key Service using the TE format.
void importKeyFormatted(const _TESTD string &keyBlob, unsigned int formatType)The importKeyFormatted method imports keys exported by the Key Service using the TE format.
uint64_t createKeyHandle(_TESTD string &strHiddenLink, const _TESTD string &strACLTemplateName)The createKeyHandle method creates a new key on the server and creates an ACL based on the name of the template. If the name of the template is not provided then default ACL is created.
uint64_t getKeyHandle(_TESTD string &strHiddenLink)The getKeyHandle method gets a key handle from the Key Service.
void expireKey(_TESTD string *hlArray[], unsigned int numOfLinks, bool remove)The expireKey method expires encryption key(s).

Member Function Documentation

The createKey method creates a new key on the server and creates an ACL based on the name of the template. If the name of the template is not provided then default ACL is created.

Parameters

ParameterDescription
strHiddenLinkOutput parameter. TTag (Binary Data).
strACLTemplateNameInput Parameter. Name of the template to use for creating ACL for this Key.

void createKey4File(const _TESTD string &path, _TESTD string &ttag)

The createKey4File method creates a new key on the server and creates ACL based on the name of a file path. If the name of the file path is not provided then default ACL is created.

Parameters

ParameterDescription
pathInput Parameter. Full path of a file used looking up for templated directory
ttagOutput parameter. TTag (Binary Data).

The getKey method retrieves a key.

When the TTag is empty, a key is generated and the TTag is provided. If the caller provides a TTag, it is used to retrieve the keyData. THIS FUNCTION HAS BEEN DEPRECATED. USE CREATE KEY INSTEAD.

DeprecatedUse createKey instead.

Parameters

ParameterDescription
keyDataOutput parameter for key data.
keyDataMaxLengthMax number bytes to write to keyData.
keyDataLengthOutput parameter for actual key data length.
hiddenLinkOutput parameter for TTag.

void exportKey(unsigned int certSystemId, unsigned int certPrincipalId, KeyPair keyArray[], unsigned int numOfPairs)

The exportKey method exports key and uses the Key Service export blob specification. The user provides certificate id of the recipient, TTag and gets the export blob back.

Parameters

ParameterDescription
certSystemId: Certificate User (recipient) system Id.
certPrincipalId: Certificate User (recipient) principal Id.
keyArray: Contains TTag and empty blob(export key blob) pairs.
numOfPairs: Input param specifying number of elements in keyArray.

void exportKey(_TESTD string &trustedServerName, KeyPair keyArray[], unsigned int numOfPairs)

The exportKey method exports a key and uses the Key Service export blob specification. The user provides certificate id of the recipient, TTag and gets the export blob back.

Parameters

ParameterDescription
trustedServerName: Name of the recipient server.
keyArray: Contains TTag and empty blob(export key blob) pairs.
numOfPairs: Input param specifying number of elements in keyArray.

The exportKeyFormatted method exports key using SMIME and XML export specification. The user provides certificate id of the recipient, TTag and gets the export blob back.

Parameters

ParameterDescription
certSystemId: Certificate User (recipient) system Id.
certPrincipalId: Certificate User (recipient) principal Id.
hlArray: Contains TTag.
numOfLinks: Input param specifying number of elements in hlArray.
keyBlob: Output param which will contain the keyblob.
formatType: Input param specifying which type of export format to use e.g. TEKey::NATIVE (0) or TEKey::SMIME (1), TEKey::XML (2).

The exportKeyFormatted method exports key using SMIME and XML export specification. The user provides certificate id of the recipient, TTag and gets the export blob back.

Parameters

ParameterDescription
trustedServerName: Name of the recipient server.
hlArray: An array containing TTag.
numOfLinks: Input param specifying number of elements in hlArray.
keyBlob: Output param which will contain the keyblob.
formatType: Input param specifying which type of export spec to use e.g. TEKey::NATIVE (0) or TEKey::SMIME (1), TEKey::XML (2).

void importKey(KeyPair keyArray[], unsigned int numOfPairs)

The importKey method imports key exported by the Key Service using the TE format.

Parameters

ParameterDescription
keyArray: Contains TTag and exported key blob pairs.
numOfPairs: Input param specifying number of elements in keyArray.

void importKeyFormatted(const _TESTD string &keyBlob, unsigned int formatType)

The importKeyFormatted method imports keys exported by the Key Service using the TE format.

Parameters

ParameterDescription
keyBlob: Contains exported key blob
formatType: Input param specifying the type of export spec to use e.g. TEKey::NATIVE (0) or TEKey::SMIME (1), TEKey::XML (2).

The createKeyHandle method creates a new key on the server and creates an ACL based on the name of the template. If the name of the template is not provided then default ACL is created.

Parameters

ParameterDescription
strHiddenLinkOutput parameter. TTag (Binary Data).
strACLTemplateNameInput Parameter. Name of the template to use for creating ACL for this Key.

Returns: KeyHandle for local operations

The getKeyHandle method gets a key handle from the Key Service.

Parameters

ParameterDescription
strHiddenLinkInput parameter. TTag (Binary Data).

Returns: KeyHandle for local operations

The expireKey method expires encryption key(s).

Parameters

ParameterDescription
hlArray: An array of TTag.
numOfLinks: Input param specifying number of elements in hlArray.
remove: Indicates instruction to remove key from database