Certificates

Bases: CryptoParser

A list of one or more certificates

Attributes:
pem_string property
pem_string: str

Returns a string containing the PEM-encoded certificates.

Returns:
  • str

    PEM string containing all the certificates.

from_cryptography classmethod
from_cryptography(crypto_certs: List[x509.Certificate]) -> Certificates

Create a Certificates object from a list of cryptography certificates.

Parameters:
  • crypto_certs (List[x509.Certificate]) –

    List of cryptography certificates.

Returns:
  • Certificates

    Instance of Certificates containing the provided certificates.

from_file classmethod
from_file(file_path: str) -> Certificates

Reads a file containing one or more PEM certificate(s) into a Certificates object.

Parameters:
  • file_path (str) –

    Path and filename of the PEM certificate.

Returns:
  • Certificates

    A Certificates object representing the certificate(s) from file.

from_pem_string classmethod
from_pem_string(pem_string: str) -> Certificates

Create a Certificates object from a PEM string.

Parameters:
  • pem_string (str) –

    PEM string containing certificate(s).

Returns:
from_uri classmethod
from_uri(uris: [str], cache_time_seconds: int = CACHE_TIME_SECONDS) -> Certificates

Loads Certificates from one or more URI(s).

Parameters:
  • uris ([str]) –

    One or more URI(s) where the certificate(s) can be downloaded.

  • cache_time_seconds (int, default: CACHE_TIME_SECONDS ) –

    Specifies how long the certificates should be cached, default is 1 month. Defaults to CACHE_TIME_SECONDS.

Returns:
to_file
to_file(file_path: str) -> None

Saves one or more certificate(s) into a file.

Parameters:
  • file_path (str) –

    Path and filename where to store the certificate(s).