pki.serializer.truststore

Serializers for Truststore-related API endpoints.

Defines classes that handle validation and transformation of Truststore model instances to and from JSON.

Classes

TruststoreSerializer

Serializer for Certificate instances.

Module Contents

class pki.serializer.truststore.TruststoreSerializer(instance=None, data=empty, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer[pki.models.truststore.TruststoreModel]

Serializer for Certificate instances.

Handles conversion between Certificate model objects and JSON representations.

unique_name[source]
intended_usage[source]
trust_store_file[source]
class Meta[source]

Metadata for TruststoreSerializer, defining model and serialized fields.

model[source]
fields: ClassVar[list[str]] = ['id', 'unique_name', 'intended_usage', 'created_at', 'trust_store_file'][source]
read_only_fields: ClassVar[list[str]] = ['id'][source]
validate_trust_store_file(file)[source]

Validate uploaded truststore file.

Parameters:

file (django.core.files.uploadedfile.UploadedFile)

Return type:

bytes