From 58b756969211e2972fb6fda44582e55b98c02924 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sun, 22 Mar 2015 23:24:58 -0500 Subject: doc updates and simplification of __repr__ --- docs/x509.rst | 7 +++++-- src/cryptography/x509.py | 12 ++++-------- 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 ("").format( - oid=self.oid, critical=self.critical, value=self.value - ) + return ("").format(self) class BasicConstraints(object): @@ -191,10 +189,8 @@ class BasicConstraints(object): path_length = utils.read_only_property("_path_length") def __repr__(self): - return ("").format( - ca=self.ca, path_length=self.path_length - ) + return ("").format(self) OID_COMMON_NAME = ObjectIdentifier("2.5.4.3") -- cgit v1.2.3