Does .pem file contain both private and public keys?

后端 未结 2 753
情深已故
情深已故 2020-12-13 08:28

I am wondering if PEM-files contain both private and public keys? What does \"PEM\" stand for?

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-13 08:53

    A PEM file may contain just about anything including a public key, a private key, or both, because a PEM file is not a standard. In effect PEM just means the file contains a base64-encoded bit of data. It is called a PEM file by allusion to the old Privacy-Enhanced Mail standards which preceded S/MIME as a mail security standard. These standards specified the format of various keys and messages in a particular base64 format. See RFC 1421 for example.

    Typically a PEM file contains a base64 encoded key or certificate with header and footer lines of the form -----BEGIN ----- and -----END ----. Over time there have evolved many possibilities for , including private keys, public keys, X509 certificates, PKCS7 data, files containing multiple certificates, files containing both the private key and the X509 certificate, PKCS#10 certificate signing requests, ...

    RFC 7468 has been written to document this de facto format.

提交回复
热议问题