使用GMSSL生成SM2密钥对的详细步骤

以下使用的为gmssl 3.1.2 Dev版,环境为Ubuntu22.04 LTS

gmssl sm2keygen -out priv.pem -pubout pub.pem -pass testpass

加密

gmssl sm2encrypt -pubkey pub.pem -in plaintext.txt -out ciphertext.bin

解密

gmssl sm2decrypt -key priv.pem  -pass testpass -in ciphertext.bin

签名

gmssl sm2sign -key priv.pem -pass testpass -in plaintext.txt -out plaintext.sig

验签

gmssl sm2verify -pubkey pub.pem -in plaintext.txt -sig plaintext.sig
people found this article helpful. What about you?
发表回复 0

Your email address will not be published. Required fields are marked *