> readme.txt签名gmssl dgst -sm3 -sign sm2.key -out sm2.sig readm._openssl/gmssl ">
赞
踩
openssl 从 1.1.1 开始支持 sm2。gmssl 基于openssl 添加了对国密的支持。
openssl ecparam -list_curves | grep SM2
openssl ecparam -genkey -name SM2 -out priv.key
gmssl ecparam -genkey -name sm2p256v1 -out priv.key
gmssl sm2 -genkey -out priv.key
openssl ec -in priv.pem -text -noout
openssl ecparam -in priv.key -check
openssl ec -in priv.key -pubout -out pub.key
gmssl sm2 -in priv.key -pubout -out pub.key
echo -n "xxxxxx" > data.txt
gmssl dgst -sm3 -sign priv.key -out sm2.sig data.txt
gmssl sm2utl -sign -in data.txt -inkey priv.key -out sm2.sig -id "1234567812345678"
openssl pkeyutl -sign -in data.txt -inkey priv.key -out sig
gmssl dgst -sm3 -verify pub.key -signature sm2.sig data.txt
gmssl sm2utl -verify -in data.txt -pubin -inkey pub.key -sigfile sm2.sig -id "1234567812345678"
openssl pkeyutl -verify -pubin -in data.txt -inkey pub.key -sigfile sig
gmssl sm2utl -encrypt -in msg.txt -pubin -inkey pub.key -out enced.der
gmssl sm2utl -decrypt -in enced.der -inkey priv.key
私钥 openssl ec -in priv.key -out priv.der -outform der
公钥 openssl ec -pubin -in pub.key -outform der -out pub.der
gmssl sm2 -inform der -out priv.key -in priv.der
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。