Skip to content

Commit

Permalink
Merge pull request #1642 from alex/not-all-pems
Browse files Browse the repository at this point in the history
Have the pem public/private key loading docs point to x.509
  • Loading branch information
reaperhulk committed Jan 27, 2015
2 parents 7466c2e + 1a3203b commit 7d93ad6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/hazmat/primitives/asymmetric/serialization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ don't need to worry about this detail. PEM keys are recognizable because they
all begin with ``-----BEGIN {format}-----`` and end with ``-----END
{format}-----``.

.. note::

A PEM block which starts with ``-----BEGIN CERTIFICATE-----`` is not a
public or private key, it's an :doc:`X.509 Certificate </x509>`. You can
load it using :func:`~cryptography.x509.load_pem_x509_certificate` and
extract the public key with
:meth:`Certificate.public_key <cryptography.x509.Certificate.public_key>`.

.. function:: load_pem_private_key(data, password, backend)

.. versionadded:: 0.6
Expand Down

0 comments on commit 7d93ad6

Please sign in to comment.