signer.formsΒΆ

Contains Logic for Form on Add/Edit Signer Page.

Module ContentsΒΆ

signer.forms.get_private_key_location_from_config()[source]ΒΆ

Determine the appropriate PrivateKeyLocation based on KeyStorageConfig.

Return type:

trustpoint_core.serializer.PrivateKeyLocation

class signer.forms.SignerAddMethodSelectForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)[source]ΒΆ

Bases: django.forms.Form

Form for selecting the method to add a Signer.

method_select[source]ΒΆ
class signer.forms.SignerAddFileTypeSelectForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)[source]ΒΆ

Bases: django.forms.Form

Form for selecting the file type when importing a Signer.

method_select[source]ΒΆ
class signer.forms.SignerAddFileImportPkcs12Form(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)[source]ΒΆ

Bases: trustpoint.logger.LoggerMixin, django.forms.Form

Form for importing an Signer using a PKCS#12 file.

unique_name[source]ΒΆ
pkcs12_file[source]ΒΆ
pkcs12_password[source]ΒΆ
clean_unique_name()[source]ΒΆ

Validates the unique name to ensure it is not already in use.

Return type:

str

clean()[source]ΒΆ

Cleans and validates the entire form.

Return type:

None

class signer.forms.SignerAddFileImportSeparateFilesForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)[source]ΒΆ

Bases: trustpoint.logger.LoggerMixin, django.forms.Form

Form for importing a Signer using separate files.

unique_name[source]ΒΆ
signer_certificate[source]ΒΆ
signer_certificate_chain[source]ΒΆ
private_key_file[source]ΒΆ
private_key_file_password[source]ΒΆ
clean_private_key_file()[source]ΒΆ

Validates and parses the uploaded private key file.

Return type:

trustpoint_core.serializer.PrivateKeySerializer

clean_signer_certificate()[source]ΒΆ

Validates and parses the uploaded signer certificate file.

Return type:

trustpoint_core.serializer.CertificateSerializer

clean_signer_certificate_chain()[source]ΒΆ

Validates and parses the uploaded signer certificate chain file.

Return type:

None | trustpoint_core.serializer.CertificateCollectionSerializer

clean()[source]ΒΆ

Cleans and validates the form data.

Return type:

None

class signer.forms.SignHashForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)[source]ΒΆ

Bases: trustpoint.logger.LoggerMixin, django.forms.Form

Form for signing a hash value with a selected signer.

signer[source]ΒΆ
hash_value[source]ΒΆ
clean()[source]ΒΆ

Validate the hash value format based on the selected signer’s hash algorithm.

Return type:

dict[str, Any]