duanhongyi / gmssl

a python crypto for sm2/sm3/sm4
MIT License
479 stars 140 forks source link

如何从pem文件中读取私钥公钥,以及将生成的密钥写入文件,我用OpenSSL生成SM2的私钥公钥,不知道如何加载进来程序,求指导。 #41

Open huruzun opened 3 years ago

FengGuanxi commented 2 years ago

I met the same difficulty.

joyhuchao commented 2 years ago

me too

monkeycc commented 2 years ago

求指导

Libraggbond commented 1 year ago

def file_to_hex_string(file_path): with open(file_path, "rb") as f: hex_string = f.read().hex() return hex_string