ERUCES::TEKey
#include <tekey.h>
The TEKey class provides operations for creating, exporting and importing keys.
Inheritance
- Inherits ERUCES::TEAgent
Public Types
enum @244334034062313320313101340144240072205047154066
| Value | Description |
|---|---|
NATIVE | Key blob format. |
SMIME | SMIME format. |
XML | XML format. |
Public Member Functions
| Member | Description |
|---|---|
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
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.
Parameters
| Parameter | Description |
|---|---|
strHiddenLink | Output parameter. TTag (Binary Data). |
strACLTemplateName | Input 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
| Parameter | Description |
|---|---|
path | Input Parameter. Full path of a file used looking up for templated directory |
ttag | Output parameter. TTag (Binary Data). |
void getKey(void *keyData, unsigned int keyDataMaxLength, unsigned int &keyDataLength, _TESTD string &hiddenLink)
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
| Parameter | Description |
|---|---|
keyData | Output parameter for key data. |
keyDataMaxLength | Max number bytes to write to keyData. |
keyDataLength | Output parameter for actual key data length. |
hiddenLink | Output 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
| Parameter | Description |
|---|---|
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
| Parameter | Description |
|---|---|
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. |
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.
Parameters
| Parameter | Description |
|---|---|
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). |
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.
Parameters
| Parameter | Description |
|---|---|
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
| Parameter | Description |
|---|---|
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
| Parameter | Description |
|---|---|
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). |
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.
Parameters
| Parameter | Description |
|---|---|
strHiddenLink | Output parameter. TTag (Binary Data). |
strACLTemplateName | Input Parameter. Name of the template to use for creating ACL for this Key. |
Returns: KeyHandle for local operations
uint64_t getKeyHandle(_TESTD string &strHiddenLink)
The getKeyHandle method gets a key handle from the Key Service.
Parameters
| Parameter | Description |
|---|---|
strHiddenLink | Input parameter. TTag (Binary Data). |
Returns: KeyHandle for local operations
void expireKey(_TESTD string *hlArray[], unsigned int numOfLinks, bool remove)
The expireKey method expires encryption key(s).
Parameters
| Parameter | Description |
|---|---|
hlArray | : An array of TTag. |
numOfLinks | : Input param specifying number of elements in hlArray. |
remove | : Indicates instruction to remove key from database |