whoami7 - Manager
:
/
lib
/
python3
/
dist-packages
/
josepy
/
__pycache__
/
Upload File:
files >> //lib/python3/dist-packages/josepy/__pycache__/jwk.cpython-38.pyc
U ��]�$ � @ s� d Z ddlZddlZddlZddlZddlZddlZddlm Z ddl mZ ddl mZ ddl mZ ddl mZ ddlmZmZmZ e�e�ZG d d � d ej�ZejG dd� de��ZejG d d� de��ZejG dd� de��ZdS )� JSON Web Key.� N)�default_backend)�hashes)� serialization)�ec)�rsa)�errors� json_util�utilc @ sd e Zd ZdZdZi ZdZeZdddd�Z e jfdd �Ze jd d� �Zeddd ��Zeddd��ZdS )�JWKr Zkty� N)�,�:T)�indentZ separatorsZ sort_keysc sP t j|� t� d�}|�tjt� fdd�t�� � � �D ��f� j ��� � |�� S )zgCompute JWK Thumbprint. https://tools.ietf.org/html/rfc7638 :returns: bytes )�backendc 3 s$ | ]\}}|� j kr||fV qd S �N)�required)�.0�k�v��selfr �,/usr/lib/python3/dist-packages/josepy/jwk.py� <genexpr>3 s �z!JWK.thumbprint.<locals>.<genexpr>) r ZHashr �update�json�dumps�dict�six� iteritemsZto_json�_thumbprint_json_dumps_params�encode�finalize)r Z hash_functionZdigestr r r � thumbprint) s �� zJWK.thumbprintc C s t � �dS )ziGenerate JWK with public key. For symmetric cryptosystems, this would return ``self``. N��NotImplementedErrorr r r r � public_key8 s zJWK.public_keyc C s� |d krt � n|}i }tjtjfD ]L}z||||�W S tttjjfk rl } z|||<