django_ca.extensions - X509 extensions

This module provides some small helper functions for handling extensions.

django_ca.extensions.get_extension_name(oid: ObjectIdentifier) str[source]

Function to get the name of an extension from the extensions OID.

>>> from cryptography.x509.oid import ExtensionOID
>>> get_extension_name(ExtensionOID.BASIC_CONSTRAINTS)
'Basic Constraints'
>>> get_extension_name(x509.ObjectIdentifier("1.2.3"))
'Unknown extension (1.2.3)'