From e1f7e0978231f73382f95b864200fdeca7d37bb7 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 21 Feb 2019 12:53:45 +0800 Subject: add an EC OID to curve dictionary mapping (#4759) * add an EC OID to curve dictionary mapping * oid_to_curve function * changelog and docs fix * rename to get_curve_for_oid --- docs/hazmat/primitives/asymmetric/ec.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs/hazmat/primitives/asymmetric') diff --git a/docs/hazmat/primitives/asymmetric/ec.rst b/docs/hazmat/primitives/asymmetric/ec.rst index d89fde3d..0035e5b0 100644 --- a/docs/hazmat/primitives/asymmetric/ec.rst +++ b/docs/hazmat/primitives/asymmetric/ec.rst @@ -926,6 +926,21 @@ Elliptic Curve Object Identifiers Corresponds to the dotted string ``"1.3.132.0.39"``. +.. function:: get_curve_for_oid(oid) + + .. versionadded:: 2.6 + + A function that takes an :class:`~cryptography.x509.ObjectIdentifier` + and returns the associated elliptic curve class. + + :param oid: An instance of + :class:`~cryptography.x509.ObjectIdentifier`. + + :returns: The matching elliptic curve class. The returned class conforms + to the :class:`EllipticCurve` interface. + + :raises LookupError: Raised if no elliptic curve is found that matches + the provided object identifier. .. _`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 -- cgit v1.2.3