Signals

django-ca adds a few custom Django signals to important events to let you execute custom actions when these events happen. Please see Djangos documentation on signals for further information on how to use signals.

If you installed django-ca from source, use the CA_CUSTOM_APPS setting to add a custom django app. Please see the Django documentation on apps if you need help on writing Django apps.

django_ca.signals.post_create_ca = <django.dispatch.dispatcher.Signal object>

Called after a new certificate authority was created.

Parameters
caCertificateAuthority

The certificate authority that was just created.

django_ca.signals.post_issue_cert = <django.dispatch.dispatcher.Signal object>

Called after a new certificate was issued.

Parameters
certCertificate

The certificate that was just issued.

django_ca.signals.post_revoke_cert = <django.dispatch.dispatcher.Signal object>

Called after a certificate was revoked

Parameters
certCertificate

The certificate that was just revoked.

django_ca.signals.post_sign_cert = <django.dispatch.dispatcher.Signal object>

Called after signing a certificate.

Parameters
caCertificateAuthority

The Certificate Authority used to sign the certificate

certCertificate

The raw certificate that was just created.

django_ca.signals.pre_create_ca = <django.dispatch.dispatcher.Signal object>

Called before a new certificate authority is created.

Parameters
namestr

The name of the future CA.

**kwargs
django_ca.signals.pre_issue_cert = <django.dispatch.dispatcher.Signal object>

Called before a new certificate is issued.

Deprecated since version 1.22.0: The signal is deprecated and will be removed in 1.24.0. Use the pre_sign_cert signal instead.

Parameters
ca
csr
**kwargs

All additional parameters passed to create_cert(), but normalized to expected values.

django_ca.signals.pre_revoke_cert = <django.dispatch.dispatcher.Signal object>

Called before a certificate is revoked.

Parameters
ca
csr
**kwargs
django_ca.signals.pre_sign_cert = <django.dispatch.dispatcher.Signal object>

Called before signing a certificate.

Parameters
caCertificateAuthority

The certificate authority used to sign the certificate

csrCertificateSigningRequest

The certificate signing request used for the certificate.

expiresdatetime

When the certificate will expire.

algorithmHashAlgorithm

The algorithm used for signing the certificate.

subjectName

The subject for the certificate.

extensionslist of Extension

The extensions that will be added to the certificate.

passwordstr or bytes, optional

The password used for accessing the private key of the certificate authority.