%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/jwt/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/jwt/__pycache__/utils.cpython-312.pyc

�

d��d?����ddlZddlZddlZddlmZ	ddlmZddlmZm	Z	deeefdefd�Z
deeefdefd	�Zdedefd
�Zdedefd�Zdeeefdefd
�Zdededefd�Zdedefd�Zdedefd�Zdedddefd�Zdedddefd�Zhd�Zej2ddj5e�zdzej6�Zdedefd�Zd Zej2d!�Z gd"�Z!dedefd#�Z"y#e
$rY��wxYw)$�N)�Union)�
EllipticCurve)�decode_dss_signature�encode_dss_signature�value�returnc�~�t|t�r|jd�St|t�r|St	d��)Nzutf-8zExpected a string value)�
isinstance�str�encode�bytes�	TypeError)rs �+/usr/lib/python3/dist-packages/jwt/utils.py�force_bytesrs6���%����|�|�G�$�$�	�E�5�	!����1�2�2��inputc�~�t|�}t|�dz}|dkDr|dd|z
zz
}tj|�S)N�r�=)r�len�base64�urlsafe_b64decode)r�input_bytes�rems   r�base64url_decodersF���e�$�K�

�k�
�Q�
�C�
�Q�w��t�q�3�w�'�'���#�#�K�0�0rc�L�tj|�jdd�S)Nrr)r�urlsafe_b64encode�replace)rs r�base64url_encoder$s ���#�#�E�*�2�2�4��=�=r�valc�n�|dkrtd��t|�}t|�dk(rd}t|�S)NrzMust be a positive integer�)�
ValueError�bytes_from_intrr)r �	int_bytess  r�to_base64url_uintr&(s;��
�Q�w��5�6�6��s�#�I�
�9�~����	��I�&�&rc�X�tt|��}tj|d��S)N�big)�	byteorder)rr�int�
from_bytes)r �datas  r�from_base64url_uintr-4s$���K��,�-�D��>�>�$�%�>�0�0r�num�	num_bytesc�^�dd|z|fz}tj|jd��S)Nz%0*x��ascii)�binascii�a2b_hexr)r.r/�
padded_hexs   r�number_to_bytesr69s1���1�y�=�#�.�.�J����J�-�-�g�6�7�7r�stringc�@�ttj|�d�S)N�)r*r3�b2a_hex)r7s r�bytes_to_numberr;>s���x����'��,�,rc�\�|}d}|dk7r|dz}|dz
}|dk7r�|j|dd��S)Nr��r(F)�signed)�to_bytes)r �	remaining�byte_lengths   rr$r$BsF���I��K�
�q�.��a��	��q����q�.��<�<��U�5�<�9�9r�der_sig�curverc�x�|j}|dzdz}t|�\}}t||�t||�zS)N�r=)�key_sizerr6)rCrD�num_bitsr/�r�ss      r�der_to_raw_signaturerKMs@���~�~�H��A��!�#�I���(�D�A�q��1�i�(�?�1�i�+H�H�Hr�raw_sigc���|j}|dzdz}t|�d|zk7rtd��t|d|�}t||d�}t	t||��S)NrFr=r1zInvalid signature)rGrr#r;r
r)rLrDrHr/rIrJs      r�raw_to_der_signaturerNVsj���~�~�H��A��!�#�I�
�7�|�q�9�}�$��,�-�-���
��+�,�A���	�
�+�,�A��%�a��+�,�,r>�X509 CRL�
PUBLIC KEY�CERTIFICATE�PRIVATE KEY�
DH PARAMETERS�EC PRIVATE KEY�RSA PUBLIC KEY�DSA PRIVATE KEY�RSA PRIVATE KEY�SSH2 PUBLIC KEY�CERTIFICATE REQUEST�OPENSSH PRIVATE KEY�TRUSTED CERTIFICATE�ENCRYPTED PRIVATE KEY�NEW CERTIFICATE REQUEST�SSH2 ENCRYPTED PRIVATE KEYs----[- ]BEGIN (�|s,)[- ]----
?
.+?
?
----[- ]END \1[- ]----
?
?�keyc�>�ttj|��S�N)�bool�_PEM_RE�search)r`s r�
is_pem_formatrf�s������s�#�$�$rs-cert-v01@openssh.coms\A(\S+)[ \t]+(\S+))sssh-ed25519sssh-rsasssh-dsssecdsa-sha2-nistp256secdsa-sha2-nistp384secdsa-sha2-nistp521c���t�fd�tD��rytj��}|r,|j	d�}t
|t
t
�dk(ryy)Nc3�&�K�|]}|�v���
y�wrb�)�.0�string_valuer`s  �r�	<genexpr>zis_ssh_key.<locals>.<genexpr>�s�����
D�<�<�3��
D�s�Tr>F)�any�_SSH_KEY_FORMATS�_SSH_PUBKEY_RC�match�group�_CERT_SUFFIXr)r`�ssh_pubkey_match�key_types`  r�
is_ssh_keyru�sW���
�
D�3C�
D�D��%�+�+�C�0���#�)�)�!�,���8�S��%6�$6�$8�9�9��r)#rr3�re�typingr�,cryptography.hazmat.primitives.asymmetric.ecr�/cryptography.hazmat.primitives.asymmetric.utilsrr�ModuleNotFoundErrorr
rrrrr*r&r-r6r;r$rKrN�_PEMS�compile�join�DOTALLrdrcrfrrrornrurirr�<module>rs���
��	��	�J��3�u�U�C�Z�(�3�U�3�1�E�%��*�-�1�%�1�>�E�>�e�>�	'�3�	'�5�	'�1�U�5�#�:�.�1�3�1�
8��8��8��8�
-�E�-�c�-�:��:��:�I�%�I��I�E�I�
-�%�
-��
-�E�
-�	��&�"�*�*��
�i�i����!�!�
�I�I�
��%�u�%��%�
(������2�3����
�E�
�d�
��M�	��	�s�C&�&C.�-C.

Zerion Mini Shell 1.0