aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2018-10-31 09:23:29 +0800
committerAlex Gaynor <alex.gaynor@gmail.com>2018-10-30 21:23:29 -0400
commit95af1e391b7155ebffd962b58f0a2b213af33ec3 (patch)
treec2c434cfdca838f1695f30de398dc578dae9e5d5
parent8f24aefd5d136ab47cb68a9bcfbff3a171602077 (diff)
downloadcryptography-95af1e391b7155ebffd962b58f0a2b213af33ec3.tar.gz
cryptography-95af1e391b7155ebffd962b58f0a2b213af33ec3.tar.bz2
cryptography-95af1e391b7155ebffd962b58f0a2b213af33ec3.zip
add EC OIDs (#4435)
* add EC OIDs * move ec oid docs to bottom
-rw-r--r--docs/hazmat/primitives/asymmetric/ec.rst32
-rw-r--r--src/cryptography/hazmat/primitives/asymmetric/ec.py10
2 files changed, 42 insertions, 0 deletions
diff --git a/docs/hazmat/primitives/asymmetric/ec.rst b/docs/hazmat/primitives/asymmetric/ec.rst
index e36a5a14..08a4999b 100644
--- a/docs/hazmat/primitives/asymmetric/ec.rst
+++ b/docs/hazmat/primitives/asymmetric/ec.rst
@@ -777,6 +777,38 @@ in PEM format.
... )
+Elliptic Curve Object Identifiers
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. class:: EllipticCurveOID
+
+ .. versionadded:: 2.4
+
+ .. attribute:: SECP192R1
+
+ Corresponds to the dotted string ``"1.2.840.10045.3.1.1"``.
+
+ .. attribute:: SECP224R1
+
+ Corresponds to the dotted string ``"1.3.132.0.33"``.
+
+ .. attribute:: SECP256K1
+
+ Corresponds to the dotted string ``"1.3.132.0.10"``.
+
+ .. attribute:: SECP256R1
+
+ Corresponds to the dotted string ``"1.2.840.10045.3.1.7"``.
+
+ .. attribute:: SECP384R1
+
+ Corresponds to the dotted string ``"1.3.132.0.34"``.
+
+ .. attribute:: SECP521R1
+
+ Corresponds to the dotted string ``"1.3.132.0.35"``.
+
+
.. _`FIPS 186-3`: https://csrc.nist.gov/csrc/media/publications/fips/186/3/archive/2009-06-25/documents/fips_186-3.pdf
.. _`FIPS 186-4`: https://csrc.nist.gov/publications/detail/fips/186/4/final
.. _`800-56A`: https://csrc.nist.gov/publications/detail/sp/800-56a/revised/archive/2007-03-14
diff --git a/src/cryptography/hazmat/primitives/asymmetric/ec.py b/src/cryptography/hazmat/primitives/asymmetric/ec.py
index e2e55e9e..431ecb79 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/ec.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/ec.py
@@ -9,6 +9,16 @@ import abc
import six
from cryptography import utils
+from cryptography.hazmat._oid import ObjectIdentifier
+
+
+class EllipticCurveOID(object):
+ SECP192R1 = ObjectIdentifier("1.2.840.10045.3.1.1")
+ SECP224R1 = ObjectIdentifier("1.3.132.0.33")
+ SECP256K1 = ObjectIdentifier("1.3.132.0.10")
+ SECP256R1 = ObjectIdentifier("1.2.840.10045.3.1.7")
+ SECP384R1 = ObjectIdentifier("1.3.132.0.34")
+ SECP521R1 = ObjectIdentifier("1.3.132.0.35")
@six.add_metaclass(abc.ABCMeta)