pki.models.issued_credentialΒΆ
A model for issued credentials.
Module ContentsΒΆ
- class pki.models.issued_credential.IssuedCredentialModel(*args, **kwargs)[source]ΒΆ
Bases:
util.db.CustomDeleteActionModelModel for credentials and certificates issued to a device by the Trustpoint.
Each instance must have a
deviceFK set. For credentials owned by a CA or an OwnerCredential, useRemoteIssuedCredentialModelinstead.- class IssuedCredentialType(*args, **kwds)[source]ΒΆ
Bases:
django.db.models.IntegerChoicesThe type of the credential.
- revoke()[source]ΒΆ
Revokes all active certificates associated with this credential.
- Return type:
None
- is_valid_domain_credential()[source]ΒΆ
Determines if this issued credential is valid for enrolling new application credentials.
- This method performs the following checks:
The IssuedCredentialModel type must be of type DOMAIN_CREDENTIAL.
The credential must be of type ISSUED_CREDENTIAL.
A primary certificate must exist.
The certificateβs status must be βOKβ.
- Returns:
- A tuple where:
The first value is True if the credential meets all criteria, False otherwise.
The second value is a reason string explaining why the credential is invalid.
- Return type:
tuple[bool, str]
- static get_credential_for_certificate(cert)[source]ΒΆ
Retrieve an IssuedCredentialModel instance for the given certificate.
- Parameters:
cert (cryptography.x509.Certificate) β x509.Certificate to search for.
- Returns:
The corresponding IssuedCredentialModel instance.
- Raises:
DoesNotExist β if no matching issued credential is found.
- Return type:
- static get_credential_for_serial_number(domain, device, serial_number)[source]ΒΆ
Retrieve an IssuedCredentialModel instance for the given X.509 serial number within the specified domain.
Raises: DoesNotExist if no matching issued credential is found.
- Parameters:
domain (pki.models.domain.DomainModel)
device (devices.models.DeviceModel)
serial_number (str)
- Return type:
- class pki.models.issued_credential.RemoteIssuedCredentialModel(*args, **kwargs)[source]ΒΆ
Bases:
util.db.CustomDeleteActionModelModel for credentials issued to a CA, a DevOwnerID, or a device via a remote/RA CA.
- class RemoteIssuedCredentialType(*args, **kwds)[source]ΒΆ
Bases:
django.db.models.IntegerChoicesThe type of the credential.