简体   繁体   English

这些openssl文件之间的关系是什么:example.cer example.key example.pem example.crt?

[英]What is the relationship between these openssl files: example.cer example.key example.pem example.crt?

I am config the ssl using Mechanize , according the document I need to set the 我使用Mechanize配置ssl,根据我需要设置的文档

agent.cert = 'example.cer'
agent.key='example.cer'

but how can I get these two file? 但是我怎么能得到这两个文件呢? I also find that ssl file has a lot of types, such as .cer .pem .crt .key , what is the relationship between them? 我还发现ssl文件具有很多类型,例如.cer .pem .crt .key ,它们之间的关系是什么?

Let's start from PEM files, which are your digital certificates written in form encoded in only basic ASCII characters, they can be easily copy&pasted, e-mailed, printed. 让我们从PEM文件开始,它们是您的数字证书,仅以基本ASCII字符编码的形式编写,可以轻松地复制,粘贴,通过电子邮件发送,打印。 More about them: 有关它们的更多信息:

The file with .crt extension is PEM or DER, which is just binary encoded certificate. 扩展名为.crt的文件是PEM或DER,它只是二进制编码的证书。 This extension is recognized by Windows, while PEM or DER aren't. Windows可以识别此扩展名,而PEM或DER无法识别此扩展名。

The file with .key extension is just your private key. 扩展名为.key的文件只是您的私钥。 It's stored in separate file. 它存储在单独的文件中。 Format not standardized. 格式不规范。

You will find more information about all these formats in the answer on serverfault: What is a PEM file and how does it differ from other OpenSSL generated key file formats? 您可以在serverfault的答案中找到有关所有这些格式的更多信息: 什么是PEM文件,它与其他OpenSSL生成的密钥文件格式有何不同?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM