15 Oracle Key Vault Client SDK Utility APIs
You can use the Oracle Key Vault client SDK utility APIs with other Oracle Key Vault functions to simplify common operations.
The element and attribute index used in the Oracle Key Vault utility functions have the same meaning as described in section Attribute Index and Element Index.
- About the Oracle Key Vault Client SDK Utility APIs
You can use the Oracle Key Vault SDK utility APIs with other Oracle Key Vault APIs to simplify commonly used operations. - okvAttrExtractTTLV
okvAttrExtractTTLV
converts the attributes that are child OKVTTLV objects of the specified OKVTTLV parent object intoOKVAttr
. - okvAttrMakeTTLV
okvAttrMakeTTLV
converts theOKVAttr
into an OKVTTLV structure. - okvCryptoContextCreate
okvCryptoContextCreate
creates the cryptographic context required for encryption and decryption operation. - okvCryptoContextFree
okvCryptoContextFree
frees the memory allocated to cryptographic context structure. - okvCryptoContextGetAuthEncryptionAdditionalData
okvCryptoContextGetAuthEncryptionAdditionalData
gets the authenticated encryption additional data parameter value from cryptographic context structure. - okvCryptoContextGetAuthEncryptionTag
okvCryptoContextGetAuthEncryptionTag
gets the authenticated encryption tag parameter value from cryptographic context structure. - okvCryptoContextGetBlockCipherMode
okvCryptoContextGetBlockCipherMode
gets the block cipher mode parameter value from cryptographic context structure. - okvCryptoContextGetIV
okvCryptoContextGetIV
gets the IV parameter value from cryptographic context structure. - okvCryptoContextGetPadding
okvCryptoContextGetPadding
gets the padding parameter value from cryptographic context structure. - okvCryptoContextGetRandomIV
okvCryptoContextGetRandomIV
gets the random IV parameter value from cryptographic context structure. - okvCryptoContextSetAuthEncryptionAdditionalData
okvCryptoContextSetAuthEncryptionAdditionalData
sets the authenticated encryption additional data parameter value in the cryptographic context structure. - okvCryptoContextSetAuthEncryptionTag
okvCryptoContextSetAuthEncryptionTag
sets the authenticated encryption tag parameter value in the cryptographic context structure. - okvCryptoContextSetBlockCipherMode
okvCryptoContextSetBlockCipherMode
sets the block cipher mode parameter value in the cryptographic context structure. - okvCryptoContextSetIV
okvCryptoContextSetIV
sets the IV parameter value in the cryptographic context structure. - okvCryptoContextSetPadding
okvCryptoContextSetPadding
sets the padding parameter value in the cryptographic context structure. - okvCryptoContextSetRandomIV
okvCryptoContextSetRandomIV
sets the random IV parameter value in the cryptographic context structure. - okvCryptoResponseGetAuthEncryptionTag
okvCryptoResponseGetAuthEncryptionTag
gets the authenticated encryption tag value from encrypt response structure. - okvCryptoResponseGetDecryptedData
okvCryptoResponseGetDecryptedData
gets the decrypted data value from decrypt response structure. - okvCryptoResponseGetEncryptedData
okvCryptoResponseGetEncryptedData
gets the encrypted data value from encrypt response structure. - okvCryptoResponseGetIV
okvCryptoResponseGetIV
gets the IV value from encrypt response structure used by server for encryption, if the random IV was set and IV was not provided in the request. - okvDecryptResponseCreate
okvDecryptResponseCreate
creates the decrypt response structure to hold the decrypt operation response details. - okvDecryptResponseFree
okvDecryptResponseFree
frees the memory allocated to decrypt response structure. - okvEncryptResponseCreate
okvEncryptResponseCreate
creates the encrypt response structure to hold the encrypt operation response details. - okvEncryptResponseFree
okvEncryptResponseFree
frees the memory allocated to encrypt response structure. - okvGetTextForAttributeNum
okvGetTextForAttributeNum
returns the attribute name for a given Oracle Key Vault attribute number. - okvGetTextForTag
okvGetTextForTag
returns the name of the valid KMIP tag. - okvGetTextForTagEnum
okvGetTextForTagEnum
returns the name of the enumerated value for a valid KMIP tag ofENUMERATION
type. - okvGetTextForTagType
okvGetTextForTagType
returns the name of the valid KMIP type. - okvGetTextLenForAttributeNum
okvGetTextLenForAttributeNum
returns the length of the name of the attribute for a given Oracle Key Vault attribute number. - okvObjGetAttrNo
okvObjGetAttrNo
will return the Oracle Key Vault attribute number for a given TTLV object.
Parent topic: Oracle Key Vault Client C SDK API Reference
15.1 About the Oracle Key Vault Client SDK Utility APIs
You can use the Oracle Key Vault SDK utility APIs with other Oracle Key Vault APIs to simplify commonly used operations.
The client SDK utility API element and attribute indexes have the same structure as the Oracle Key Vault KMIP attribute APIs.
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.2 okvAttrExtractTTLV
okvAttrExtractTTLV
converts the attributes that are child
OKVTTLV objects of the specified OKVTTLV parent object
into OKVAttr
.
Category
KMIP utility API
Purpose
okvAttrExtractTTLV
will convert the attributes that are child
OKVTTLV objects of the specified OKVTTLV parent
object into OKVAttr
.
Syntax
OKVErrNo okvAttrExtractTTLV(OKVEnv *env, OKVTTLV *attr_ttlv, OKVAttr *attr_col);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
IN |
Oracle Key Vault environment handle. |
attr_ttlv |
IN |
TTLV parent object containing attributes. |
attr_col |
OUT |
Collection of attributes. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: Failure: A valid error number is returned for the error on top of the error stack. |
Comments
None.
Example
OKVAttr attr_struct; ub4 index = 0; memset((void *)&attr_struct, 0, sizeof(attr_struct)); ... okvAttrExtractTTLV(env, ttlv, &attr_struct); printf("\nAttributes Extracted:"); printf("\nName: %s ", attr_struct.name[index].name); printf("\nName Length: %d ", attr_struct.name[index].namel); /* Null terminate the unique identifier */ attr_struct.unique_identifier.id[attr_struct.unique_identifier.idl] = 0; printf("\nUnique ID: %s ", attr_struct.unique_identifier.id); printf("\nUnique ID Length: %d ", attr_struct.unique_identifier.idl); printf("\nCryptographic Algorithm: %d ", attr_struct.crypto_algorithm);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.3 okvAttrMakeTTLV
okvAttrMakeTTLV
converts the OKVAttr
into
an OKVTTLV structure.
Category
KMIP utility API
Purpose
okvAttrMakeTTLV
will convert the OKVAttr
into an
OKVTTLV structure and all the new attributes in
the OKVTTLV will be collected under the specified
OKVTTLV parent object.
Syntax
OKVErrNo okvAttrMakeTTLV(OKVEnv *env, OKVAttr *attr_col OKVTTLV *attr_ttlv);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
IN |
Oracle Key Vault environment handle. |
attr_col |
IN |
Collection of attributes. |
attr_ttlv |
OUT |
TTLV parent object containing attributes. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: Failure: A valid error number is returned for the error on top of the error stack. |
Comments
For multi-instance attributes, the count of the attribute must be set. For example,
name
is a multi-instance
attribute. Hence, if name
is
being added, name_count
must also
be specified.
Example
OKVTTLV *ttlv = (OKVTTLV *)NULL; OKVOps *ops; OKVAttr attrs; memset((void *)&attrs, 0, sizeof(attrs)); ... /* Adding name attribute to the structure */ ub4 index = 0; attrs.name_count = 1; attrs.name[index].name = "attr_name"; attrs.name[index].namel = strlen(attrs.name[index].name); attrs.name[index].type = 1; /* Adding cryptographic algo attribute to the structure */ attrs.crypto_algorithm = CRYPTO_ALG_AES; /* Adding unique identifier attribute to the structure */ attrs.unique_identifier.id = uid; attrs.unique_identifier.idl = strlen(attrs.unique_identifier.id); ops = okvOpsCreate(env, OKVOpAddAttribute); ttlv = okvTTLVGetRequest(env, ops); /* Convert OKVAttr structure to TTLV Attributes Object */ okvAttrMakeTTLV(env, &attrs, ttlv);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.4 okvCryptoContextCreate
okvCryptoContextCreate
creates the cryptographic context
required for encryption and decryption operation.
Catetory
KMIP utility API
Purpose
okvCryptoContextCreate
creates the cryptographic
context required for encryption and decryption operation.
Syntax
OKVCryptoContext *okvCryptoContextCreate(OKVEnv *env, OKVOpsNo operation);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
operation |
|
KMIP operation. |
Return Values
Return Value | Description |
---|---|
OKVCryptoContext * |
Pointer to OKVCryptoContext object. Success: Pointer to OKVCryptoContext object. Failure: NULL pointer. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
OKVCryptoContext *crypto_context = okvCryptoContextCreate(env, OKVOpEncrypt);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.5 okvCryptoContextFree
okvCryptoContextFree
frees the memory allocated to
cryptographic context structure.
Catetory
KMIP utility API
Purpose
okvCryptoContextFree
frees the memory allocated to
cryptographic context structure.
Syntax
void okvCryptoContextFree(OKVEnv *env, OKVCryptoContext** crypto_context);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
crypto_context |
|
Cryptographic context contains required parameters for encryption/decryption like cryptographic parameters and IV. |
Return Values
No values returned.
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
OKVCryptoContext *crypto_context = okvCryptoContextCreate(env, OKVOpEncrypt); ... okvCryptoContextFree(env, &crypto_context);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.6 okvCryptoContextGetAuthEncryptionAdditionalData
okvCryptoContextGetAuthEncryptionAdditionalData
gets the
authenticated encryption additional data parameter value from cryptographic context
structure.
Catetory
KMIP utility API
Purpose
okvCryptoContextGetAuthEncryptionAdditionalData
gets
the Authenticated encryption additional data parameter value from cryptographic
context structure.
Syntax
OKVErrNo okvCryptoContextGetAuthEncryptionAdditionalData(OKVEnv *env, OKVCryptoContext *crypto_context, ub1 *auth_encryption_additional_data, ub4 *auth_encryption_additional_datal);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
crypto_context |
|
Cryptographic context contains required parameters for encryption/decryption like cryptographic parameters and IV. |
auth_encryption_additional_data |
|
Authenticated encryption additional data value. |
auth_encryption_additional_datal |
|
Authenticated encryption additional data value length. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
ub1 *auth_enc_addl_data = (ub1 *)NULL; ub4 auth_enc_addl_datal = 0; okvCryptoContextGetAuthEncryptionAdditionalData (env, crypto_context, auth_enc_addl_data, &auth_enc_addl_datal);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.7 okvCryptoContextGetAuthEncryptionTag
okvCryptoContextGetAuthEncryptionTag
gets the
authenticated encryption tag parameter value from cryptographic context
structure.
Catetory
KMIP utility API
Purpose
okvCryptoContextGetAuthEncryptionTag
gets the
Authenticated encryption tag parameter value from cryptographic context
structure.
Syntax
OKVErrNo okvCryptoContextGetAuthEncryptionTag(OKVEnv *env, OKVCryptoContext *crypto_context, ub1 *auth_encryption_tag, ub4 *auth_encryption_tagl);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
crypto_context |
|
Cryptographic context contains required parameters for encryption/decryption like cryptographic parameters and IV. |
auth_encryption_tag |
|
Authenticated encryption tag value. |
auth_encryption_tagl |
|
Authenticated encryption tag value length. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
ub1 *auth_enc_tag = (ub1 *)NULL; ub4 auth_enc_tagl = 0; okvCryptoContextGetAuthEncryptionTag(env, crypto_context, auth_enc_tag, &auth_enc_tagl);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.8 okvCryptoContextGetBlockCipherMode
okvCryptoContextGetBlockCipherMode
gets the block cipher
mode parameter value from cryptographic context structure.
Catetory
KMIP utility API
Purpose
okvCryptoContextGetBlockCipherMode
gets the block
cipher mode parameter value from cryptographic context structure.
Syntax
OKVErrNo okvCryptoContextGetBlockCipherMode(OKVEnv *env, OKVCryptoContext *crypto_context, ub4 *block_cipher_mode);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
crypto_context |
|
Cryptographic context contains required parameters for encryption/decryption like cryptographic parameters and IV. |
block_cipher_mode |
|
Block Cipher Mode value. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
ub4 block_cipher_mode; okvCryptoContextGetBlockCipherMode(env, crypto_context, &block_cipher_mode);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.9 okvCryptoContextGetIV
okvCryptoContextGetIV
gets the IV parameter value from
cryptographic context structure.
Catetory
KMIP utility API
Purpose
okvCryptoContextGetIV
gets the IV parameter value from
cryptographic context structure.
Syntax
OKVErrNo okvCryptoContextGetIV(OKVEnv *env, OKVCryptoContext *crypto_context, ub1 *iv, ub4 *ivl);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
crypto_context |
|
Cryptographic context contains required parameters for encryption/decryption like cryptographic parameters and IV. |
iv |
|
IV value. |
ivl |
|
IV value length. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
ub1 *iv = (ub1 *)NULL; ub4 ivl = 0; okvCryptoContextGetIV(env, crypto_context, iv, &ivl);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.10 okvCryptoContextGetPadding
okvCryptoContextGetPadding
gets the padding parameter
value from cryptographic context structure.
Catetory
KMIP utility API
Purpose
okvCryptoContextGetPadding
gets the padding parameter
value from cryptographic context structure.
Syntax
OKVErrNo okvCryptoContextGetPadding(OKVEnv *env, OKVCryptoContext *crypto_context, ub4 *padding);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
crypto_context |
|
Cryptographic context contains required parameters for encryption/decryption like cryptographic parameters and IV. |
padding |
|
Padding value. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
ub4 padding; okvCryptoContextGetPadding(env, crypto_context, &padding);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.11 okvCryptoContextGetRandomIV
okvCryptoContextGetRandomIV
gets the random IV parameter
value from cryptographic context structure.
Catetory
KMIP utility API
Purpose
okvCryptoContextGetRandomIV
gets the random IV
parameter value from cryptographic context structure.
Syntax
OKVErrNo okvCryptoContextGetRandomIV(OKVEnv *env, OKVCryptoContext *crypto_context, ub8 *random_iv);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
crypto_context |
|
Cryptographic context contains required parameters for encryption/decryption like cryptographic parameters and IV. |
random_iv |
|
Random IV value. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
ub8 random_iv; okvCryptoContextGetRandomIV(env, crypto_context, &random_iv);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.12 okvCryptoContextSetAuthEncryptionAdditionalData
okvCryptoContextSetAuthEncryptionAdditionalData
sets the
authenticated encryption additional data parameter value in the cryptographic context
structure.
Catetory
KMIP utility API
Purpose
okvCryptoContextSetAuthEncryptionAdditionalData
sets
the Authenticated encryption additional data parameter value in the cryptographic
context structure.
Syntax
OKVErrNo okvCryptoContextSetAuthEncryptionAdditionalData(OKVEnv *env, OKVCryptoContext *crypto_context, ub1 *auth_encryption_additional_data, ub4 auth_encryption_additional_datal);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
crypto_context |
|
Cryptographic context contains required parameters for encryption/decryption like cryptographic parameters and IV. |
auth_encryption_additional_data |
|
Authenticated encryption additional data value. |
auth_encryption_additional_datal |
|
Authenticated encryption additional data value length. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
OKVCryptoContext *crypto_context = okvCryptoContextCreate(env, OKVOpEncrypt); ub1 auth_enc_addl_data[] = "Additional Data"; ub4 auth_enc_addl_datal = strlen((const char *) auth_enc_addl_data); okvCryptoContextSetAuthEncryptionAdditionalData(env, crypto_context, auth_enc_addl_data, auth_enc_addl_datal);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.13 okvCryptoContextSetAuthEncryptionTag
okvCryptoContextSetAuthEncryptionTag
sets the
authenticated encryption tag parameter value in the cryptographic context
structure.
Catetory
KMIP utility API
Purpose
okvCryptoContextSetAuthEncryptionTag
sets the
Authenticated encryption tag parameter value in the cryptographic context
structure.
Syntax
OKVErrNo okvCryptoContextSetAuthEncryptionTag(OKVEnv *env, OKVCryptoContext *crypto_context, ub1 *auth_encryption_tag, ub4 auth_encryption_tagl);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
crypto_context |
|
Cryptographic context contains required parameters for encryption/decryption like cryptographic parameters and IV. |
auth_encryption_tag |
|
Authenticated encryption tag value. |
auth_encryption_tagl |
|
Authenticated encryption tag value length. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
OKVCryptoContext *crypto_context = okvCryptoContextCreate(env, OKVOpEncrypt); ub1 auth_enc_tag[] = "Auth Tag"; ub4 auth_enc_tagl = strlen((const char *) auth_enc_tag); okvCryptoContextSetAuthEncryptionTag(env, crypto_context, auth_enc_tag, auth_enc_tagl);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.14 okvCryptoContextSetBlockCipherMode
okvCryptoContextSetBlockCipherMode
sets the block cipher
mode parameter value in the cryptographic context structure.
Catetory
KMIP utility API
Purpose
okvCryptoContextSetBlockCipherMode
sets the block
cipher mode parameter value in the cryptographic context structure.
Syntax
OKVErrNo okvCryptoContextSetBlockCipherMode(OKVEnv *env, OKVCryptoContext *crypto_context, ub4 block_cipher_mode);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
crypto_context |
|
Cryptographic context contains required parameters for encryption/decryption like cryptographic parameters and IV. |
block_cipher_mode |
|
Block Cipher Mode value. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
OKVCryptoContext *crypto_context = okvCryptoContextCreate(env, OKVOpEncrypt); okvCryptoContextSetBlockCipherMode(env, crypto_context, BLK_CIPHER_CBC);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.15 okvCryptoContextSetIV
okvCryptoContextSetIV
sets the IV parameter value in the
cryptographic context structure.
Catetory
KMIP utility API
Purpose
okvCryptoContextSetIV
sets the IV parameter value in
the cryptographic context structure.
Syntax
OKVErrNo okvCryptoContextSetIV(OKVEnv *env, OKVCryptoContext *crypto_context, ub1 *iv, ub4 ivl);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
crypto_context |
|
Cryptographic context contains required parameters for encryption/decryption like cryptographic parameters and IV. |
iv |
|
IV value. |
ivl |
|
IV value length. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
OKVCryptoContext *crypto_context = okvCryptoContextCreate(env, OKVOpEncrypt); ub1 iv[] = "5432109876543210"; ub4 ivl = strlen((const char *) iv); okvCryptoContextSetIV(env, crypto_context, iv, ivl);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.16 okvCryptoContextSetPadding
okvCryptoContextSetPadding
sets the padding parameter
value in the cryptographic context structure.
Catetory
KMIP utility API
Purpose
okvCryptoContextSetPadding
sets the padding parameter
value in the cryptographic context structure.
Syntax
OKVErrNo okvCryptoContextSetPadding(OKVEnv *env, OKVCryptoContext *crypto_context, ub4 padding);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
crypto_context |
|
Cryptographic context contains required parameters for encryption/decryption like cryptographic parameters and IV. |
padding |
|
Padding value. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
OKVCryptoContext *crypto_context = okvCryptoContextCreate(env, OKVOpEncrypt); okvCryptoContextSetPadding(env, crypto_context, PADDING_PKCS5);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.17 okvCryptoContextSetRandomIV
okvCryptoContextSetRandomIV
sets the random IV parameter
value in the cryptographic context structure.
Catetory
KMIP utility API
Purpose
okvCryptoContextSetRandomIV
sets the random IV
parameter value in the cryptographic context structure.
Syntax
OKVErrNo okvCryptoContextSetRandomIV(OKVEnv *env, OKVCryptoContext *crypto_context, ub8 random_iv);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
crypto_context |
|
Cryptographic context contains required parameters for encryption/decryption like cryptographic parameters and IV. |
random_iv |
|
Random IV value. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
OKVCryptoContext *crypto_context = okvCryptoContextCreate(env, OKVOpEncrypt); okvCryptoContextSetRandomIV(env, crypto_context, (ub8)1);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.18 okvCryptoResponseGetAuthEncryptionTag
okvCryptoResponseGetAuthEncryptionTag
gets the
authenticated encryption tag value from encrypt response structure.
Catetory
KMIP utility API
Purpose
okvCryptoResponseGetAuthEncryptionTag
gets the
Authenticated encryption tag value from encrypt response structure.
Syntax
OKVErrNo okvCryptoResponseGetAuthEncryptionTag(OKVEnv *env, OKVEncryptResponse *encrypt_response, ub1 *auth_encryption_tag, ub4 *auth_encryption_tagl);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
encrypt_response |
|
Encrypt operation response. |
auth_encryption_tag |
|
Authenticated encryption tag value. |
auth_encryption_tagl |
|
Authenticated encryption tag value length. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
ub1 auth_enc_tag[100]; ub4 auth_enc_tagl = sizeof(auth_enc_tag); ... /* Perform Encrypt operation and get encrypt operation response in 'encrypt_response' */ ... memset(auth_enc_tag, 0, auth_enc_tagl); okvCryptoResponseGetAuthEncryptionTag(env, encrypt_response, auth_enc_tag, &auth_enc_tagl);
15.19 okvCryptoResponseGetDecryptedData
okvCryptoResponseGetDecryptedData
gets the decrypted
data value from decrypt response structure.
Catetory
KMIP utility API
Purpose
okvCryptoResponseGetDecryptedData
gets the decrypted
data value from decrypt response structure.
Syntax
OKVErrNo okvCryptoResponseGetDecryptedData(OKVEnv *env, OKVDecryptResponse *decrypt_response, ub1 *decrypted_data, ub4 *decrypted_datal);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
decrypt_response |
|
Decrypt operation response. |
decrypted_data |
|
Decrypted data value. |
decrypted_datal |
|
Decrypted data value length. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
ub1 decrypted_data[100]; ub4 decrypted_datal = sizeof(decrypted_data); ... /* Perform Decrypt operation and get decrypt operation response in 'decrypt_response' */ ... memset(decrypted_data, 0, decrypted_datal); okvCryptoResponseGetDecryptedData(env, decrypt_response, decrypted_data, &decrypted_datal);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.20 okvCryptoResponseGetEncryptedData
okvCryptoResponseGetEncryptedData
gets the encrypted
data value from encrypt response structure.
Catetory
KMIP utility API
Purpose
okvCryptoResponseGetEncryptedData
gets the encrypted
data value from encrypt response structure.
Syntax
OKVErrNo okvCryptoResponseGetEncryptedData(OKVEnv *env, OKVEncryptResponse *encrypt_response, ub1 *encrypted_data, ub4 *encrypted_datal);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
encrypt_response |
|
Encrypt operation response. |
encrypted_data |
|
Encrypted data value. |
encrypted_datal |
|
Encrypted data value length. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
ub1 encrypted_data[100]; ub4 encrypted_datal = sizeof(encrypted_data); ... /* Perform Encrypt operation and get encrypt operation response in 'encrypt_response' */ ... memset(encrypted_data, 0, encrypted_datal); okvCryptoResponseGetEncryptedData(env, encrypt_response, encrypted_data, &encrypted_datal);
15.21 okvCryptoResponseGetIV
okvCryptoResponseGetIV
gets the IV value from encrypt
response structure used by server for encryption, if the random IV was set and IV was not
provided in the request.
Catetory
KMIP utility API
Purpose
okvCryptoResponseGetIV
gets the IV value from encrypt
response structure used by server for encryption, if the random IV was set and IV
was not provided in the request.
Syntax
OKVErrNo okvCryptoResponseGetIV(OKVEnv *env, OKVEncryptResponse *encrypt_response, ub1 *iv, ub4 *ivl);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
encrypt_response |
|
Encrypt operation response. |
iv |
|
IV value. |
ivl |
|
IV value length. |
Return Values
Return Value | Description |
---|---|
OKVErrNo |
Oracle Key Vault error number. Success: OKV_SUCCESS (0) is returned. Failure: A valid error number is returned for the error on top of the error stack. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
ub1 iv[100]; ub4 ivl = sizeof(iv); ... /* Perform Encrypt operation and get encrypt operation response in 'encrypt_response' */ ... memset(iv, 0, ivl); okvCryptoResponseGetIV(env, encrypt_response, iv, &ivl);
15.22 okvDecryptResponseCreate
okvDecryptResponseCreate
creates the decrypt response
structure to hold the decrypt operation response details.
Catetory
KMIP utility API
Purpose
okvDecryptResponseCreate
creates the decrypt response
structure to hold the decrypt operation response details.
Syntax
OKVDecryptResponse *okvDecryptResponseCreate(OKVEnv *env);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
Return Values
Return Value | Description |
---|---|
OKVDecryptResponse * |
Pointer to OKVDecryptResponse object. Success: Pointer to OKVDecryptResponse object. Failure: NULL pointer. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
OKVDecryptResponse *decrypt_response = okvDecryptResponseCreate(env);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.23 okvDecryptResponseFree
okvDecryptResponseFree
frees the memory allocated to
decrypt response structure.
Catetory
KMIP utility API
Purpose
okvDecryptResponseFree
frees the memory allocated to
decrypt response structure.
Syntax
void okvDecryptResponseFree(OKVEnv *env, OKVDecryptResponse** decrypt_response);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
decrypt_response |
|
Decrypt operation response. |
Return Values
No values returned.
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
OKVDecryptResponse *decrypt_response = okvDecryptResponseCreate(env); ... okvDecryptResponseFree(env, &decrypt_response);
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.24 okvEncryptResponseCreate
okvEncryptResponseCreate
creates the encrypt response
structure to hold the encrypt operation response details.
Catetory
KMIP utility API
Purpose
okvEncryptResponseCreate
creates the encrypt response
structure to hold the encrypt operation response details.
Syntax
OKVEncryptResponse *okvEncryptResponseCreate(OKVEnv *env);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
Return Values
Return Value | Description |
---|---|
OKVEncryptResponse * |
Pointer to OKVEncryptResponse object. Success: Pointer to OKVEncryptResponse object. Failure: NULL pointer. |
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
OKVEncryptResponse *encrypt_response = okvEncryptResponseCreate(env);
15.25 okvEncryptResponseFree
okvEncryptResponseFree
frees the memory allocated to
encrypt response structure.
Catetory
KMIP utility API
Purpose
okvEncryptResponseFree
frees the memory allocated to
encrypt response structure.
Syntax
void okvEncryptResponseFree(OKVEnv *env, OKVEncryptResponse** encrypt_response);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
encrypt_response |
|
Encrypt operation response. |
Return Values
No values returned.
Supported Versions
Oracle Key Vault C SDK release 21.4.0.0.0 and later.
Comments
None.
Example
OKVEncryptResponse *encrypt_response = okvEncryptResponseCreate(env); ... okvEncryptResponseFree(env, &encrypt_response);
15.26 okvGetTextForAttributeNum
okvGetTextForAttributeNum
returns the attribute name for a
given Oracle Key Vault attribute number.
Catetory
KMIP Utility API
Purpose
okvGetTextForAttributeNum
returns the attribute name
for a given Oracle Key Vault attribute number.
Syntax
oratext *okvGetTextForAttributeNum(OKVAttrNo attrno);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
attrno |
|
Oracle Key Vault attribute number of the KMIP attribute. |
Return Values
Return Value | Description |
---|---|
oratext* |
Name of KMIP attribute. Success: A valid pointer to the name of the KMIP attribute. Failure: A NULL pointer is returned. |
Comments
None.
Example
printf("%s", okvGetTextForAttributeNum(OKVAttrActivationDate));
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.27 okvGetTextForTag
okvGetTextForTag
returns the name of the valid KMIP tag.
Category
KMIP utility API
Purpose
okvGetTextForTag
returns the name of the valid KMIP tag. A NULL
value is returned for invalid KMIP tag.
Syntax
oratext *okvGetTextForTag(OKVTag tag);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
tag |
IN |
KMIP tag |
Return Values
Return Value | Description |
---|---|
oratext* |
KMIP tag name. Success: A valid pointer to the KMIP tag name is returned. Failure: A |
Comments
None.
Example
printf("%s", okvGetTextForTag(OKVDEF_TAG_ID));
15.28 okvGetTextForTagEnum
okvGetTextForTagEnum
returns the name of the enumerated value for a valid KMIP tag of ENUMERATION
type.
Category
KMIP utility API
Purpose
okvGetTextForTagEnum
will return the name of the enumerated value for a valid KMIP tag of EMUMERATION
type.
Syntax
oratext *okvGetTextForTagEnum(OKVTag tag, ub4 val);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
tag |
IN |
KMIP enum tag |
val |
IN |
KMIP enum tag value |
Return Values
Return Value | Description |
---|---|
oratext* |
Name of KMIP enum tag value. Success: A valid pointer to the name of the KMIP enum tag value is returned. Failure: A |
Comments
A NULL
value is returned for invalid KMIP tag or invalid value of the KMIP tag or if the KMIP tag is not of ENUMERATION
type.
Example
printf("%s", okvGetTextForTagEnum(OKVDEF_TAG_STATE, OKVDEF_STATE_ACTIVE));
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.29 okvGetTextForTagType
okvGetTextForTagType
returns the name of the valid KMIP type.
Category
KMIP utility API
Purpose
okvGetTextForTagType
returns the name of the valid KMIP type. A NULL
value is returned for invalid KMIP type.
Syntax
oratext *okvGetTextForTagType(OKVType typ);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
typ |
IN |
KMIP type |
Return Values
Return Value | Description |
---|---|
oratext* |
KMIP type name. Success: A valid pointer to the KMIP type name is returned. Failure: A |
Comments
None.
Example
printf("%s", okvGetTextForTagType(OKVDEF_ITEM_TYPE_INT));
Related Topics
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.30 okvGetTextLenForAttributeNum
okvGetTextLenForAttributeNum
returns the length of the name
of the attribute for a given Oracle Key Vault attribute number.
Catetory
KMIP Utility API
Purpose
okvGetTextLenForAttributeNum
returns the length of the
name of the attribute for a given Oracle Key Vault attribute number.
Syntax
ub4 okvGetTextLenForAttributeNum(OKVAttrNo attrno);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
attrno |
|
Oracle Key Vault attribute number of the KMIP attribute. |
Return Values
Return Value | Description |
---|---|
ub4 |
Length of the attribute name. Success: Length of the buffer is returned. Failure: |
Comments
None.
Example
printf("%d", okvGetTextLenForAttributeNum(OKVAttrActivationDate));
Parent topic: Oracle Key Vault Client SDK Utility APIs
15.31 okvObjGetAttrNo
okvObjGetAttrNo
will return the Oracle Key Vault attribute
number for a given TTLV object.
Catetory
KMIP Utility API
Purpose
okvObjGetAttrNo
will return the Oracle Key Vault
attribute number for a given TTLV object.
Syntax
OKVAttrNo okvObjGetAttrNo(OKVEnv *env, OKVTTLV *ttlv);
Parameters
Parameter | IN/OUT | Description |
---|---|---|
env |
|
Oracle Key Vault environment handle. |
ttlv |
IN |
OKVTTLV object. |
Return Values
Return Value | Description |
---|---|
OKVAttrNo |
Oracle Key Vault attribute number for the TTLV object. Success: Oracle Key Vault attribute number for the given TTLV object is returned. Failure: |
Comments
None.
Example
OKVTTLV *ttlv = (OKVTTLV *) NULL; ... switch (okvObjGetAttrNo(env, ttlv)) { ... case OKVAttrObjType: ... case OKVAttrCryptoAlg: ... case OKVAttrCryptoLen: ... case OKVAttrCryptoUsageMask: ... }
Parent topic: Oracle Key Vault Client SDK Utility APIs