Convert PEM traditional private key to PKCS8 private key

后端 未结 2 1735
你的背包
你的背包 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.

    0 讨论(0)
  • Try using following command. I haven't tried it but I think it should work.

    openssl pkcs8 -topk8 -inform PEM -outform DER -in filename -out filename -nocrypt
    
    0 讨论(0)
提交回复
热议问题