Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/google/auth/transport/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/google/auth/transport/__pycache__/mtls.cpython-38.pyc
U

O��g��@s8dZddlmZddlmZdd�Zdd�Zdd	�Zd
S)zUtilites for mutual TLS.�)�
exceptions)�_mtls_helpercCs,t�tj�dk	rdSt�tj�dk	r(dSdS)z�Check if default client SSL credentials exists on the device.

    Returns:
        bool: indicating if the default client cert source exists.
    NTF)rZ_check_config_pathZCONTEXT_AWARE_METADATA_PATHZ&CERTIFICATE_CONFIGURATION_DEFAULT_PATH�rr�G/opt/cppython/lib/python3.8/site-packages/google/auth/transport/mtls.py�has_default_client_cert_sources
�����rcCst�st�d��dd�}|S)a�Get a callback which returns the default client SSL credentials.

    Returns:
        Callable[[], [bytes, bytes]]: A callback which returns the default
            client certificate bytes and private key bytes, both in PEM format.

    Raises:
        google.auth.exceptions.DefaultClientCertSourceError: If the default
            client SSL credentials don't exist or are malformed.
    z(Default client cert source doesn't existc
SsTzt��\}}}Wn8tttfk
rJ}zt�|�}||�W5d}~XYnX||fS)N)rZget_client_cert_and_key�OSError�RuntimeError�
ValueErrorr�MutualTLSChannelError)�_�
cert_bytes�	key_bytes�
caught_exc�new_excrrr�callback:s
z,default_client_cert_source.<locals>.callback�rrr
)rrrr�default_client_cert_source*s�	rcs"t�st�d����fdd�}|S)atGet a callback which returns the default encrpyted client SSL credentials.

    Args:
        cert_path (str): The cert file path. The default client certificate will
            be written to this file when the returned callback is called.
        key_path (str): The key file path. The default encrypted client key will
            be written to this file when the returned callback is called.

    Returns:
        Callable[[], [str, str, bytes]]: A callback which generates the default
            client certificate, encrpyted private key and passphrase. It writes
            the certificate and private key into the cert_path and key_path, and
            returns the cert_path, key_path and passphrase bytes.

    Raises:
        google.auth.exceptions.DefaultClientCertSourceError: If any problem
            occurs when loading or saving the client certificate and key.
    z2Default client encrypted cert source doesn't existc
s�zXtjdd�\}}}}t�d��}|�|�W5QRXt�d��}|�|�W5QRXWn8tjtfk
r�}zt�|�}||�W5d}~XYnX��|fS)NT)Zgenerate_encrypted_key�wb)rZget_client_ssl_credentials�open�writerZClientCertErrorrr
)rrr
Zpassphrase_bytes�	cert_file�key_filerr��	cert_path�key_pathrrr^s
�
z6default_client_encrypted_cert_source.<locals>.callbackr)rrrrrr�$default_client_encrypted_cert_sourceFs�rN)�__doc__Zgoogle.authrZgoogle.auth.transportrrrrrrrr�<module>s


F1le Man4ger