django_ca.views - HTTP endpoints

Views for the django-ca app.

class django_ca.views.GenericCAIssuersView(**kwargs)[source]

Generic view that returns a CA public key in DER format.

This view serves the URL named in the issuers key in the AuthorityInformationAccess extension.

class django_ca.views.OCSPBaseView(**kwargs)[source]

View to provide an OCSP responder.

django-ca currently provides two OCSP implementations, one using cryptography>=2.4 and one using oscrypto for older versions of cryptography that do not support OCSP. This is a base view that provides some generic settings and common functions to both implementations.

Note that providing the responder key or certificate using an absolute path is deprecated for the Django file storage API. Please see Update to 1.12.0 or later for more information.

ca = None

The name or serial of your Certificate Authority.

ca_ocsp = False

If set to True, validate child CAs instead.

expires = 600

Time in seconds that the responses remain valid. The default is 600 seconds or ten minutes.

responder_cert = None

Public key of the responder.

This may either be:

  • A relative path used by CA_FILE_STORAGE

  • Deprecated: An absolute path on the local filesystem

  • A serial of a certificate as stored in the database

  • The PEM of the certificate as string

  • A loaded Certificate

responder_key = None

Private key used for signing OCSP responses. Either a relative path used by CA_FILE_STORAGE or (deprecated) an absolute path on the local filesystem.

class django_ca.views.OCSPView(**kwargs)[source]

View providing OCSP functionality.

Depending on the cryptography version used, this view might use either cryptography or oscrypto.