Ë
    ùmxi^  ã                   ó¸   — d Z ddlZddlZddlZddlmZ dZdZ G d„ dej                  ¬«      Z	 G d	„ d
ej                  ¬«      Z
 G d„ dej                  ¬«      Zy)z5Base classes for cryptographic signers and verifiers.é    N)Ú
exceptionsÚprivate_keyÚprivate_key_idc                   ó4   — e Zd ZdZej
                  d„ «       Zy)ÚVerifierz9Abstract base class for crytographic signature verifiers.c                 ó   — t        d«      ‚)a�  Verifies a message against a cryptographic signature.

        Args:
            message (Union[str, bytes]): The message to verify.
            signature (Union[str, bytes]): The cryptography signature to check.

        Returns:
            bool: True if message was signed by the private key associated
            with the public key that this object was constructed with.
        zVerify must be implemented©ÚNotImplementedError)ÚselfÚmessageÚ	signatures      úM/home/htdocs/ttos/venv/lib/python3.12/site-packages/google/auth/crypt/base.pyÚverifyzVerifier.verify   s   € ô "Ð">Ó?Ð?ó    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚabcÚabstractmethodr   © r   r   r   r      s   „ ÙCà×Ññ@ó ñ@r   r   )Ú	metaclassc                   óX   — e Zd ZdZej
                  d„ «       Zej                  d„ «       Zy)ÚSignerz.Abstract base class for cryptographic signers.c                 ó   — t        d«      ‚)z<Optional[str]: The key ID used to identify this private key.zKey id must be implementedr	   )r   s    r   Úkey_idzSigner.key_id2   s   € ô "Ð">Ó?Ð?r   c                 ó   — t        d«      ‚)z®Signs a message.

        Args:
            message (Union[str, bytes]): The message to be signed.

        Returns:
            bytes: The signature of the message.
        zSign must be implementedr	   )r   r   s     r   ÚsignzSigner.sign7   s   € ô "Ð"<Ó=Ð=r   N)	r   r   r   r   r   Úabstractpropertyr   r   r   r   r   r   r   r   /   s9   „ Ù8à×Ññ@ó ð@ð 	×Ññ>ó ñ>r   r   c                   óV   — e Zd ZdZej
                  dd„«       Zed„ «       Zed„ «       Z	y)ÚFromServiceAccountMixinz3Mix-in to enable factory constructors for a Signer.Nc                 ó   — t        d«      ‚)ad  Construct an Signer instance from a private key string.

        Args:
            key (str): Private key as a string.
            key_id (str): An optional key id used to identify the private key.

        Returns:
            google.auth.crypt.Signer: The constructed signer.

        Raises:
            ValueError: If the key cannot be parsed.
        zfrom_string must be implementedr	   )ÚclsÚkeyr   s      r   Úfrom_stringz#FromServiceAccountMixin.from_stringI   s   € ô "Ð"CÓDÐDr   c                 ó”   — t         |vrt        j                  d«      ‚| j                  |t            |j	                  t
        «      «      S )a‹  Creates a Signer instance instance from a dictionary containing
        service account info in Google format.

        Args:
            info (Mapping[str, str]): The service account info in Google
                format.

        Returns:
            google.auth.crypt.Signer: The constructed signer.

        Raises:
            ValueError: If the info is not in the expected format.
        z@The private_key field was not found in the service account info.)Ú_JSON_FILE_PRIVATE_KEYr   ÚMalformedErrorr%   ÚgetÚ_JSON_FILE_PRIVATE_KEY_ID)r#   Úinfos     r   Úfrom_service_account_infoz1FromServiceAccountMixin.from_service_account_infoY   sJ   € ô "¨Ñ-Ü×+Ñ+ØUóð ð �‰ØÔ'Ñ(¨$¯(©(Ô3LÓ*Mó
ð 	
r   c                 ó¨   — t        j                  |dd¬«      5 }t        j                  |«      }ddd«       | j	                  «      S # 1 sw Y   ŒxY w)a  Creates a Signer instance from a service account .json file
        in Google format.

        Args:
            filename (str): The path to the service account .json file.

        Returns:
            google.auth.crypt.Signer: The constructed signer.
        Úrzutf-8)ÚencodingN)ÚioÚopenÚjsonÚloadr,   )r#   ÚfilenameÚ	json_fileÚdatas       r   Úfrom_service_account_filez1FromServiceAccountMixin.from_service_account_fileq   sL   € ô �W‰W�X˜s¨WÔ5ð 	(¸Ü—9‘9˜YÓ'ˆD÷	(ð ×,Ñ,¨TÓ2Ð2÷	(ð 	(ús   ™AÁA)N)
r   r   r   r   r   r   r%   Úclassmethodr,   r7   r   r   r   r!   r!   F   sG   „ Ù=à×ÑòEó ðEð ñ
ó ð
ð. ñ3ó ñ3r   r!   )r   r   r0   r2   Úgoogle.authr   r'   r*   ÚABCMetar   r   r!   r   r   r   ú<module>r;      sT   ðñ <ã 
Û 	Û å "à&Ð Ø,Ð ô@˜Ÿ™õ @ô(>�s—{‘{õ >ô.93¨¯©ö 93r   