diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-03-15 15:34:35 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-03-29 00:25:02 -0500 |
commit | a1a1f2325ef8ea0a1d467dcafa8fffde98a5a7c3 (patch) | |
tree | a9c83a4ea2815e604cf19e2756f96c64f633b7d5 | |
parent | 5aadb9cec193ce3486f597dee044b77e268d9b77 (diff) | |
download | cryptography-a1a1f2325ef8ea0a1d467dcafa8fffde98a5a7c3.tar.gz cryptography-a1a1f2325ef8ea0a1d467dcafa8fffde98a5a7c3.tar.bz2 cryptography-a1a1f2325ef8ea0a1d467dcafa8fffde98a5a7c3.zip |
rename to CertificateSigningRequest
-rw-r--r-- | CHANGELOG.rst | 2 | ||||
-rw-r--r-- | docs/hazmat/backends/interfaces.rst | 3 | ||||
-rw-r--r-- | docs/x509.rst | 19 | ||||
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/backend.py | 6 | ||||
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/x509.py | 4 | ||||
-rw-r--r-- | src/cryptography/x509.py | 2 |
6 files changed, 20 insertions, 16 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 448f7f0c..6f02f951 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -18,7 +18,7 @@ Changelog :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPrivateKeyWithSerialization`, and :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKeyWithSerialization`. -* Add support for parsing X.509 CSRs (certificate signing requests) with +* Add support for parsing X.509 certificate signing requests (CSRs) with :func:`~cryptography.x509.load_pem_x509_csr`. 0.8.1 - 2015-03-20 diff --git a/docs/hazmat/backends/interfaces.rst b/docs/hazmat/backends/interfaces.rst index 2b53dfdb..15a82343 100644 --- a/docs/hazmat/backends/interfaces.rst +++ b/docs/hazmat/backends/interfaces.rst @@ -516,4 +516,5 @@ A specific ``backend`` may provide one or more of these interfaces. :param bytes data: PEM formatted certificate request data. - :returns: An instance of :class:`~cryptography.x509.CSR`. + :returns: An instance of + :class:`~cryptography.x509.CertificateSigningRequest`. diff --git a/docs/x509.rst b/docs/x509.rst index 03301c22..fd1b4236 100644 --- a/docs/x509.rst +++ b/docs/x509.rst @@ -77,14 +77,14 @@ Loading Certificates >>> cert.serial 2 -Loading CSRs -~~~~~~~~~~~~ +Loading Certificate Signing Requests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. function:: load_pem_x509_csr(data, backend) .. versionadded:: 0.9 - Deserialize a certificate signing request from PEM encoded data. PEM + Deserialize a certificate signing request (CSR) from PEM encoded data. PEM requests are base64 decoded and have delimiters that look like ``-----BEGIN CERTIFICATE REQUEST-----``. This is also known as PKCS#10 format. @@ -95,7 +95,8 @@ Loading CSRs :class:`~cryptography.hazmat.backends.interfaces.X509Backend` interface. - :returns: An instance of :class:`~cryptography.x509.CSR`. + :returns: An instance of + :class:`~cryptography.x509.CertificateSigningRequest`. .. testsetup:: @@ -125,8 +126,8 @@ Loading CSRs >>> from cryptography import x509 >>> from cryptography.hazmat.backends import default_backend >>> from cryptography.hazmat.primitives import hashes - >>> request = x509.load_pem_x509_csr(pem_req_data, default_backend()) - >>> isinstance(request.signature_hash_algorithm, hashes.SHA1) + >>> csr = x509.load_pem_x509_csr(pem_req_data, default_backend()) + >>> isinstance(csr.signature_hash_algorithm, hashes.SHA1) True X.509 Certificate Object @@ -266,7 +267,7 @@ X.509 Certificate Object X.509 CSR (Certificate Signing Request) Object ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. class:: CSR +.. class:: CertificateSigningRequest .. versionadded:: 0.9 @@ -282,7 +283,7 @@ X.509 CSR (Certificate Signing Request) Object .. doctest:: >>> from cryptography.hazmat.primitives.asymmetric import rsa - >>> public_key = request.public_key() + >>> public_key = csr.public_key() >>> isinstance(public_key, rsa.RSAPublicKey) True @@ -303,7 +304,7 @@ X.509 CSR (Certificate Signing Request) Object .. doctest:: >>> from cryptography.hazmat.primitives import hashes - >>> isinstance(request.signature_hash_algorithm, hashes.SHA1) + >>> isinstance(csr.signature_hash_algorithm, hashes.SHA1) True .. class:: Name diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py index 48fdcb72..6cc3fd91 100644 --- a/src/cryptography/hazmat/backends/openssl/backend.py +++ b/src/cryptography/hazmat/backends/openssl/backend.py @@ -34,7 +34,9 @@ from cryptography.hazmat.backends.openssl.hmac import _HMACContext from cryptography.hazmat.backends.openssl.rsa import ( _RSAPrivateKey, _RSAPublicKey ) -from cryptography.hazmat.backends.openssl.x509 import _CSR, _Certificate +from cryptography.hazmat.backends.openssl.x509 import ( + _Certificate, _CertificateSigningRequest +) from cryptography.hazmat.bindings.openssl.binding import Binding from cryptography.hazmat.primitives import hashes, serialization from cryptography.hazmat.primitives.asymmetric import dsa, ec, rsa @@ -830,7 +832,7 @@ class Backend(object): raise ValueError("Unable to load request") x509_req = self._ffi.gc(x509_req, self._lib.X509_REQ_free) - return _CSR(self, x509_req) + return _CertificateSigningRequest(self, x509_req) def _load_key(self, openssl_read_func, convert_func, data, password): mem_bio = self._bytes_to_bio(data) diff --git a/src/cryptography/hazmat/backends/openssl/x509.py b/src/cryptography/hazmat/backends/openssl/x509.py index e936201e..2b66c21e 100644 --- a/src/cryptography/hazmat/backends/openssl/x509.py +++ b/src/cryptography/hazmat/backends/openssl/x509.py @@ -218,8 +218,8 @@ class _Certificate(object): return x509.BasicConstraints(ca, path_length) -@utils.register_interface(x509.CSR) -class _CSR(object): +@utils.register_interface(x509.CertificateSigningRequest) +class _CertificateSigningRequest(object): def __init__(self, backend, x509_req): self._backend = backend self._x509_req = x509_req diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py index d58ca0bb..25bbe9ca 100644 --- a/src/cryptography/x509.py +++ b/src/cryptography/x509.py @@ -343,7 +343,7 @@ class Certificate(object): @six.add_metaclass(abc.ABCMeta) -class CSR(object): +class CertificateSigningRequest(object): @abc.abstractmethod def public_key(self): """ |