diff options
author | José Padilla <jpadilla@webapplicate.com> | 2017-03-28 14:01:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-28 14:01:01 -0700 |
commit | ceff941c705f6e745688a181f917f06e8706413e (patch) | |
tree | de2fc1273e313d753c9db6ee679ae435917d2648 | |
parent | 5bc498a60a01322b1271e1a1e99791a6938e21d7 (diff) | |
parent | 06ca56a299eb0fde56cbe6bf0f4bae18f6b4f4c1 (diff) | |
download | pyjwt-ceff941c705f6e745688a181f917f06e8706413e.tar.gz |
Merge pull request #249 from dbinetti/master
Update FAQ to clarify Python2/3 differences
-rw-r--r-- | docs/faq.rst | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/faq.rst b/docs/faq.rst index 59a6cb6..a5eb139 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -9,6 +9,7 @@ extract the public or private keys from a x509 certificate in PEM format. .. code-block:: python + # Python 2 from cryptography.x509 import load_pem_x509_certificate from cryptography.hazmat.backends import default_backend @@ -17,6 +18,18 @@ extract the public or private keys from a x509 certificate in PEM format. public_key = cert_obj.public_key() private_key = cert_obj.private_key() +.. code-block:: python + + # Python 3 + from cryptography.x509 import load_pem_x509_certificate + from cryptography.hazmat.backends import default_backend + + cert_str = "-----BEGIN CERTIFICATE-----MIIDETCCAfm...".encode() + cert_obj = load_pem_x509_certificate(cert_str, default_backend()) + public_key = cert_obj.public_key() + private_key = cert_obj.private_key() + + I'm using Google App Engine and can't install `cryptography`, what can I do? ---------------------------------------------------------------------------- |