将 .pem 转换为 .crt 和 .key

将 .pem 转换为 .crt 和 .key

问题描述:

谁能告诉我从 .pem中提取/转换证书 .crt 和私钥 .key 文件的正确方法/命令> 档案?我只是读到它们可以互换,但不知道如何互换.

Can anyone tell me the correct way/command to extract/convert the certificate .crt and private key .key files from a .pem file? I just read they are interchangable, but not how.

我能够使用这个将 pem 转换为 crt:

I was able to convert pem to crt using this:

openssl x509 -outform der -in your-cert.pem -out your-cert.crt