Documentation
¶
Index ¶
- func ChangeAdminPin(handle unsafe.Pointer, oldPin, newPin string) error
- func ChangeUserPin(handle unsafe.Pointer, oldPin, newPin string) error
- func ClearApplicationSecurityStatus(handle unsafe.Pointer) error
- func CloseApplication(handle unsafe.Pointer) error
- func CloseContainer(cHandle unsafe.Pointer) error
- func CreateApplication(handle unsafe.Pointer, info *api.ApplicationInfo) (unsafe.Pointer, error)
- func CreateContainer(appHandle unsafe.Pointer, name string) (unsafe.Pointer, error)
- func CreateFile(handle unsafe.Pointer, info *api.FileInfo) error
- func DeleteApplication(handle unsafe.Pointer, appName string) error
- func DeleteContainer(appHandle unsafe.Pointer, cName string) error
- func DeleteFile(handle unsafe.Pointer, filename string) error
- func DeviceAuthentication(devHandle unsafe.Pointer, authenticationKey string) (err error)
- func DisConnectDevice(handle unsafe.Pointer) error
- func ECCSignData(cHandle unsafe.Pointer, data []byte) (signData *api.ECCSignatureBlob, err error)
- func EnumerateApplication(handle unsafe.Pointer) ([]string, error)
- func EnumerateContainer(appHandle unsafe.Pointer) ([]string, error)
- func EnumerateDevice(present bool) ([]string, error)
- func EnumerateFile(handle unsafe.Pointer) ([]string, error)
- func ExportCertificate(cHandle unsafe.Pointer, isSign bool) ([]byte, error)
- func ExportSignPublicKey(cHandle unsafe.Pointer) (pubKey *api.ECCPublicKeyBlob, err error)
- func ExtSign(devHandle unsafe.Pointer, data []byte, priKey *api.ECCPrivateKeyBlob) (signData *api.ECCSignatureBlob, err error)
- func GenECCKeyPair(cHandle unsafe.Pointer) (*api.ECCPublicKeyBlob, error)
- func GetAdminPinInfo(handle unsafe.Pointer) (*api.PINInfo, error)
- func GetDeviceInfo(handle unsafe.Pointer) (*api.DeviceInfo, error)
- func GetDeviceState(name string) (uint, error)
- func GetFileInfo(handle unsafe.Pointer, filename string) (*api.FileAttribute, error)
- func GetUserPinInfo(handle unsafe.Pointer) (*api.PINInfo, error)
- func HashWithSM3(deviceHandle unsafe.Pointer, data []byte) ([]byte, error)
- func ImportCertificate(cHandle unsafe.Pointer, isSign bool, cert []byte) error
- func ImportECCKeyPair(cHandle unsafe.Pointer, encKey *api.EnvelopedKeyBlob) error
- func ImportFileFromDevice(appName, filename, pin string) ([]byte, error)
- func LockDevice(handle unsafe.Pointer, timeout uint32) error
- func OpenApplication(handle unsafe.Pointer, appName string) (unsafe.Pointer, error)
- func OpenContainer(appHandle unsafe.Pointer, cName string) (unsafe.Pointer, error)
- func OpenDevice() (unsafe.Pointer, error)
- func OpenDeviceWithIndex(index uint, devList []string) (unsafe.Pointer, error)
- func Random(devHandle unsafe.Pointer, len uint32) (random []byte, err error)
- func ReadFile(handle unsafe.Pointer, filename string, offset, size uint32) ([]byte, error)
- func SetDeviceLabel(handle unsafe.Pointer, label string) error
- func UnLockDev(handle unsafe.Pointer) error
- func UnLockPIN(handle unsafe.Pointer, adminPin, newUserPin string) error
- func VerifyAdminPin(handle unsafe.Pointer, pin string) error
- func VerifyUserPin(handle unsafe.Pointer, pin string) error
- func WriteFile(appHandle unsafe.Pointer, filename string, offset uint32, inData []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeviceAuthentication ¶
DeviceAuthentication 生成设备认证数据并发送至设备进行设备认证 创建和删除应用之前必须要进行设备认证
devHandle 设备句柄 authenticationKey 设备预置的设备认证密钥
func ECCSignData ¶ added in v0.0.8
func EnumerateDevice ¶
EnumerateDevice 枚举所有的设备
present 为 true 表示获取当前状态为存在的设备列表,false 表示获取当前驱动支持的设备列表
func ExportCertificate ¶ added in v0.0.5
ExportCertificate 导出数字证书
cHandle 容器句柄 isSign 是否是签名证书,false表示加密证书
func ExportSignPublicKey ¶ added in v0.0.8
func ExportSignPublicKey(cHandle unsafe.Pointer) (pubKey *api.ECCPublicKeyBlob, err error)
func ExtSign ¶ added in v0.0.8
func ExtSign(devHandle unsafe.Pointer, data []byte, priKey *api.ECCPrivateKeyBlob) (signData *api.ECCSignatureBlob, err error)
func GenECCKeyPair ¶ added in v0.0.6
func GenECCKeyPair(cHandle unsafe.Pointer) (*api.ECCPublicKeyBlob, error)
GenECCKeyPair 生成ECC签名密钥对
cHandle 容器句柄 algId 算法标识
func GetDeviceInfo ¶
func GetDeviceInfo(handle unsafe.Pointer) (*api.DeviceInfo, error)
GetDeviceInfo 获取某个设备的设备信息
handle 设备句柄
func GetDeviceState ¶
GetDeviceState 获取名称为 name 的设备状态,返回值 0 表示状态未知 1 表示设备存在 2 表示设备不存在
func HashWithSM3 ¶ added in v0.0.8
func ImportCertificate ¶ added in v0.0.5
ImportCertificate 导入数字证书
cHandle 容器句柄 isSign 是否是签名证书,false表示加密证书 cert 证书字节数字
func ImportECCKeyPair ¶ added in v0.0.6
func ImportECCKeyPair(cHandle unsafe.Pointer, encKey *api.EnvelopedKeyBlob) error
ImportECCKeyPair 导入加密密钥对
func ImportFileFromDevice ¶
ImportFileFromDevice 从设备中导入文件,并返回文件内容;只提供应用名、文件名、PIN码必要参数,无需关心其他操作
func OpenContainer ¶ added in v0.0.5
OpenContainer 打开名称为 cName 的容器,并返回容器句柄
appHandle 应用句柄 cName 容器名称
Types ¶
This section is empty.