API C/C++
HSM Dinamo
Loading...
Looking for...
No entries found
SVault

Detailed description

Data tokenization and anonymization operations.

See the HSM technical documentation.

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>

It tokenizes a piece of data, generating a token blob and its respective token.

Parameters
[in]hSessionContext acquired through the DOpenSession() function. .
[in]dwOpType of operation. 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. Passing a buffer size D_SVAULT_TOKEN_BLOB_LEN at the entrance. pdwTokenBlobLen will contain the size of the output buffer. O token blob protects the secret and its metadata. This buffer must be saved and used when calling DSVaultGetData() for later recovery of the secret or token.
[in,out]pdwTokenBlobLenSize of pbTokenBlob. The entry contains the total size of the buffer pbTokenBlob and the output will contain the size of the copied data in pbTokenBlob.
[out]szTokenString of length D_SVAULT_MAX_TL + 1 that will contain the generated token. NULL can be passed to not retrieve the generated token. The token can be retrieved again using the DSVaultGetData() API.
[in]dwReservedReserved for future use (must be 0).
Return
0 (ZERO) if the function is successful.
See 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 of tokenized data using a token blob. This API also allows the recovery of masked secret or token.

Parameters
[in]hSessionContext acquired through the DOpenSession() function. .
[in]dwOpType of operation. This can be one of the options below.
Value Meaning
D_SVAULT_GET_OP_SECRET Get the secret back.
D_SVAULT_GET_OP_TOKEN Recover the token.
[in]szMKName of the key used for data protection.
[in]szMaskMask pattern that will be applied to the secret or token, according to the one defined when generating the token blob in DSVaultGenToken(). Buffer with a minimum size of D_SVAULT_MIN_TL and a maximum of D_SVAULT_MAX_TL containing the mask. It can be NULL so as not to use masking. The mask is a UTF-8 string containing the characters that will be applied to the data to mask it. Pass '\0' in the positions where you want the data to be displayed. See the notes for examples.
[in]pbTokenBlobBuffer of size D_SVAULT_TOKEN_BLOB_LEN, generated by the DSVaultGenToken() API, containing the token blob.
[in]dwTokenBlobLenMaximum size buffer 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]pdwDataLenString size szData. It should contain the size of szData and the return from the API will contain the total size of the copied data.
[in]dwReservedReserved for future use (must be 0).
Return
0 (ZERO) if the function is successful.
See the Return Codes section for other values.
Notes
Examples of mask use. In this example we will use a secret with the value "123456789".

Using the "***" mask will give us the following result.

"***456789"

Applying the "9999" mask will give us the following result.

"999956789"

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

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