CasperSecurity

Current Path : /lib/python3/dist-packages/jwt/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/jwt/__pycache__/api_jwk.cpython-310.pyc

o

�E�`~�@sHddlZddlmZddlmZmZmZGdd�d�ZGdd�d�ZdS)	�N�)�get_default_algorithms)�InvalidKeyError�
PyJWKError�
PyJWKSetErrorc@sVeZdZddd�Zeddd��Zeddd��Zedd	��Zed
d��Z	edd
��Z
dS)�PyJWKNcCs@t�|_||_|j�dd�}|std|j��|s&t|jt�r&|j�dd�}|s�|j�dd�}|dkrW|dks9|s<d}nI|dkrCd	}nB|d
krJd}n;|dkrQd
}n4td|��|dkr^d}n'|dkred}n |dkr|srtd|j��|dkryd}ntd|��td|��|j�|�|_|js�td|j��|j�	|j�|_
dS)N�ktyzkty is not found: %s�alg�crv�ECzP-256�ES256zP-384�ES384zP-521�ES512�	secp256k1�ES256KzUnsupported crv: %s�RSA�RS256�oct�HS256�OKPzcrv is not found: %s�Ed25519�EdDSAzUnsupported kty: %sz&Unable to find a algorithm for key: %s)r�_algorithms�	_jwk_data�getr�
isinstance�dict�	Algorithmr�from_jwk�key)�self�jwk_data�	algorithmrr
�r#�-/usr/lib/python3/dist-packages/jwt/api_jwk.py�__init__sDzPyJWK.__init__cCs
t||�S�N)r)�objr"r#r#r$�	from_dict6s
zPyJWK.from_dictcCst�|�}t�||�Sr&)�json�loadsrr()�datar"r'r#r#r$�	from_json:s
zPyJWK.from_jsoncC�|j�dd�S)Nr�rr�r r#r#r$�key_type?�zPyJWK.key_typecCr-)N�kidr.r/r#r#r$�key_idCr1zPyJWK.key_idcCr-)N�user.r/r#r#r$�public_key_useGr1zPyJWK.public_key_user&)�__name__�
__module__�__qualname__r%�staticmethodr(r,�propertyr0r3r5r#r#r#r$rs
.

rc@s,eZdZdd�Zedd��Zedd��ZdS)�PyJWKSetcCsNg|_|r
t|t�std��t|�dkrtd��|D]
}|j�t|��qdS)NzInvalid JWK Set valuerz$The JWK Set did not contain any keys)�keysr�listr�len�appendr)r r<rr#r#r$r%Ms�zPyJWKSet.__init__cCs|�dg�}t|�S)Nr<)rr;)r'r<r#r#r$r(YszPyJWKSet.from_dictcCst�|�}t�|�Sr&)r)r*r;r()r+r'r#r#r$r,^s

zPyJWKSet.from_jsonN)r6r7r8r%r9r(r,r#r#r#r$r;Ls
r;)	r)�
algorithmsr�
exceptionsrrrrr;r#r#r#r$�<module>s
E
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY