pki.models.domainΒΆ

Module that contains the DomainModel.

ClassesΒΆ

DomainModel

Domain Model.

DomainAllowedCertificateProfileModel

Model representing allowed certificate profiles for a domain.

Module ContentsΒΆ

class pki.models.domain.DomainModel(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Domain Model.

unique_name[source]ΒΆ
issuing_ca[source]ΒΆ
is_active[source]ΒΆ
created_at[source]ΒΆ
updated_at[source]ΒΆ
__repr__()[source]ΒΆ

Machine-readable representation of the Domain model instance.

Returns:

Machine-readable representation of the Domain model model instance.

Return type:

str

__str__()[source]ΒΆ

Human-readable representation of the Domain model instance.

Returns:

Human-readable representation of the Domain model model instance.

Return type:

str

save(**kwargs)[source]ΒΆ

Save the Domain model and add default certificate profiles.

Parameters:

kwargs (Any)

Return type:

None

property signature_suite: trustpoint_core.oid.SignatureSuite[source]ΒΆ

Get the signature suite for the domain (based on its Issuing CA).

Return type:

trustpoint_core.oid.SignatureSuite

property public_key_info: trustpoint_core.oid.PublicKeyInfo[source]ΒΆ

Get the public key info for the domain (based on its Issuing CA).

Return type:

trustpoint_core.oid.PublicKeyInfo

clean()[source]ΒΆ

Validate that the issuing CA is not an auto-generated root CA.

Return type:

None

get_issuing_ca_or_value_error()[source]ΒΆ

Gets the corresponding Issuing CA.

Returns:

The corresponding Issuing CA.

Raises:

ValueError – If no Issuing CA is set.

Return type:

pki.models.CaModel

get_allowed_cert_profiles()[source]ΒΆ

Gets the allowed certificate profiles for this domain.

Returns:

QuerySet of allowed DomainAllowedCertificateProfileModel instances.

Return type:

django.db.models.QuerySet[DomainAllowedCertificateProfileModel]

get_allowed_cert_profile_names()[source]ΒΆ

Gets the set of allowed certificate profile names for this domain.

Returns:

Set of allowed certificate profile names.

Return type:

set[str]

get_allowed_cert_profile(cert_profile_str)[source]ΒΆ

Gets the requested certificate profile if it is allowed for this domain. Else, raises a ValueError.

Parameters:

cert_profile_str (str) – The name of the certificate profile to check.

Returns:

The requested CertificateProfileModel (if allowed).

Return type:

pki.models.cert_profile.CertificateProfileModel

set_allowed_cert_profiles(allowed_profile_data)[source]ΒΆ

Sets the certificate profiles allowed in the domain.

Parameters:

allowed_profile_data (dict[str, str]) – Dict where key is allowed certificate profile ID (str) and value is optional alias

Returns:

Set of rejected aliases due to duplication in the form of (alias, profile unique name)

Return type:

set[tuple[str, str]]

_add_default_profiles()[source]ΒΆ

Adds default certificate profiles to the domain as allowed.

Return type:

None

class pki.models.domain.DomainAllowedCertificateProfileModel(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Model representing allowed certificate profiles for a domain.

domain[source]ΒΆ
certificate_profile[source]ΒΆ
alias[source]ΒΆ
class Meta[source]ΒΆ

Bases: django_stubs_ext.db.models.TypedModelMeta

Meta information.

constraints: ClassVar[source]ΒΆ
__str__()[source]ΒΆ

String representation of the DomainAllowedCertificateProfileModel.

Return type:

str