�
&�)cE � � � d dl mZ d dlZd dlZddlmZ ddlmZmZm Z G d� d� � Z
G d� d � � Z G d
� d� � ZdS )� )�annotationsN� )�get_default_algorithms)�InvalidKeyError�
PyJWKError�
PyJWKSetErrorc � � e Zd Zdd�Zedd�� � Zedd�� � Zed� � � Zed� � � Z ed� � � Z
dS ) �PyJWKNc �D � t � � | _ || _ | j � dd � � }|st d| j � �� � �|s5t | j t � � r| j � dd � � }|s�| j � dd � � }|dk r8|dk s|sd}n�|dk rd }n�|d
k rd}ny|dk rd
}npt d|� �� � �|dk rd}nU|dk rd}nL|dk r4|st d| j � �� � �|dk rd}n$t d|� �� � �t d|� �� � �| j � |� � | _ | j st d| j � �� � �| j � | j � � | _
d S )N�ktyzkty is not found: �alg�crv�ECzP-256�ES256zP-384�ES384zP-521�ES512� secp256k1�ES256KzUnsupported crv: �RSA�RS256�oct�HS256�OKPzcrv is not found: �Ed25519�EdDSAzUnsupported kty: z$Unable to find a algorithm for key: )r �_algorithms� _jwk_data�getr �
isinstance�dict� Algorithmr �from_jwk�key)�self�jwk_data� algorithmr r s �-/usr/lib/python3/dist-packages/jwt/api_jwk.py�__init__zPyJWK.__init__ s� � �1�3�3���!����n� � ���-�-��� I�!�"G�t�~�"G�"G�H�H�H�� 8�Z����=�=� 8���*�*�5�$�7�7�I�� A��.�$�$�U�D�1�1�C��d�{�{��'�>�>��>� '�I�I��G�^�^� '�I�I��G�^�^� '�I�I��K�'�'� (�I�I�)�*C�c�*C�*C�D�D�D�����#� � �����#� � ������ Q�)�*O�t�~�*O�*O�P�P�P��)�#�#� '�I�I�)�*C�c�*C�*C�D�D�D�%�&?�#�&?�&?�@�@�@��)�-�-�i�8�8����~� V��T�D�N�T�T�U�U�U��>�*�*�4�>�:�:����� c �" |