Ai
3 Star 0 Fork 0

河北素数信息安全有限公司/crypto-hw-std-interface

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
asymmetric_algorithm.go 743 Bytes
一键复制 编辑 原始数据 按行查看 历史
zjh0125 提交于 2025-05-16 15:56 +08:00 . feat:生成签名密钥对、导入加密密钥对;
package skf
import (
"fmt"
"gitee.com/sushuxinan/crypto-hw-std-interface/skf/util"
"unsafe"
)
// GenECCKeyPair 生成ECC签名密钥对
//
// cHandle 容器句柄 algId 算法标识
func GenECCKeyPair(cHandle unsafe.Pointer) (*ECCPublicKeyBlob, error) {
pubKey := &ECCPublicKeyBlob{}
if c := genECCKeyPair(cHandle, SM2_1, pubKey); c != util.Ok {
return nil, fmt.Errorf("生成签名密钥对失败: %s", util.ParseErrorCode(c))
}
return pubKey, nil
}
// ImportECCKeyPair 导入加密密钥对
func ImportECCKeyPair(cHandle unsafe.Pointer, encKey *EnvelopedKeyBlob) error {
if c := importECCKeyPair(cHandle, encKey); c != util.Ok {
return fmt.Errorf("导入加密密钥对失败: %s", util.ParseErrorCode(c))
}
return nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/sushuxinan/crypto-hw-std-interface.git
git@gitee.com:sushuxinan/crypto-hw-std-interface.git
sushuxinan
crypto-hw-std-interface
crypto-hw-std-interface
skf/v0.0.6

搜索帮助