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/crypt/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


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

O��g^�@spdZddlZddlZddlZddlmZdZdZGdd�dejd�Z	Gd	d
�d
ejd�Z
Gdd�dejd�ZdS)
z5Base classes for cryptographic signers and verifiers.�N)�
exceptionsZprivate_keyZprivate_key_idc@seZdZdZejdd��ZdS)�Verifierz9Abstract base class for crytographic signature verifiers.cCstd��dS)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.
        zVerify must be implementedN��NotImplementedError)�self�message�	signature�r	�C/opt/cppython/lib/python3.8/site-packages/google/auth/crypt/base.py�verifyszVerifier.verifyN)�__name__�
__module__�__qualname__�__doc__�abc�abstractmethodrr	r	r	r
rsr)�	metaclassc@s,eZdZdZejdd��Zejdd��ZdS)�Signerz.Abstract base class for cryptographic signers.cCstd��dS)z<Optional[str]: The key ID used to identify this private key.zKey id must be implementedNr)rr	r	r
�key_id2sz
Signer.key_idcCstd��dS)z�Signs a message.

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

        Returns:
            bytes: The signature of the message.
        zSign must be implementedNr)rrr	r	r
�sign7szSigner.signN)	rr
rrr�abstractpropertyrrrr	r	r	r
r/s

rc@s8eZdZdZejd	dd��Zedd��Zedd��Z	dS)
�FromServiceAccountMixinz3Mix-in to enable factory constructors for a Signer.NcCstd��dS)adConstruct 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.
        zfrom_string must be implementedNr)�cls�keyrr	r	r
�from_stringIsz#FromServiceAccountMixin.from_stringcCs(t|krt�d��|�|t|�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_KEYrZMalformedErrorr�get�_JSON_FILE_PRIVATE_KEY_ID)r�infor	r	r
�from_service_account_infoYs��z1FromServiceAccountMixin.from_service_account_infoc	Cs0tj|ddd��}t�|�}W5QRX|�|�S)aCreates 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.
        �rzutf-8)�encoding)�io�open�json�loadr)r�filenameZ	json_file�datar	r	r
�from_service_account_fileqsz1FromServiceAccountMixin.from_service_account_file)N)
rr
rrrrr�classmethodrr(r	r	r	r
rFs
r)rrr"r$Zgoogle.authrrr�ABCMetarrrr	r	r	r
�<module>s

F1le Man4ger