HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/alt/python38/lib/python3.8/site-packages/jwt/__pycache__/utils.cpython-38.opt-1.pyc
U

���_�	�@sddlZddlZddlmZmZz ddlmZddlmZm	Z	Wne
k
rXeZYnXeeefed�dd�Z
eeefed�d	d
�Zeed�dd�Zeed
�dd�Zeeefed
�dd�Zeeed�dd�Zeed�dd�Zeed
�dd�Zeeed�dd�Zeeed�dd�ZdS) �N)�Any�Union)�
EllipticCurve)�decode_dss_signature�encode_dss_signature)�value�returncCs.t|t�r|�d�St|t�r"|Std��dS)Nzutf-8zExpected a string value)�
isinstance�str�encode�bytes�	TypeError)r�r�:/opt/alt/python38/lib/python3.8/site-packages/jwt/utils.py�force_bytess



r)�inputrcCsBt|t�r|�d�}t|�d}|dkr8|dd|7}t�|�S)N�ascii�r�=)r	r
r�len�base64Zurlsafe_b64decode)rZremrrr�base64url_decodes

rcCst�|��dd�S)Nr�)rZurlsafe_b64encode�replace)rrrr�base64url_encode$sr)�valrcCs0|dkrtd��t|�}t|�dkr(d}t|�S)NrzMust be a positive integer�)�
ValueError�bytes_from_intrr)rZ	int_bytesrrr�to_base64url_uint(srcCs*t|t�r|�d�}t|�}tj|dd�S)Nr�big)�	byteorder)r	r
rr�int�
from_bytes)r�datarrr�from_base64url_uint4s

r%)�num�	num_bytesrcCs$dd||f}t�|�d��}|S)Nz%0*x�r)�binasciiZa2b_hexr)r&r'Z
padded_hexZ
big_endianrrr�number_to_bytes<sr*)�stringrcCstt�|�d�S)N�)r"r)Zb2a_hex)r+rrr�bytes_to_numberBsr-cCs2|}d}|dkr"|d?}|d7}q|j|ddd�S)Nr��r F)Zsigned)�to_bytes)r�	remainingZbyte_lengthrrrrFs
r)�der_sig�curvercCs2|j}|dd}t|�\}}t||�t||�S)N�r.)�key_sizerr*)r2r3�num_bitsr'�r�srrr�der_to_raw_signatureQsr9)�raw_sigr3rcCsT|j}|dd}t|�d|kr*td��t|d|��}t||d��}t||�S)Nr4r.r(zInvalid signature)r5rrr-r)r:r3r6r'r7r8rrr�raw_to_der_signatureZsr;)rr)�typingrrZ,cryptography.hazmat.primitives.asymmetric.ecrZ/cryptography.hazmat.primitives.asymmetric.utilsrr�ModuleNotFoundErrorr
rrrrr"rr%r*r-rr9r;rrrr�<module>s"