HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib/python3.10/site-packages/google/auth/crypt/__pycache__/base.cpython-310.pyc
o

�h^�@spdZddlZddlZddlZddlmZdZdZGdd�dejd�Z	Gd	d
�d
ejd�Z
Gdd�dejd�ZdS)
z5Base classes for cryptographic signers and verifiers.�N)�
exceptions�private_key�private_key_idc@seZdZdZejdd��ZdS)�Verifierz9Abstract base class for crytographic signature verifiers.cC�td��)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 implemented��NotImplementedError)�self�message�	signature�r�I/usr/local/CyberCP/lib/python3.10/site-packages/google/auth/crypt/base.py�verify�zVerifier.verifyN)�__name__�
__module__�__qualname__�__doc__�abc�abstractmethodrrrrr
rsr)�	metaclassc@s,eZdZdZejdd��Zejdd��ZdS)�Signerz.Abstract base class for cryptographic signers.cCr)z<Optional[str]: The key ID used to identify this private key.zKey id must be implementedr)r	rrr
�key_id2sz
Signer.key_idcCr)z�Signs a message.

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

        Returns:
            bytes: The signature of the message.
        zSign must be implementedr)r	r
rrr
�sign7szSigner.signN)	rrrrr�abstractpropertyrrrrrrr
r/s
rc@s8eZdZdZejd	dd��Zedd��Zedd��Z	dS)
�FromServiceAccountMixinz3Mix-in to enable factory constructors for a Signer.NcCr)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 implementedr)�cls�keyrrrr
�from_stringIrz#FromServiceAccountMixin.from_stringcCs(t|vr	t�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_KEYr�MalformedErrorr�get�_JSON_FILE_PRIVATE_KEY_ID)r�inforrr
�from_service_account_infoYs��z1FromServiceAccountMixin.from_service_account_infocCsDtj|ddd��
}t�|�}Wd�n1swY|�|�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�filename�	json_file�datarrr
�from_service_account_fileqs�
z1FromServiceAccountMixin.from_service_account_file)N)
rrrrrrr�classmethodr$r.rrrr
rFs
r)rrr'r)�google.authrrr"�ABCMetarrrrrrr
�<module>s