request.tests.openssl_cmp_factoryΒΆ

AttributesΒΆ

ClassesΒΆ

CMPCommandComponent

Abstract base class for CMP command components.

BasicCMPArgs

Basic CMP command arguments.

ServerConfig

Server configuration component.

SharedSecretAuth

Shared secret authentication component.

CertificateAuth

Certificate authentication component.

CertificateRequest

Certificate request parameters component.

ServerCertificate

Server certificate component.

CertificateOutput

Certificate output options component.

CompositeCMPCommand

Composite CMP command that combines multiple components.

Module ContentsΒΆ

class request.tests.openssl_cmp_factory.CMPCommandComponent[source]ΒΆ

Bases: abc.ABC

Abstract base class for CMP command components.

abstractmethod build_args(context)[source]ΒΆ

Build command arguments for this component.

Parameters:

context (dict[str, Any])

Return type:

list[str]

abstractmethod prepare_files(temp_dir, context)[source]ΒΆ

Prepare any files needed for this component. Returns list of created files.

Parameters:
  • temp_dir (str)

  • context (dict[str, Any])

Return type:

list[str]

abstractmethod get_description()[source]ΒΆ

Get human-readable description of this component.

Return type:

str

class request.tests.openssl_cmp_factory.BasicCMPArgs(cmd='cr', implicit_confirm=True)[source]ΒΆ

Bases: CMPCommandComponent

Basic CMP command arguments.

Parameters:
  • cmd (str)

  • implicit_confirm (bool)

cmd = 'cr'[source]ΒΆ
implicit_confirm = True[source]ΒΆ
build_args(context)[source]ΒΆ

Build command arguments for this component.

Parameters:

context (dict[str, Any])

Return type:

list[str]

prepare_files(temp_dir, context)[source]ΒΆ

Prepare any files needed for this component. Returns list of created files.

Parameters:
  • temp_dir (str)

  • context (dict[str, Any])

Return type:

list[str]

get_description()[source]ΒΆ

Get human-readable description of this component.

Return type:

str

class request.tests.openssl_cmp_factory.ServerConfig(server_url, tls_used=False)[source]ΒΆ

Bases: CMPCommandComponent

Server configuration component.

Parameters:
  • server_url (str)

  • tls_used (bool)

server_url[source]ΒΆ
tls_used = False[source]ΒΆ
build_args(context)[source]ΒΆ

Build command arguments for this component.

Parameters:

context (dict[str, Any])

Return type:

list[str]

prepare_files(temp_dir, context)[source]ΒΆ

Prepare any files needed for this component. Returns list of created files.

Parameters:
  • temp_dir (str)

  • context (dict[str, Any])

Return type:

list[str]

get_description()[source]ΒΆ

Get human-readable description of this component.

Return type:

str

class request.tests.openssl_cmp_factory.SharedSecretAuth(ref, secret)[source]ΒΆ

Bases: CMPCommandComponent

Shared secret authentication component.

Parameters:
  • ref (str)

  • secret (str)

ref[source]ΒΆ
secret[source]ΒΆ
build_args(context)[source]ΒΆ

Build command arguments for this component.

Parameters:

context (dict[str, Any])

Return type:

list[str]

prepare_files(temp_dir, context)[source]ΒΆ

Prepare any files needed for this component. Returns list of created files.

Parameters:
  • temp_dir (str)

  • context (dict[str, Any])

Return type:

list[str]

get_description()[source]ΒΆ

Get human-readable description of this component.

Return type:

str

class request.tests.openssl_cmp_factory.CertificateAuth(cert_content=None, key_content=None, cert_file=None, key_file=None)[source]ΒΆ

Bases: CMPCommandComponent

Certificate authentication component.

Parameters:
  • cert_content (str)

  • key_content (str)

  • cert_file (str)

  • key_file (str)

cert_content = Multiline-String[source]ΒΆ
Show Value
"""-----BEGIN CERTIFICATE-----
MOCK_CERTIFICATE_DATA
-----END CERTIFICATE-----
"""
key_content = Multiline-String[source]ΒΆ
Show Value
"""-----BEGIN PRIVATE KEY-----
MOCK_KEY_DATA
-----END PRIVATE KEY-----
"""
cert_file = '/tmp/domain_credential_cert.pem'[source]ΒΆ
key_file = '/tmp/domain_credential_key.pem'[source]ΒΆ
build_args(context)[source]ΒΆ

Build command arguments for this component.

Parameters:

context (dict[str, Any])

Return type:

list[str]

prepare_files(temp_dir, context)[source]ΒΆ

