aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-03-22 23:24:58 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-03-22 23:24:58 -0500
commit58b756969211e2972fb6fda44582e55b98c02924 (patch)
tree9be2079608a0755f2590d199a479ef9906b5c0b9
parent611d3d36fb1e33582eefc81cc241140d7a69f733 (diff)
downloadcryptography-58b756969211e2972fb6fda44582e55b98c02924.tar.gz
cryptography-58b756969211e2972fb6fda44582e55b98c02924.tar.bz2
cryptography-58b756969211e2972fb6fda44582e55b98c02924.zip
doc updates and simplification of __repr__
-rw-r--r--docs/x509.rst7
-rw-r--r--src/cryptography/x509.py12
2 files changed, 9 insertions, 10 deletions
diff --git a/docs/x509.rst b/docs/x509.rst
index 751e077c..36e9fab3 100644
--- a/docs/x509.rst
+++ b/docs/x509.rst
@@ -284,13 +284,16 @@ X.509 Extensions
:type: :class:`ObjectIdentifier`
- The attribute OID.
+ The extension OID.
.. attribute:: critical
:type: bool
- Determines whether a given extension is critical or not.
+ Determines whether a given extension is critical or not. :rfc:`5280`
+ requires that "A certificate-using system MUST reject the certificate
+ if it encounters a critical extension it does not recognize or a
+ critical extension that contains information that it cannot process".
.. attribute:: value
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py
index 4ba6956e..0c773dac 100644
--- a/src/cryptography/x509.py
+++ b/src/cryptography/x509.py
@@ -164,10 +164,8 @@ class Extension(object):
value = utils.read_only_property("_value")
def __repr__(self):
- return ("<Extension(oid={oid}, "
- "critical={critical}, value={value})>").format(
- oid=self.oid, critical=self.critical, value=self.value
- )
+ return ("<Extension(oid={0.oid}, critical={0.critical}, "
+ "value={0.value})>").format(self)
class BasicConstraints(object):
@@ -191,10 +189,8 @@ class BasicConstraints(object):
path_length = utils.read_only_property("_path_length")
def __repr__(self):
- return ("<BasicConstraints(ca={ca}, "
- "path_length={path_length})>").format(
- ca=self.ca, path_length=self.path_length
- )
+ return ("<BasicConstraints(ca={0.ca}, "
+ "path_length={0.path_length})>").format(self)
OID_COMMON_NAME = ObjectIdentifier("2.5.4.3")