aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-02-05 09:50:31 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-02-05 09:50:31 -0600
commit858b9b7050105ac7bf7da49924608d8ea0e3ec2f (patch)
treed97c2f01765d226b396c25cbd041b7efa83d51f5
parentd44f9a6cb848c4dd6cc0724df5e5f5e4607a857a (diff)
downloadcryptography-858b9b7050105ac7bf7da49924608d8ea0e3ec2f.tar.gz
cryptography-858b9b7050105ac7bf7da49924608d8ea0e3ec2f.tar.bz2
cryptography-858b9b7050105ac7bf7da49924608d8ea0e3ec2f.zip
add descriptions to each OID constant, update object to instance
-rw-r--r--docs/x509.rst30
-rw-r--r--src/cryptography/x509.py4
2 files changed, 33 insertions, 1 deletions
diff --git a/docs/x509.rst b/docs/x509.rst
index aea084fe..19ff6d76 100644
--- a/docs/x509.rst
+++ b/docs/x509.rst
@@ -220,34 +220,64 @@ following common OIDs are available as constants.
.. data:: OID_COMMON_NAME
+ Corresponds to the dotted string "2.5.4.3".
+
.. data:: OID_COUNTRY_NAME
+ Corresponds to the dotted string "2.5.4.6".
+
.. data:: OID_LOCALITY_NAME
+ Corresponds to the dotted string "2.5.4.7".
+
.. data:: OID_STATE_OR_PROVINCE_NAME
+ Corresponds to the dotted string "2.5.4.8".
+
.. data:: OID_ORGANIZATION_NAME
+ Corresponds to the dotted string "2.5.4.10".
+
.. data:: OID_ORGANIZATIONAL_UNIT_NAME
+ Corresponds to the dotted string "2.5.4.11".
+
.. data:: OID_SERIAL_NUMBER
+ Corresponds to the dotted string "2.5.4.5".
+
.. data:: OID_SURNAME
+ Corresponds to the dotted string "2.5.4.4".
+
.. data:: OID_GIVEN_NAME
+ Corresponds to the dotted string "2.5.4.42".
+
.. data:: OID_TITLE
+ Corresponds to the dotted string "2.5.4.12".
+
.. data:: OID_GENERATION_QUALIFIER
+ Corresponds to the dotted string "2.5.4.44".
+
.. data:: OID_DN_QUALIFIER
+ Corresponds to the dotted string "2.5.4.46".
+
.. data:: OID_PSEUDONYM
+ Corresponds to the dotted string "2.5.4.65".
+
.. data:: OID_DOMAIN_COMPONENT
+ Corresponds to the dotted string "0.9.2342.19200300.100.1.25".
+
.. data:: OID_EMAIL_ADDRESS
+ Corresponds to the dotted string "1.2.840.113549.1.9.1".
+
Exceptions
~~~~~~~~~~
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py
index 7f3ace48..e280980b 100644
--- a/src/cryptography/x509.py
+++ b/src/cryptography/x509.py
@@ -53,7 +53,9 @@ class InvalidVersion(Exception):
class NameAttribute(object):
def __init__(self, oid, value):
if not isinstance(oid, ObjectIdentifier):
- raise TypeError("oid argument must be an ObjectIdentifier object")
+ raise TypeError(
+ "oid argument must be an ObjectIdentifier instance."
+ )
self._oid = oid
self._value = value