Prepare any files needed for this component. Returns list of created files.

Parameters:
  • temp_dir (str)

  • context (dict[str, Any])

Return type:

list[str]

get_description()[source]ΒΆ

Get human-readable description of this component.

Return type:

str

class request.tests.openssl_cmp_factory.CertificateRequest(subject, days=10, sans=None, policy_oids=None, key_file=None, cert_out_file=None)[source]ΒΆ

Bases: CMPCommandComponent

Certificate request parameters component.

Parameters:
  • subject (str)

  • days (int)

  • sans (str)

  • policy_oids (str)

  • key_file (str)

  • cert_out_file (str)

subject[source]ΒΆ
days = 10[source]ΒΆ
sans = None[source]ΒΆ
policy_oids = None[source]ΒΆ
key_file = '/tmp/key.pem'[source]ΒΆ
cert_out_file = '/tmp/cert.pem'[source]ΒΆ
build_args(context)[source]ΒΆ

Build command arguments for this component.

Parameters:

context (dict[str, Any])

Return type:

list[str]

prepare_files(temp_dir, context)[source]ΒΆ

Prepare any files needed for this component. Returns list of created files.

Parameters:
  • temp_dir (str)

  • context (dict[str, Any])

Return type:

list[str]

get_description()[source]ΒΆ

Get human-readable description of this component.

Return type:

str

class request.tests.openssl_cmp_factory.ServerCertificate(cert_content=None, srvcert_file=None)[source]ΒΆ

Bases: CMPCommandComponent

Server certificate component.

Parameters:
  • cert_content (str)

  • srvcert_file (str)

cert_content = Multiline-String[source]ΒΆ
Show Value
"""-----BEGIN CERTIFICATE-----
MOCK_SRVCERT_DATA
-----END CERTIFICATE-----
"""
srvcert_file = '/tmp/issuing_ca_cert.pem'[source]ΒΆ
build_args(context)[source]ΒΆ

Build command arguments for this component.

Parameters:

context (dict[str, Any])

Return type:

list[str]

prepare_files(temp_dir, context)[source]ΒΆ

Prepare any files needed for this component. Returns list of created files.

Parameters:
  • temp_dir (str)

  • context (dict[str, Any])

Return type:

list[str]

get_description()[source]ΒΆ

Get human-readable description of this component.

Return type:

str

class request.tests.openssl_cmp_factory.CertificateOutput(chain_out=False, extra_certs_out=False, chain_out_file=None, extra_certs_out_file=None)[source]ΒΆ

Bases: CMPCommandComponent

Certificate output options component.

Parameters:
  • chain_out (bool)

  • extra_certs_out (bool)

  • chain_out_file (str)

  • extra_certs_out_file (str)

chain_out = False[source]ΒΆ
extra_certs_out = False[source]ΒΆ
chain_out_file = '/tmp/chain_without_root.pem'[source]ΒΆ
extra_certs_out_file = '/tmp/full_chain.pem'[source]ΒΆ
build_args(context)[source]ΒΆ

Build command arguments for this component.

Parameters:

context (dict[str, Any])

Return type:

list[str]

prepare_files(temp_dir, context)[source]ΒΆ

Prepare any files needed for this component. Returns list of created files.

Parameters:
  • temp_dir (str)

  • context (dict[str, Any])

Return type:

list[str]

get_description()[source]ΒΆ

Get human-readable description of this component.

Return type:

str

class request.tests.openssl_cmp_factory.CompositeCMPCommand(name, description=None)[source]ΒΆ

Bases: CMPCommandComponent

Composite CMP command that combines multiple components.

Parameters:
  • name (str)

  • description (str)

name[source]ΒΆ
description[source]ΒΆ
components: list[CMPCommandComponent] = [][source]ΒΆ
add_component(component)[source]ΒΆ

Add a component to this composite command.

Parameters:

component (CMPCommandComponent)

Return type:

CompositeCMPCommand

build_args(context=None)[source]ΒΆ

Build complete command arguments from all components.

Parameters:

context (dict[str, Any])

Return type:

list[str]

prepare_files(temp_dir, context)[source]ΒΆ

Prepare all files needed by all components.

Parameters:
  • temp_dir (str)

  • context (dict[str, Any])

Return type:

list[str]

get_description()[source]ΒΆ

Get complete description of this composite command.

Return type:

str

__str__()[source]ΒΆ

String representation of the composite command.

Return type:

str

__repr__()[source]ΒΆ

Detailed representation of the composite command.

Return type:

str

request.tests.openssl_cmp_factory.command[source]ΒΆ