tiny_ca.ca_factory.utils.afile_loader module¶
- class tiny_ca.ca_factory.utils.afile_loader.AsyncCAFileLoader(ca_cert_path, ca_key_path, ca_key_password=None, logger=None)[source]¶
Bases:
objectLoads a CA certificate and private key from PEM files on the local filesystem.
Responsibility: file reading and PEM deserialisation only. Does not generate certificates, manage sessions, or perform any cryptographic operations beyond deserialisation.
On construction the loader: 1. Validates that both paths point to existing, regular files with
permitted extensions (see
ALLOWED_CERT_EXTENSIONS).Deserialises the CA certificate and private key from PEM.
Extracts
CertificateInfofrom the CA certificate’s Subject.
After successful construction all three
ICALoaderproperties are available and will not change for the lifetime of the instance.- Parameters:
ca_cert_path (str | Path) – Path to the PEM-encoded CA certificate file.
ca_key_path (str | Path) – Path to the PEM-encoded CA private key file.
ca_key_password (str | bytes | None) – Optional password protecting the private key. A
strvalue is encoded tobytesusing UTF-8 before being passed to the cryptography library.Nonemeans the key is unencrypted.logger (Logger | None) – Logger instance for diagnostic messages. Falls back to
DEFAULT_LOGGERwhenNone.
- property base_info: CertificateInfo¶
- property ca_cert: Certificate¶
- property ca_key: RSAPrivateKey¶