From d44f9a6cb848c4dd6cc0724df5e5f5e4607a857a Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 4 Feb 2015 14:47:34 -0600 Subject: rename ObjectIdentifier.value to dotted_string --- docs/x509.rst | 2 +- src/cryptography/x509.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/x509.rst b/docs/x509.rst index 9406bd88..aea084fe 100644 --- a/docs/x509.rst +++ b/docs/x509.rst @@ -206,7 +206,7 @@ X.509 Certificate Object Object identifiers (frequently seen abbreviated as OID) identify the type of a value (see: :class:`NameAttribute`). - .. attribute:: value + .. attribute:: dotted_string :type: :class:`str` diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py index 1b8d6357..7f3ace48 100644 --- a/src/cryptography/x509.py +++ b/src/cryptography/x509.py @@ -75,24 +75,25 @@ class NameAttribute(object): class ObjectIdentifier(object): - def __init__(self, oid): - self._value = oid + def __init__(self, dotted_string): + self._dotted_string = dotted_string def __eq__(self, other): if not isinstance(other, ObjectIdentifier): return NotImplemented - return self._value == other._value + return self._dotted_string == other._dotted_string def __ne__(self, other): return not self == other def __repr__(self): return "".format( - self._value, _OID_NAMES.get(self._value, "Unknown OID") + self._dotted_string, + _OID_NAMES.get(self._dotted_string, "Unknown OID") ) - value = utils.read_only_property("_value") + dotted_string = utils.read_only_property("_dotted_string") OID_COMMON_NAME = ObjectIdentifier("2.5.4.3") -- cgit v1.2.3