HEX
Server: LiteSpeed
System: Linux srv146.niagahoster.com 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
User: kodi1989 (1633)
PHP: 8.1.34
Disabled: symlink,shell_exec,exec,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,show_source,pcntl_exec
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/google/auth/crypt/__pycache__/base.cpython-37.pyc
B

��f^�@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�G/opt/alt/python37/lib/python3.7/site-packages/google/auth/crypt/base.py�verifyszVerifier.verifyN)�__name__�
__module__�__qualname__�__doc__�abc�abstractmethodr
rrrr	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 implementedN)r)rrrr	�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 implementedN)r)rrrrr	�sign7szSigner.signN)	rrr
rr�abstractpropertyrrrrrrr	r/src@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 implementedN)r)�cls�keyrrrr	�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�inforrr	�from_service_account_infoYs
z1FromServiceAccountMixin.from_service_account_infoc	Cs0tj|ddd��}t�|�}WdQRX|�|�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)�encodingN)�io�open�json�loadr)r�filenameZ	json_file�datarrr	�from_service_account_fileqsz1FromServiceAccountMixin.from_service_account_file)N)
rrr
rrrr�classmethodrr'rrrr	rFs
r)rrr!r#Zgoogle.authrrr�ABCMetarrrrrrr	�<module>s