pki.models.truststoreΒΆ

This module defines models for managing trustpoints, including server credentials and truststores.

ClassesΒΆ

ActiveTrustpointTlsServerCredentialModel

Represents the currently active TLS server credential.

TruststoreModel

Represents a truststore, which is a collection of certificates used for specific purposes.

TruststoreOrderModel

Represents the order of certificates in a truststore.

Module ContentsΒΆ

class pki.models.truststore.ActiveTrustpointTlsServerCredentialModel(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Represents the currently active TLS server credential.

This model tracks the active server credential, ensuring that it is always up-to-date and linked to a specific CredentialModel instance.

credential[source]ΒΆ
class Meta[source]ΒΆ

Bases: django_stubs_ext.db.models.TypedModelMeta

Meta class configuration.

__str__()[source]ΒΆ

Returns a human-readable string representation of the active credential.

Returns:

Description of the active TLS server credential.

Return type:

str

save(*args, **kwargs)[source]ΒΆ

Ensures the model instance always has an ID of 1 to enforce singleton-like behavior.

Returns:

None

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

None

class pki.models.truststore.TruststoreModel(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Represents a truststore, which is a collection of certificates used for specific purposes.

This model allows organizing certificates into a logical grouping for specific intended usages such as IDevID, TLS, or Generic. Each truststore is identified by a unique name and supports operations like retrieving the number of certificates or serializing its content.

class IntendedUsage(*args, **kwds)[source]ΒΆ

Bases: django.db.models.IntegerChoices

Intended Usage of the Truststore.

IDEVID[source]ΒΆ
TLS[source]ΒΆ
GENERIC[source]ΒΆ
DEVICE_OWNER_ID[source]ΒΆ
ISSUING_CA_CHAIN[source]ΒΆ
OPC_UA_GDS_PUSH[source]ΒΆ
unique_name[source]ΒΆ
certificates: django.db.models.ManyToManyField[pki.models.certificate.CertificateModel, TruststoreOrderModel][source]ΒΆ
intended_usage[source]ΒΆ
created_at[source]ΒΆ
class Meta[source]ΒΆ

Bases: django_stubs_ext.db.models.TypedModelMeta

Meta class configuration.

__str__()[source]ΒΆ

Returns a human-readable string representation of the TruststoreModel.

Return type:

str

save(**kwargs)[source]ΒΆ

Ensures the model is valid before saving.

Parameters:

kwargs (Any)

Return type:

None

property number_of_certificates: int[source]ΒΆ

Returns the number of certificates in the truststore.

Return type:

int

get_certificate_collection_serializer()[source]ΒΆ

Returns a serializer for all certificates in the truststore.

This method gathers all the certificates associated with the truststore, serializes them using CertificateCollectionSerializer, and returns the serialized result.

Returns:

The serialized representation of the certificates.

Return type:

trustpoint_core.serializer.CertificateCollectionSerializer

class pki.models.truststore.TruststoreOrderModel(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Represents the order of certificates in a truststore.

order[source]ΒΆ
certificate[source]ΒΆ
trust_store[source]ΒΆ
class Meta[source]ΒΆ

Bases: django_stubs_ext.db.models.TypedModelMeta

Meta class configuration.

unique_together = ('order', 'trust_store')[source]ΒΆ
__str__()[source]ΒΆ

Returns a human-readable string representation of the TruststoreOrderModel.

Return type:

str