参考:
参考:
Privacy-Enhanced Mail (PEM)是存储、传输密码学的密钥、公开密钥证书和其他数据的文件格式的业界标准。
许多加密标准使用ASN.1定义数据结构,使用DER(英语:X.690#DER encoding)串行化这些数据结构。[3] 由于DER产生的是二进制格式数据,在许多系统(如电子邮件)中传输不变,所以需要ASCII表示DER格式的数据,即PEM格式。PEM格式采用了Base64编码。此外,PEM海定义了一行作为头部,一行作为尾部:
-----BEGIN加上一个标签加上-----
-----END加上一个标签加上-----
标签确定了被编码的信息的类型,可以是:
CERTIFICATE
,CERTIFICATE REQUEST
,PRIVATE KEY
或X509 CRL
PEM数据的文件扩展名常为:“
.pem
”、“.cer
”、“.crt
”、“.key
”。PEM格式并不管二进制数据的格式和用途,因此PEM文件可以包括“几乎任何基于base64
编码的包夹在BEGIN
和END
头尾行之间的数据”
查看PEM格式证书的信息:
openssl x509 -in certificate.pem -text -noout
也可以直接使用文本打开查看
参考:
说明如下:
.key
can be any kind of key, but usually it is the private key - OpenSSL can wrap private keys for all algorithms (RSA, DSA, EC) in a generic and standard PKCS#8 structure, but it also supports a separate ‘legacy’ structure for each algorithm, and both are still widely used even though the documentation has marked PKCS#8 as superior for almost 20 years; both can be stored as DER (binary) or PEM encoded, and both PEM and PKCS#8 DER can protect the key with password-based encryption or be left unencrypted;
.key
可以是任何类型的密钥,但通常是私钥 - OpenSSL 可以将所有算法(RSA、DSA、EC)的私钥包装在通用和标准的 PKCS#8 结构中,但它也支持单独的 每种算法的“遗留”结构,尽管文档已将 PKCS#8 标记为优越近 20 年,但两者仍被广泛使用; 两者都可以存储为 DER(二进制)或 PEM 编码,并且 PEM 和 PKCS#8 DER 都可以使用基于密码的加密来保护密钥或保持未加密状态;
.csr
or .req
or sometimes .p10
stands for Certificate Signing Request as defined in PKCS#10; it contains information such as the public key and common name required by a Certificate Authority to create and sign a certificate for the requester, the encoding could be PEM or DER (which is a binary encoding of an ASN.1 specified structure);
.csr
或.req
或有时.p10
代表 PKCS#10 中定义的证书签名请求; 它包含证书颁发机构为请求者创建和签署证书所需的公钥和通用名称等信息,编码可以是 PEM 或 DER(这是 ASN.1 指定结构的二进制编码);
.crt
or .cer
stands simply for certificate, usually an X509v3 certificate, again the encoding could be PEM or DER; a certificate contains the public key, but it contains much more information (most importantly the signature by the Certificate Authority over the data and public key, of course).
.crt
或.cer
仅代表证书,通常是 X509v3 证书,同样编码可以是 PEM 或 DER; 证书包含公钥,但它包含更多信息(当然,最重要的是证书颁发机构对数据和公钥的签名)。