API C/C++
HSM Dinamo
Loading...
Searching...
No entry found
SVault Module

Detailed description

Data tokenization and anonymization operations.

See HSM technical documentation about operating details, specifications used, licenses and module trade name.

Functions

int AAP_API DSVaultGenToken (HSESSIONCTX hSession, DWORD dwOp, BYTE *pbInData, BYTE *pbTokenBlob, DWORD *pdwTokenBlobLen, char *szToken, DWORD dwReserved)
 
int AAP_API DSVaultGetData (HSESSIONCTX hSession, DWORD dwOp, const char *szMK, const char *szMask, BYTE *pbTokenBlob, DWORD dwTokenBlobLen, char *szData, DWORD *pdwDataLen, DWORD dwReserved)
 

Functions

◆ DSVaultGenToken()

int AAP_API DSVaultGenToken ( HSESSIONCTX hSession,
DWORD dwOp,
BYTE * pbInData,
BYTE * pbTokenBlob,
DWORD * pdwTokenBlobLen,
char * szToken,
DWORD dwReserved )

#include <dinamo.h>

Tokenizes data, generating a token blob and its corresponding token.

Parameters
[in]hSessionContext acquired through the DOpenSession() function. .
[in]dwOpOperation type. Must be 0.
[in]pbInDataInput data for token generation. The SVAULT_GEN_TOKEN structure must be used.
[out]pbTokenBlobBuffer that will contain the token blob. Pass a buffer of size D_SVAULT_TOKEN_BLOB_LEN on input. pdwTokenBlobLen will contain the size of the output buffer. The token blob protects the secret and its metadata. This buffer should be saved and used in the call to DSVaultGetData() for later retrieval of the secret or token.
[in,out]pdwTokenBlobLenSize of pbTokenBlob. The input contains the total size of the pbTokenBlob buffer and the output contains the size of the data copied into pbTokenBlob.
[out]szTokenA string of size D_SVAULT_MAX_TL + 1 that will contain the generated token. NULL can be passed if the generated token is not to be retrieved. The token can be retrieved again using the DSVaultGetData() API.
[in]dwReservedReserved for future use (must be 0).
Returns
0 (ZERO) if the function is successful.
Refer to the Return Codes section for other values.
See also
DSVaultGetData().
Examples
tokenization.c.

◆ DSVaultGetData()

int AAP_API DSVaultGetData ( HSESSIONCTX hSession,
DWORD dwOp,
const char * szMK,
const char * szMask,
BYTE * pbTokenBlob,
DWORD dwTokenBlobLen,
char * szData,
DWORD * pdwDataLen,
DWORD dwReserved )

#include <dinamo.h>

Retrieves the secret or token from tokenized data using a token blob. This API also enables the retrieval of masked secrets or tokens.

Parameters
[in]hSessionContext acquired through the DOpenSession() function. .
[in]dwOpOperation type. It can be one of the following options.
Value Meaning
D_SVAULT_GET_OP_SECRET Retrieves the secret.
D_SVAULT_GET_OP_TOKEN Retrieves the token.
[in]szMKName of the key used for data protection.
[in]szMaskMasking pattern to be applied to the secret or token, as defined during the generation of the token blob in DSVaultGenToken(). This buffer has a minimum size of D_SVAULT_MIN_TL and a maximum size of D_SVAULT_MAX_TL and contains the mask. It can be NULL to disable masking. The mask is a UTF-8 string containing characters that will be applied to the data for masking. Pass '\0' in positions where the original data should be displayed. See the remarks for examples.
[in]pbTokenBlobBuffer of size D_SVAULT_TOKEN_BLOB_LEN, generated by the DSVaultGenToken() API, containing the token blob.
[in]dwTokenBlobLenBuffer with a maximum size of D_SVAULT_TOKEN_BLOB_LEN, generated by the DSVaultGenToken() API, containing the token blob.
[out]szDataString that will contain the token or secret as specified in dwOp. You can use a size of D_SVAULT_MAX_TL + 1 to cover all current data.
[in,out]pdwDataLenSize of the szData string. It should contain the size of szData and in the API return it will contain the total size of the copied data.
[in]dwReservedReserved for future use (must be 0).
Returns
0 (ZERO) if the function is successful.
Refer to the Return Codes section for other values.
Notes
Mask usage examples. In this example, we will use a secret with the value "123456789".

Using the mask "***" will yield the following result.

"***456789"

Applying the mask "9999" will yield the following result.

"999956789"

Applying the mask "***\0\0\0***" will yield the following result.

"***456***"
See also
DSVaultGenToken().
Examples
tokenization.c.