openssl sm2公钥转ec_point
您可以使用以下命令将SM2公钥转换为EC_POINT:
openssl ec -inform DER -in sm2_public_key.der -pubin -text -noout
其中,sm2_public_key.der 是您的SM2公钥文件名。
该命令将输出公钥的详细信息,包括椭圆曲线点的坐标。您可以从输出中提取椭圆曲线点的坐标,然后将其转换为十六进制格式。
如果您只需要椭圆曲线点的坐标,可以使用以下命令:
openssl ec -inform DER -in sm2_public_key.der -pubin -text -noout | grep "ASN1 OID: sm2sign" -A5 | tail -n +2 | tr -d " \n:" | sed 's/../&:/g' | sed 's/:$//'
该命令将输出椭圆曲线点的坐标,以十六进制格式表示。
原文地址: https://www.cveoy.top/t/topic/bSwf 著作权归作者所有。请勿转载和采集!