Ë
    ùmxiH  ã                   ó  — d Z ddlmZ ddlmZ ddlmZ ddlmZ ej                  Zej                  Zej                  Zej                  Z	ej                  Z
ej                  Zej                  Zej                  Zej                  fd„Zg d¢Zy)	a\  Cryptography helpers for verifying and signing messages.

The simplest way to verify signatures is using :func:`verify_signature`::

    cert = open('certs.pem').read()
    valid = crypt.verify_signature(message, signature, cert)

If you're going to verify many messages with the same certificate, you can use
:class:`RSAVerifier`::

    cert = open('certs.pem').read()
    verifier = crypt.RSAVerifier.from_string(cert)
    valid = verifier.verify(message, signature)

To sign messages use :class:`RSASigner` with a private key::

    private_key = open('private_key.pem').read()
    signer = crypt.RSASigner.from_string(private_key)
    signature = signer.sign(message)

The code above also works for :class:`ES256Signer` and :class:`ES256Verifier`.
Note that these two classes are only available if your `cryptography` dependency
version is at least 1.4.0.
é    )Úbase)Úes)Úes256)Úrsac                 óŽ   — t        |t        t        f«      r|g}|D ]'  }|j                  |«      }|j	                  | |«      sŒ' y y)a  Verify an RSA or ECDSA cryptographic signature.

    Checks that the provided ``signature`` was generated from ``bytes`` using
    the private key associated with the ``cert``.

    Args:
        message (Union[str, bytes]): The plaintext message.
        signature (Union[str, bytes]): The cryptographic signature to check.
        certs (Union[Sequence, str, bytes]): The certificate or certificates
            to use to check the signature.
        verifier_cls (Optional[~google.auth.crypt.base.Signer]): Which verifier
            class to use for verification. This can be used to select different
            algorithms, such as RSA or ECDSA. Default value is :class:`RSAVerifier`.

    Returns:
        bool: True if the signature is valid, otherwise False.
    TF)Ú
isinstanceÚstrÚbytesÚfrom_stringÚverify)ÚmessageÚ	signatureÚcertsÚverifier_clsÚcertÚverifiers         úQ/home/htdocs/ttos/venv/lib/python3.12/site-packages/google/auth/crypt/__init__.pyÚverify_signaturer   ;   sN   € ô$ �%œ#œu˜Ô&Ø�ˆàò ˆØ×+Ñ+¨DÓ1ˆØ�?‰?˜7 IÕ.Ùðð ó    )ÚEsSignerÚ
EsVerifierÚES256SignerÚES256VerifierÚ	RSASignerÚRSAVerifierÚSignerÚVerifierN)Ú__doc__Úgoogle.auth.cryptr   r   r   r   r   r   r   r   r   r   r   r   r   Ú__all__© r   r   ú<module>r"      s|   ðñõ2 #Ý  Ý #Ý !à�;‰;€Ø�]‰]€
Ø×Ñ€Ø×#Ñ#€ð
 
�‰€Ø�=‰=€Ø�M‰M€	Ø�o‰o€ð >A¿_¹_ó ò8	�r   