---
title: 设备管理类
description: "本章节主要介绍了符合国密标准GM/T 0018-2023的设备管理类接口功能及其规格限制。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengcctrustzone/cca/devg/Kunpeng_ommercialcryptography_16_0026.html
sourcePath: /source/zh/kunpengcctrustzone/cca/devg/Kunpeng_ommercialcryptography_16_0026.html
indexId: 19cc3d2ed15e11c4617eca7c75453165cd0c5ad8d44b51701b6e8171c19cc06281
---
# 设备管理类

本章节主要介绍了符合国密标准GM/T 0018-2023的设备管理类接口功能及其规格限制。

设备管理类支持的接口如下，接口参数与返回值可参考标准文档，算法标识描述可参考GM/T 0006-2023。

```
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);
int SDF_GetKEKAccessRight(void *hSessionHandle, unsigned int uiKeyIndex, unsigned char *pucPassword, unsigned int uiPwdLength);
int SDF_ReleasePrivateKeyAccessRight(void *hSessionHandle, unsigned int uiKeyIndex);
```

#### 规格限制

- 每个进程最多打开16个device，每个TA最多打开的device数为128个。
- 每个TA最多打开的REE session数最多为32768个。
- 内部非对称密钥索引支持范围1~2048。
- 私钥使用权限标识码长度范围8~128字节。
- 随机数最大长度为1MB。
