
    (ph                     2    S r SSKJr  SSKJr  S rS rS rg)zUtilites for mutual TLS.    )
exceptions)_mtls_helperc                      [         R                  " [         R                  5       b  g[         R                  " [         R                  5       b  gg)zCheck if default client SSL credentials exists on the device.

Returns:
    bool: indicating if the default client cert source exists.
TF)r   _check_config_pathCONTEXT_AWARE_METADATA_PATH&CERTIFICATE_CONFIGURATION_DEFAULT_PATH     M/var/www/html/venv/lib/python3.13/site-packages/google/auth/transport/mtls.pyhas_default_client_cert_sourcer      sN     	''(P(PQ	 ''??	
 	
 r
   c                  V    [        5       (       d  [        R                  " S5      eS n U $ )al  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                       [         R                  " 5       u  pnX4$ ! [        [        [        4 a  n[
        R                  " U5      nXCeS nAff = f)N)r   get_client_cert_and_keyOSErrorRuntimeError
ValueErrorr   MutualTLSChannelError)_
cert_bytes	key_bytes
caught_excnew_excs        r   callback,default_client_cert_source.<locals>.callback:   sT    	*'3'K'K'M$A9
 $$	 z2 	* 66zBG)	*s    AA

Ar   r   r   )r   s    r   default_client_cert_sourcer   *   s/     *++..6
 	
% Or
   c                 b   ^ ^ [        5       (       d  [        R                  " S5      eU U4S jnU$ )a<  Get 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                    >  [         R                  " SS9u  n nnn[        TS5       nUR                  U5        S S S 5        [        T	S5       nUR                  U5        S S S 5        TT	U4$ ! , (       d  f       N9= f! , (       d  f       N$= f! [        R
                  [        4 a  n[        R                  " U5      nXveS nAff = f)NT)generate_encrypted_keywb)r   get_client_ssl_credentialsopenwriter   ClientCertErrorr   r   )
r   r   r   passphrase_bytes	cert_filekey_filer   r   	cert_pathkey_paths
           r   r   6default_client_encrypted_cert_source.<locals>.callback^   s    	* 77tT i&)
+ 'h%y) & ($444 '&%%**G4 	* 66zBG)	*sK   %B A-B A> B -
A;7B >
BB B C)CCr   )r(   r)   r   s   `` r   $default_client_encrypted_cert_sourcer+   F   s0    & *++..@
 	
5$ Or
   N)__doc__google.authr   google.auth.transportr   r   r   r+   r	   r
   r   <module>r/      s     " .*8*r
   