ok
Direktori : /lib/python3.6/site-packages/josepy/__pycache__/ |
Current File : //lib/python3.6/site-packages/josepy/__pycache__/jwk.cpython-36.pyc |
3 �}:ay4 � @ s d Z ddlZddlZddlZddlZddlmZmZmZm Z m Z ddlZddl mZ ddlmZ ddlmZ ddlmZ ddlmZ dd lmZmZmZ eje�ZG d d� dejejd�ZejG d d� de��Z ejG dd� de��Z!ejG dd� de��Z"dS )z JSON Web Key.� N)�Dict�Optional�Sequence�Type�Union)�default_backend)�hashes)� serialization)�ec)�rsa)�errors� json_util�utilc @ s� e Zd ZU dZdZi Zeeef f Z e e eZe e dddd�Z eeeee e e ef f ejfdd �Zejd d� �Zeddd ��Zeddd��ZdS )�JWKz JSON Web Key.ZktyN�,�:T)�indentZ separatorsZ sort_keysc sJ t j|� t� d�}|jtj� fdd�� j� j� D �f� j�j � � |j � S )zgCompute JWK Thumbprint. https://tools.ietf.org/html/rfc7638 :returns: bytes )�backendc s i | ]\}}|� j kr||�qS � )�required)�.0�k�v)�selfr �/usr/lib/python3.6/jwk.py� <dictcomp>4 s z"JWK.thumbprint.<locals>.<dictcomp>)r ZHashr �update�json�dumpsZto_json�items�_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)�NotImplementedError)r r r r � public_key9 s zJWK.public_keyc C s� |d krt � n|}i }xVtjtjfD ]F}y||||�S tttjjfk rh } z|||<