aoki.tests.cmp_clientΒΆ

AOKI Client for testing AOKI via CMP.

Please run from /rootdir/trustpoint with β€œuv run -m aoki.tests.cmp_client” for paths and imports to work. This only works if your system OpenSSL version is 3.x.

AttributesΒΆ

ExceptionsΒΆ

AokiClientOwnerIdCertVerificationError

Exception raised when the provided Owner ID certificate is invalid or not corresponding to the IDevID.

AokiClientCertLoadError

Exception raised when a certificate could not be loaded from the provided path.

ClassesΒΆ

AokiCmpClient

AOKI-CMP Client for testing purposes.

Module ContentsΒΆ

aoki.tests.cmp_client.log[source]ΒΆ
aoki.tests.cmp_client.CURRENT_DIR[source]ΒΆ
aoki.tests.cmp_client.CERTS_DIR[source]ΒΆ
exception aoki.tests.cmp_client.AokiClientOwnerIdCertVerificationError[source]ΒΆ

Bases: Exception

Exception raised when the provided Owner ID certificate is invalid or not corresponding to the IDevID.

exception aoki.tests.cmp_client.AokiClientCertLoadError[source]ΒΆ

Bases: Exception

Exception raised when a certificate could not be loaded from the provided path.

class aoki.tests.cmp_client.AokiCmpClient(server_url, cert_file, key_file, owner_truststore_file, idevid_truststore_file, *args, **kwargs)[source]ΒΆ

AOKI-CMP Client for testing purposes.

Parameters:
  • server_url (str)

  • cert_file (str)

  • key_file (str)

  • owner_truststore_file (str)

  • idevid_truststore_file (str)

  • args (str)

  • kwargs (str)

idevid_subj_sn: str = '_'[source]ΒΆ
static _load_certificate(cert_path)[source]ΒΆ
Parameters:

cert_path (pathlib.Path)

Return type:

cryptography.x509.Certificate

static _load_certificates(cert_path)[source]ΒΆ
Parameters:

cert_path (pathlib.Path)

Return type:

list[cryptography.x509.Certificate]

_get_idevid_owner_san_uri(idevid_cert)[source]ΒΆ

Get the Owner ID SAN URI corresponding to a IDevID certificate.

Formatted as β€œdev-owner:<idevid_subj_sn>.<idevid_x509_sn>.<idevid_sha256_fingerprint>”

Parameters:

idevid_cert (cryptography.x509.Certificate)

Return type:

str

_verify_matches_idevid_cert(owner_id_cert, idevid_cert)[source]ΒΆ

Verify the Owner ID certificate is valid for the device IDevID.

Parameters:
  • owner_id_cert (cryptography.x509.Certificate)

  • idevid_cert (cryptography.x509.Certificate)

Return type:

None

server_url[source]ΒΆ
cert_file[source]ΒΆ
key_file[source]ΒΆ
owner_truststore_file[source]ΒΆ
idevid_truststore_file[source]ΒΆ
args = ()[source]ΒΆ
kwargs[source]ΒΆ
onboard()[source]ΒΆ

Run the AOKI-CMP Zero-Touch Device Onboarding process.

Return type:

None

aoki.tests.cmp_client.client[source]ΒΆ