How to convert a .csr to .crt using openssl?

人盡茶涼 提交于 2019-12-01 08:38:47

问题


well i have tried the below

openssl x509 -req -in <cert_name>.csr -signkey <key_name>.key -out output.crt    

but seems to throw an error

140735226307408:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: CERTIFICATE REQUEST    

Any solutions?


回答1:


The source of the problem is the form of your CSR : While working with X509, your data can be store using 2 forms : DER and PEM.

By default openssl assumes you are using PEM.

In your case, you should first convert the CSR in PEM format : openssl req -inform DER -in .csr -out .pem And then openssl x509 -req -in .pem -signkey .key -out output.crt



来源:https://stackoverflow.com/questions/28363052/how-to-convert-a-csr-to-crt-using-openssl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!