commands.create_and_validate_test_certs

Management command to create some certificates for testing and verifying them using OpenSSL.

Classes

Command

Creates a certificate chain and validates it uing OpenSSL.

Module Contents

class commands.create_and_validate_test_certs.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: commands.base_commands.CertificateCreationCommandMixin, django.core.management.base.BaseCommand

Creates a certificate chain and validates it uing OpenSSL.

help = 'Creates a certificate chain and validates it uing OpenSSL.'[source]
_create_cert_chain(algorithm, path)[source]
Parameters:
  • algorithm (trustpoint_core.oid.PublicKeyInfo)

  • path (pathlib.Path)

Return type:

None

classmethod _create_certificate(common_name, algorithm, path, issuer=None, issuer_priv_key=None, validity_days=365)[source]
Parameters:
  • common_name (str)

  • algorithm (trustpoint_core.oid.PublicKeyInfo)

  • path (pathlib.Path)

  • issuer (None | cryptography.x509.Certificate)

  • issuer_priv_key (None | cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey | cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKey)

  • validity_days (int)

Return type:

tuple[str, cryptography.x509.Certificate, cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey | cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKey]

static _create_trust_store(algorithms, path)[source]
Parameters:
  • algorithms (list[trustpoint_core.oid.PublicKeyInfo])

  • path (pathlib.Path)

Return type:

None

handle(*_args, **_kwargs)[source]

Executes the command.

Parameters:
  • _args (tuple[str])

  • _kwargs (dict[str, str])

Return type:

None