| Server IP : 23.254.227.96 / Your IP : 216.73.216.183 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.6/site-packages/jwt/contrib/algorithms/__pycache__/ |
Upload File : |
3
�k�Z� � @ s` d dl Zd dlZd dlZd dlmZ d dlmZ d dlm Z d dl
mZmZ G dd� de �Z
dS )� N)�RSA)�
PKCS1_v1_5)� Algorithm)�string_types� text_typec @ sH e Zd ZdZejjZejjZejjZdd� Z dd� Z
dd� Zdd � Zd
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
c C s
|| _ d S )N)�hash_alg)�selfr � r
�/usr/lib/python3.6/pycrypto.py�__init__ s zRSAAlgorithm.__init__c C sF t |tj�r|S t |t�r:t |t�r.|jd�}tj|�}ntd��|S )Nzutf-8z&Expecting a PEM- or RSA-formatted key.)�
isinstancer Z_RSAobjr r �encodeZ importKey� TypeError)r �keyr
r
r �prepare_key s
zRSAAlgorithm.prepare_keyc C s t j|�j| jj|��S )N)r �new�signr )r �msgr r
r
r r * s zRSAAlgorithm.signc C s t j|�j| jj|�|�S )N)r r �verifyr )r r r Zsigr
r
r r - s zRSAAlgorithm.verifyN)
�__name__�
__module__�__qualname__�__doc__�CryptoZHashZSHA256ZSHA384ZSHA512r r r r r
r
r
r r s r )ZCrypto.Hash.SHA256r ZCrypto.Hash.SHA384ZCrypto.Hash.SHA512ZCrypto.PublicKeyr ZCrypto.Signaturer Zjwt.algorithmsr Z
jwt.compatr r r r
r
r
r �<module> s