ePass1000 C/C++ API Reference Manual Version 2.0

epas_MD5_HMAC

The epas_MD5_HMAC function is a wrapper for performing MD5_HMAC using the epas_HashToken function.

EPAS_STATUS EPAS_API
epas_MD5_HMAC(
    EPAS_HANDLE hContextHandle,       // [in]
    unsigned long ulFileID1,          // [in]
    unsigned long ulFileID2,          // [in]
    unsigned char* pucText,           // [in]
    unsigned long ulTextLen,          // [in]
    unsigned char* pucDigest          // [out]
);

Requirement

epas_CreateContext, epas_OpenDevice

Parameters

hContextHandle
[in] Handle to device context.
ulFileID1
[in] File ID of the first file.
ulFileID2
[in] File ID of the second file.
pucText
[in] Points to data used as the challenge input, and not exceed 55 bytes.
ulTextLen
[in] Length of the challenge, and not exceed 55 bytes.
pucDigest
[out] Pointer to a 16-byte buffer that receives the message digest.

Remarks

This function automatically closes currently opened file.

To create the key files on the device, you may use the MD5_HMAC software function on a the shared secret. And you need create two file to save the generated key value. The file type should be defined as EPAS_FILETYPE_KEY.

The size of the input challenge can NOT exceed 55 bytes.

Return Values

If the function succeeds, FT_SUCCESS returned.

If appropriate file access has not granted, FT_ACCESS_DENIED returned.

For a list of all return codes, see Status Return Values.

See Also

epas_GenRandom, epas_HashToken