help_pages.commands

This module contains cli commands which are displayed in the help pages.

Classes

KeyGenCommandBuilder

Gets key-generation commands.

CmpSharedSecretCommandBuilder

Builds CMP shared-secret commands for different certificate profiles.

EstUsernamePasswordCommandBuilder

Builds EST username-password commands for different certificate profiles.

CmpClientCertificateCommandBuilder

Builds CMP client-certificate (domain credential auth) commands for different certificate profiles.

EstClientCertificateCommandBuilder

Builds EST username-password commands for different certificate profiles.

Module Contents

class help_pages.commands.KeyGenCommandBuilder[source]

Gets key-generation commands.

static get_key_gen_command(public_key_info, cred_number, key_name='')[source]

Gets the key generation command corresponding to the provided type.

Parameters:
  • public_key_info (trustpoint_core.oid.PublicKeyInfo) – Key type information.

  • cred_number (int) – The credential number to use.

  • key_name (str) – Custom key file name, will default to key-{ cred_number }.pem otherwise.

Raises:

ValueError – If the public key information is inconsistent or key type is not supported.

Returns:

The key generation command as string.

Return type:

str

class help_pages.commands.CmpSharedSecretCommandBuilder[source]

Builds CMP shared-secret commands for different certificate profiles.

static get_dynamic_cert_profile_command(host, pk, shared_secret, cred_number, sample_request)[source]

Gets the dynamic certificate profile command.

Parameters:
  • host (str) – The full host name and url path, e.g. https://127.0.0.1/.well-known./cmp/p/

  • pk (int) – The primary key of the device in question used as Key Identifier (KID).

  • shared_secret (str) – The shared secret.

  • cred_number (int) – The credential number - counter of issued credentials.

  • sample_request (dict[str, Any]) – The sample certificate request in JSON format.

Returns:

The constructed command.

Return type:

str

static get_domain_credential_profile_command(host, pk, shared_secret)[source]

Get the domain credential profile command.

Parameters:
  • host (str) – The full host name and url path, e.g. https://127.0.0.1/.well-known./cmp/p/

  • pk (int) – The primary key of the device in question used as Key Identifier (KID).

  • shared_secret (str) – The shared secret.

  • domain_name – The name of the domain will be used in the file names to mitigate overriding other files.

Returns:

The constructed command.

Return type:

str

class help_pages.commands.EstUsernamePasswordCommandBuilder[source]

Builds EST username-password commands for different certificate profiles.

static get_dynamic_cert_profile_command(cred_number, sample_request)[source]

Gets the dynamic certificate profile command.

Parameters:
  • host – The full host name and url path, e.g. https://127.0.0.1/.well-known./cmp/p/

  • pk – The primary key of the device in question used as Key Identifier (KID).

  • shared_secret – The shared secret.

  • cred_number (int) – The credential number - counter of issued credentials.

  • sample_request (dict[str, Any]) – The sample certificate request in JSON format.

Returns:

The constructed command.

Return type:

str

static get_curl_enroll_command(est_username, est_password, host, cred_number)[source]

Get the curl enroll command.

Parameters:
  • est_username (str) – The EST username to use.

  • est_password (str) – The EST password to use.

  • host (str) – The full host name and url path, e.g. https://127.0.0.1/.well-known./cmp/p/

  • cred_number (int) – The credential number - counter of issued credentials.

Returns:

The constructed command.

Return type:

str

static get_conversion_p7_pem_command(cred_number)[source]

Get the conversion PKCS#7 (DER) to PEM command.

Parameters:

cred_number (int) – The credential number - counter of issued credentials.

Returns:

The constructed command.

Return type:

str

static get_domain_credential_profile_command()[source]

Get the domain credential profile command.

Returns:

The constructed command.

Return type:

str

static get_curl_enroll_domain_credential_command(est_username, est_password, host)[source]

Get the curl domain credential command.

Parameters:
  • est_username (str) – The EST username to use.

  • est_password (str) – The EST password to use.

  • host (str) – The full host name and url path, e.g. https://127.0.0.1/.well-known./cmp/p/

Returns:

The constructed command.

Return type:

str

static get_domain_credential_conversion_p7_pem_command()[source]

Get the domain credential conversion DER to PEM command.

Returns:

The constructed command.

Return type:

str

class help_pages.commands.CmpClientCertificateCommandBuilder[source]

Builds CMP client-certificate (domain credential auth) commands for different certificate profiles.

static get_dynamic_cert_profile_command(host, cred_number, sample_request)[source]

Gets the dynamic certificate profile command.

Parameters:
  • host (str) – The full host name and url path, e.g. https://127.0.0.1/.well-known./cmp/p/

  • pk – The primary key of the device in question used as Key Identifier (KID).

  • shared_secret – The shared secret.

  • cred_number (int) – The credential number - counter of issued credentials.

  • sample_request (dict[str, Any]) – The sample certificate request in JSON format.

Returns:

The constructed command.

Return type:

str

static get_idevid_domain_credential_command(host)[source]

Gets the idevid domain credential command.

Parameters:

host (str) – The full host name and url path, e.g. https://127.0.0.1/.well-known./cmp/p/

Returns:

The constructed command.

Return type:

str

class help_pages.commands.EstClientCertificateCommandBuilder[source]

Builds EST username-password commands for different certificate profiles.

static get_domain_credential_profile_command()[source]

Get the domain credential profile command.

Returns:

The constructed command.

Return type:

str

static get_curl_enroll_application_credential(cred_number, host)[source]

Get the curl enroll application credential command.

Parameters:
Returns:

The constructed command.

Return type:

str

static get_idevid_gen_csr_command()[source]

Gets the IDevID gen CSR command.

Returns:

The constructed command.

Return type:

str

static get_idevid_enroll_domain_credential_command(host)[source]

Gets the IDevID enroll domain credential command.

Parameters:

host (str) – The full host name and url path, e.g. https://127.0.0.1/.well-known./est/

Returns:

The constructed command.

Return type:

str

static get_idevid_der_pem_conversion_command()[source]

Gets the IDevID DER to PEM conversion command.

Returns:

The constructed command.

Return type:

str

static get_idevid_ca_certs_command(host)[source]

Gets the IDevID ca certs command.

Parameters:

host (str) – The full host name and url path, e.g. https://127.0.0.1/.well-known./est/

Returns:

The constructed command.

Return type:

str

static get_idevid_pkcs7_pem_conversion_command()[source]

Gets the IDevID PKCS#7 to PEM conversion command.

Returns:

The constructed command.

Return type:

str