HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/jwt/contrib/algorithms/__pycache__/pycrypto.cpython-38.pyc
U

�b�[��@s`ddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZmZGdd�de	�Z
dS)�N)�RSA)�
PKCS1_v1_5)�	Algorithm)�string_types�	text_typec@sHeZdZdZejjZejjZejjZdd�Z	dd�Z
dd�Zdd	�Zd
S)�RSAAlgorithmz�
    Performs signing and verification operations using
    RSASSA-PKCS-v1_5 and the specified hash function.

    This class requires PyCrypto package to be installed.

    This is based off of the implementation in PyJWT 0.3.2
    cCs
||_dS�N)�hash_alg)�selfr	�r�A/usr/lib/python3/dist-packages/jwt/contrib/algorithms/pycrypto.py�__init__szRSAAlgorithm.__init__cCsFt|tj�r|St|t�r:t|t�r.|�d�}t�|�}ntd��|S)Nzutf-8z&Expecting a PEM- or RSA-formatted key.)�
isinstancerZ_RSAobjrr�encodeZ	importKey�	TypeError)r
�keyrrr�prepare_keys


zRSAAlgorithm.prepare_keycCst�|��|j�|��Sr)r�new�signr	)r
�msgrrrrr*szRSAAlgorithm.signcCst�|��|j�|�|�Sr)rr�verifyr	)r
rrZsigrrrr-szRSAAlgorithm.verifyN)
�__name__�
__module__�__qualname__�__doc__�CryptoZHashZSHA256ZSHA384ZSHA512r
rrrrrrrrsr)ZCrypto.Hash.SHA256rZCrypto.Hash.SHA384ZCrypto.Hash.SHA512ZCrypto.PublicKeyrZCrypto.SignaturerZjwt.algorithmsrZ
jwt.compatrrrrrrr�<module>s