Rate This Document
Findability
Accuracy
Completeness
Readability

Device Management APIs

This section describes the functions and specification restrictions of device management APIs that comply with GM/T 0018-2012.

For details about the API parameters and return values, see GM/T 0018-2012. For details about the algorithm identifier description, see GM/T 0006-2012.

int SDF_OpenDevice(void **phDeviceHandle);
int SDF_CloseDevice(void *hDeviceHandle);
int SDF_OpenSession(void *hDeviceHandle, void **phSessionHandle);
int SDF_CloseSession(void *hSessionHandle);
int SDF_GetDeviceInfo(void *hSessionHandle, DEVICEINFO *pstDeviceInfo);
int SDF_GenerateRandom(void *hSessionHandle, unsigned int uiLength, unsigned char *pucRandom);
int SDF_GetPrivateKeyAccessRight(void *hSessionHandle, unsigned int uiKeyIndex, unsigned char *pucPassword, unsigned int uiPwdLength);
int SDF_ReleasePrivateKeyAccessRight(void *hSessionHandle, unsigned int uiKeyIndex);

Specification Restrictions

  • Each process can start only one device. A maximum of 50 devices can be started concurrently.
  • A maximum of 1000 sessions can be opened concurrently.
  • The index of an internal asymmetric key ranges from 1 to 1000.
  • The length of the password for accessing the private key ranges from 8 to 128 bytes.
  • The maximum length of a random number is 1 MB.