Convert PEM traditional private key to PKCS8 private key

后端 未结 2 1750
你的背包
你的背包 2020-11-28 04:28

I\'ve been given a PEM file with a certificate and pub/private keys. Specifically it includes the headers

-----BEGIN CERTIFICATE-----   
-----END CERTIFICAT         


        
2条回答
  •  悲&欢浪女
    2020-11-28 04:56

    To convert the private key from PKCS#1 to PKCS#8 with openssl:

    # openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in pkcs1.key -out pkcs8.key
    

    That will work as long as you have the PKCS#1 key in PEM (text format) as described in the question.

提交回复
热议问题