HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux ns565604.ip-54-39-133.net 4.18.0-553.50.1.el8_10.x86_64 #1 SMP Tue Apr 15 08:09:22 EDT 2025 x86_64
User: greer489 (1034)
PHP: 8.3.19
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/jwt/contrib/algorithms/__pycache__/pycrypto.cpython-36.opt-1.pyc
3

�k�Z��@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
�/usr/lib/python3.6/pycrypto.py�__init__szRSAAlgorithm.__init__cCsFt|tj�r|St|t�r:t|t�r.|jd�}tj|�}ntd��|S)Nzutf-8z&Expecting a PEM- or RSA-formatted key.)�
isinstancerZ_RSAobjrr�encodeZ	importKey�	TypeError)r	�keyr
r
r�prepare_keys


zRSAAlgorithm.prepare_keycCstj|�j|jj|��S)N)r�new�signr)r	�msgrr
r
rr*szRSAAlgorithm.signcCstj|�j|jj|�|�S)N)rr�verifyr)r	rrZsigr
r
rr-szRSAAlgorithm.verifyN)
�__name__�
__module__�__qualname__�__doc__�CryptoZHashZSHA256ZSHA384ZSHA512rrrrr
r
r
rrsr)ZCrypto.Hash.SHA256rZCrypto.Hash.SHA384ZCrypto.Hash.SHA512ZCrypto.PublicKeyrZCrypto.SignaturerZjwt.algorithmsrZ
jwt.compatrrrr
r
r
r�<module>s