proxy.common.pki module#

proxy.py#

⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging.

copyright
  1. 2013-present by Abhinav Singh and contributors.

license

BSD, see LICENSE for more details.

proxy.common.pki.ext_file(alt_subj_names: Optional[List[str]] = None, extended_key_usage: Optional[str] = None) Generator[str, None, None][source]#
proxy.common.pki.gen_csr(csr_path: str, key_path: str, password: str, crt_path: str, timeout: int = 10, openssl: str = 'openssl') bool[source]#

Generates a CSR based upon existing certificate and key file.

proxy.common.pki.gen_private_key(key_path: str, password: str, bits: int = 2048, timeout: int = 10, openssl: str = 'openssl') bool[source]#

Generates a private key.

proxy.common.pki.gen_public_key(public_key_path: str, private_key_path: str, private_key_password: str, subject: str, alt_subj_names: Optional[List[str]] = None, extended_key_usage: Optional[str] = None, validity_in_days: int = 365, timeout: int = 10, openssl: str = 'openssl') bool[source]#

For a given private key, generates a corresponding public key.

proxy.common.pki.get_ext_config(alt_subj_names: Optional[List[str]] = None, extended_key_usage: Optional[str] = None) bytes[source]#
proxy.common.pki.remove_passphrase(key_in_path: str, password: str, key_out_path: str, timeout: int = 10, openssl: str = 'openssl') bool[source]#

Remove passphrase from a private key.

proxy.common.pki.run_openssl_command(command: List[str], timeout: int) bool[source]#
proxy.common.pki.sign_csr(csr_path: str, crt_path: str, ca_key_path: str, ca_key_password: str, ca_crt_path: str, serial: str, alt_subj_names: Optional[List[str]] = None, extended_key_usage: Optional[str] = None, validity_in_days: int = 365, timeout: int = 10, openssl: str = 'openssl') bool[source]#

Sign a CSR using CA key and certificate.

proxy.common.pki.ssl_config(alt_subj_names: Optional[List[str]] = None, extended_key_usage: Optional[str] = None) Generator[Tuple[str, bool], None, None][source]#