HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //proc/self/root/lib/python3.6/site-packages/jwcrypto/__pycache__/jwk.cpython-36.opt-1.pyc
3

�e3[S|�@s�ddlZddlmZmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZddlmZdd	lmZdd
lmZddlmZddlmZmZdd
lmZmZdddd�ZGdd�de�Zedd�Zedddej�edddej�edddej�edddej�d�edddej�edddej�edddej�ed ddej�ed!ddej�ed"ddej�ed#ddej�ed$ddej�ed%ddej �d&�	d'ed(ddej�id�Z!ed)ddd�ed*ddd�ed+ddd�ed,ddd�ed-ddd�ed.ddd�ed/ddd�ed0ddd�ed1ddd�d2�	Z"d3d4d5d6�Z#d7d8d9�Z$d:d;d<d=d>d?d@dAdB�Z%dCdDdEdF�Z&GdGdH�dHe�Z'GdIdJ�dJe�Z(GdKdL�dLe�Z)GdMdN�dNe�Z*GdOdP�dPe+�Z,GdQdR�dRe-�Z.GdSdT�dTe/�Z0dS)U�N)�hexlify�	unhexlify)�
namedtuple)�Enum)�x509)�default_backend)�hashes�
serialization)�ec)�rsa)�	iteritems)�JWException)�base64url_decode�base64url_encode)�json_decode�json_encodezElliptic Curve�RSAzOctet sequence)�ECr�octc@seZdZdZdZdZdZdS)�ParmTypezA string with a namezBase64url EncodedzBase64urlUint EncodedzUnsupported ParameterN)�__name__�
__module__�__qualname__�name�b64�b64U�unsupported�rr�/usr/lib/python3.6/jwk.pyrsrZ	Parameterz description public required typeZCurveTzX CoordinatezY CoordinatezECC Private KeyF)�crv�x�y�dZModulus�ExponentzPrivate ExponentzFirst Prime FactorzSecond Prime FactorzFirst Factor CRT ExponentzSecond Factor CRT ExponentzFirst CRT CoefficientzOther Primes Info)	�n�er"�p�q�dp�dq�qiZoth�kz	Key ValuezKey TypezPublic Key UsezKey OperationsZ	AlgorithmzKey IDz	X.509 URLzX.509 Certificate Chainz"X.509 Certificate SHA-1 Thumbprintz$X.509 Certificate SHA-256 Thumbprint)	�kty�use�key_ops�alg�kidZx5uZx5cZx5tzx5t#S256zP-256 curvezP-384 curvezP-521 curve)zP-256zP-384zP-521zDigital Signature or MACZ
Encryption)�sig�encz Compute digital Signature or MACzVerify digital signature or MACzEncrypt contentz6Decrypt content and validate decryption, if applicablezEncrypt keyz2Decrypt key and validate decryption, if applicablez
Derive keyz#Derive bits not to be used as a key)�sign�verify�encrypt�decrypt�wrapKey�	unwrapKey�	deriveKey�
deriveBitszP-256zP-384zP-521)Z	secp256r1Z	secp384r1Z	secp521r1cs*eZdZdZd�fdd�	Zdd�Z�ZS)�InvalidJWKTypezfInvalid JWK Type Exception.

    This exception is raised when an invalid parameter type is used.
    Ncstt|�j�||_dS)N)�superr;�__init__�value)�selfr>)�	__class__rrr=uszInvalidJWKType.__init__cCsd|jttj��fS)Nz&Unknown type "%s", valid types are: %s)r>�list�JWKTypesRegistry�keys)r?rrr�__str__yszInvalidJWKType.__str__)N)rrr�__doc__r=rD�
__classcell__rr)r@rr;osr;cs(eZdZdZ�fdd�Zdd�Z�ZS)�InvalidJWKUsagez�Invalid JWK usage Exception.

    This exception is raised when an invalid key usage is requested,
    based on the key type and declared usage constraints.
    cstt|�j�||_||_dS)N)r<rGr=r>r-)r?r-r>)r@rrr=�szInvalidJWKUsage.__init__cCs\|jttj��krt|j}n
d|j}|jttj��krFt|j}n
d|j}d||fS)NzUnknown(%s)z.Invalid usage requested: "%s". Valid for: "%s")r-rA�JWKUseRegistryrCr>)r?�usage�validrrrrD�s

zInvalidJWKUsage.__str__)rrrrEr=rDrFrr)r@rrG~srGcs(eZdZdZ�fdd�Zdd�Z�ZS)�InvalidJWKOperationz�Invalid JWK Operation Exception.

    This exception is raised when an invalid key operation is requested,
    based on the key type and declared usage constraints.
    cstt|�j�||_||_dS)N)r<rKr=�op�values)r?�	operationrM)r@rrr=�szInvalidJWKOperation.__init__cCsx|jttj��krt|j}n
d|j}t�}x<|jD]2}|ttj��krZ|jt|�q6|jd|�q6Wd||fS)NzUnknown(%s)z2Invalid operation requested: "%s". Valid for: "%s")rLrA�JWKOperationsRegistryrCrM�append)r?rLrJ�vrrrrD�s
zInvalidJWKOperation.__str__)rrrrEr=rDrFrr)r@rrK�srKc@seZdZdZdS)�InvalidJWKValuez�Invalid JWK Value Exception.

    This exception is raised when an invalid/unknown value is used in the
    context of an operation that requires specific values to be used based
    on the key type or other constraints.
    N)rrrrErrrrrR�srRc@s�eZdZdZdd�Zedd��Zdd�Zd]d	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zedd ��Zd^d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zed0d1��Zed2d3��Zed4d5��Zed6d7��Zed8d9��Z ed:d;��Z!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%dDdE�Z&dFdG�Z'dHdI�Z(d_dJdK�Z)d`dLdM�Z*dadNdO�Z+dPdQ�Z,dbdRdS�Z-dcdUdV�Z.edWdX��Z/edddYdZ��Z0e1j2�fd[d\�Z3dS)e�JWKz�JSON Web Key object

    This object represent a Key.
    It must be instantiated by using the standard defined key/value pairs
    as arguments of the initialization function.
    cKsBt�|_t�|_t�|_d|kr.|jf|�n|r>|jf|�dS)a2Creates a new JWK object.

        The function arguments must be valid parameters as defined in the
        'IANA JSON Web Key Set Parameters registry' and specified in
        the :data:`JWKParamsRegistry` variable. The 'kty' parameter must
        always be provided and its value must be a valid one as defined
        by the 'IANA JSON Web Key Types registry' and specified in the
        :data:`JWKTypesRegistry` variable. The valid key parameters per
        key type are defined in the :data:`JWKValuesregistry` variable.

        To generate a new random key call the class method generate() with
        the appropriate 'kty' parameter, and other parameters as needed (key
        size, public exponents, curve types, etc..)

        Valid options per type, when generating new keys:
         * oct: size(int)
         * RSA: public_exponent(int), size(int)
         * EC: curve(str) (one of P-256, P-384, P-521)

        Deprecated:
        Alternatively if the 'generate' parameter is provided, with a
        valid key type as value then a new key will be generated according
        to the defaults or provided key strenght options (type specific).

        :raises InvalidJWKType: if the key type is invalid
        :raises InvalidJWKValue: if incorrect or inconsistent parameters
            are provided.
        �generateN)�dict�_params�_key�_unknown�generate_key�
import_key)r?�kwargsrrrr=�szJWK.__init__cKsR|�}d}y|d}t|d|�}Wn ttfk
rDt|��YnX||�|S)Nr,z_generate_%s)�getattr�KeyError�AttributeErrorr;)�clsr[�objr,�genrrrrT�szJWK.generatecKsNd}y|jd�}t|d|�}Wn ttfk
r@t|��YnX||�dS)NrTz_generate_%s)�popr\r]r^r;)r?�paramsr,rarrrrY�s
zJWK.generate_keyNcCsf|}d|kr|jd�}nJd|krbyddlm}|j|d�}Wntk
rZtd��YnX|j}|S)N�sizer/r)�JWAzInvalid 'alg' parameter)rbZjwcrypto.jwareZinstantiate_algr]�
ValueErrorZkeysize)r?rcZdefault_sizerdrer/rrr�
_get_gen_sizeszJWK._get_gen_sizecCs>|j|d�}tj|d�}d|d<t|�|d<|jf|�dS)N��rr,r+)rg�os�urandomrrZ)r?rcrd�keyrrr�
_generate_octs
zJWK._generate_octcCs0t|�jd�jd�}ttt|�dd|��S)N�LZ0x��0)�hex�rstrip�lstriprr�len)r?�iZintgrrr�_encode_intszJWK._encode_intcCsDd}|j|d�}d|kr"|jd�}tj||t��}|j|f|�dS)NiiZpublic_exponent)rgrbr�generate_private_keyr�_import_pyca_pri_rsa)r?rcZpubexprdrlrrr�
_generate_RSAs
zJWK._generate_RSAcKsx|j�}|jd|j|jj�|j|jj�|j|j�|j|j�|j|j�|j|j	�|j|j
�|j|j�d�	|jf|�dS)Nr)	r,r$r%r"r&r'r(r)r*)
�private_numbers�updaterv�public_numbersr$r%r"r&r'Zdmp1Zdmq1ZiqmprZ)r?rlrc�pnrrrrx!s




zJWK._import_pyca_pri_rsacKs8|j�}|jd|j|j�|j|j�d�|jf|�dS)Nr)r,r$r%)r|r{rvr$r%rZ)r?rlrcr}rrr�_import_pyca_pub_rsa0s
zJWK._import_pyca_pub_rsacCs<|dkrtj�S|dkr tj�S|dkr0tj�Std��dS)NzP-256zP-384zP-521zUnknown Elliptic Curve Type)r
Z	SECP256R1Z	SECP384R1Z	SECP521R1rR)r?rrrr�_get_curve_by_name9szJWK._get_curve_by_namecCsRd}d|kr|jd�}d|kr(|jd�}|j|�}tj|t��}|j|f|�dS)NzP-256�curver)rbrr
rwr�_import_pyca_pri_ec)r?rcr�Z
curve_namerlrrr�_generate_ECCs


zJWK._generate_ECcKsP|j�}|jdt|jj|j|jj�|j|jj�|j|j	�d�|j
f|�dS)Nr)r,rr r!r")rzr{�JWKpycaCurveMapr�rrvr|r r!Z
private_valuerZ)r?rlrcr}rrrr�Os
zJWK._import_pyca_pri_eccKsB|j�}|jdt|jj|j|j�|j|j�d�|jf|�dS)Nr)r,rr r!)	r|r{r�r�rrvr r!rZ)r?rlrcr}rrr�_import_pyca_pub_ecZs

zJWK._import_pyca_pub_eccKs�t|j��}xBttj��D]2}||kr|||j|<x||krJ|j|�q6WqW|jjdd�}|tkrnt|��xFtt|j��D]2}||kr�|||j	|<x||kr�|j|�q�Wq�Wx�t
t|�D]�\}}|jr�||j	kr�td|��|j
tjko�||j	k�rtd|��|j
tjk�r\||j	k�r\yt|j	|�Wn"tk
�rZtd|��YnX|dtjkr�||j	kr�y|j|j	|�Wq�tk
�r�td|��Yq�Xq�Wx|D]}|||j|<�q�Wt|j	�dk�r�td��d	|jk�rFxR|jd	D]D}d}x&|jd	D]}||k�r|d
7}�qW|d
k�r�td���q�Wd|jk�r�d	|jk�r�d
dg}	ddddddg}
|jddk�r�x`|
D]}||jd	k�r�td���q�Wn8|jddk�r�x&|	D]}||jd	k�r�td���q�WdS)Nr,zMissing required value %szUnsupported parameter %sz"%s" is not base64url encoded�z!"%s" is not Base64urlUInt encodedrzNo Key Values foundr.�zDuplicate values in "key_ops"r-r3r4r5r6r7r8r9r:r1zBIncompatible "use" and "key_ops" values specified at the same timer2)rArC�JWKParamsRegistryrV�remove�getrBr;�JWKValuesRegistryrWr�requiredrR�typerrrr�	Exceptionr�_decode_intrXrt)r?r[�namesrr,�valZko�cZckoZsiglZenclrLrrrrZdsn






zJWK.import_keycCsJ|�}yt|�}Wn*tk
r<}zt|��WYdd}~XnX|jf|�S)zyCreates a RFC 7517 JWK from the standard JSON format.

        :param key: The RFC 7517 representation of a JWK.
        N)rr�rRrZ)r_rlr`Zjkeyr%rrr�	from_json�sz
JWK.from_jsonTcCs|dkr|j�S|j�SdS)a+Exports the key in the standard JSON format.
        Exports the key regardless of type, if private_key is False
        and the key is_symmetric an exceptionis raised.

        :param private_key(bool): Whether to export the private key.
                                  Defaults to True.
        TN)�_export_all�
export_public)r?�private_keyrrr�export�sz
JWK.exportcCs|j�}t|�S)z�Exports the public key in the standard JSON format.
        It fails if one is not available like when this function
        is called on a symmetric key.
        )�_public_paramsr)r?�pubrrrr��szJWK.export_publiccCs~|jstd��i}t}x.|D]&}||jr||jkr|j|||<qWt|jd}x$|D]}||jrZ|j|||<qZW|S)NzNo public key availabler,)�
has_publicr;r��publicrVr�rW)r?r�Zpregr�regZparamrrrr��s




zJWK._public_paramscCs2t�}|j|j�|j|j�|j|j�t|�S)N)rUr{rVrWrXr)r?r"rrrr��s
zJWK._export_allcCs|jr|j�Std��dS)z�Export the private key in the standard JSON format.
        It fails for a JWK that has only a public key or is symmetric.
        zNo private key availableN)�has_privater�r;)r?rrr�export_private�szJWK.export_privatecCs|jr|j�Std��dS)NzNot a symmetric key)�is_symmetricr�r;)r?rrr�export_symmetric�szJWK.export_symmetriccCs|j�}tf|�S)N)r�rS)r?r�rrrr��sz
JWK.publiccCsB|jr
dSt|jd}x$|D]}||jr||jkrdSqWdS)z.Whether this JWK has an asymmetric Public key.Fr,TN)r�r�rVr�rW)r?r�r>rrrr��s
zJWK.has_publiccCsD|jr
dSt|jd}x&|D]}||jr||jkrdSqWdS)z3Whether this JWK has an asymmetric key Private key.Fr,T)r�r�rVr�rW)r?r�r>rrrr�s
zJWK.has_privatecCs
|jdkS)z$Whether this JWK is a symmetric key.r)�key_type)r?rrrr�szJWK.is_symmetriccCs|jjdd�S)zThe Key typer,N)rVr�)r?rrrr�szJWK.key_typecCs|jjdd�S)z^The Key ID.
        Provided by the kid parameter if present, otherwise returns None.
        r0N)rVr�)r?rrr�key_idsz
JWK.key_idcCs |jddkrtd��|jdS)zThe Curve Name.r,rz
Not an EC keyr)rVr;rW)r?rrr�	key_curve"sz
JWK.key_curvecCsN|j}|jddkrtd��|r@|d|kr@td||df��|j|d�S)z�Gets the Elliptic Curve associated with the key.

        :param arg: an optional curve name

        :raises InvalidJWKType: the key is not an EC key.
        :raises InvalidJWKValue: if the curve names is invalid.
        r,rz
Not an EC keyrz.Curve requested is "%s", but key curve is "%s")rWrVr;rRr)r?�argr+rrr�	get_curve)sz
JWK.get_curvecCs\|jjdd�}|r$||kr$t||��|jjdd�}|rXt|t�sF|g}||krXt||��dS)Nr-r.)rVr�rG�
isinstancerArK)r?rIrNr-Zopsrrr�_check_constraints:s

zJWK._check_constraintscCsttt|��d�S)N�)�intrr)r?r$rrrr�FszJWK._decode_intcCs tj|j|d�|j|d��S)Nr%r$)rZRSAPublicNumbersr�)r?r+rrr�_rsa_pubIszJWK._rsa_pubc	CsXtj|j|d�|j|d�|j|d�|j|d�|j|d�|j|d�|j|��S)Nr&r'r"r(r)r*)rZRSAPrivateNumbersr�r�)r?r+rrr�_rsa_priMszJWK._rsa_pricCs(tj|j|d�|j|d�|j|��S)Nr r!)r
ZEllipticCurvePublicNumbersr�r�)r?r+r�rrr�_ec_pubVszJWK._ec_pubcCstj|j|d�|j||��S)Nr")r
ZEllipticCurvePrivateNumbersr�r�)r?r+r�rrr�_ec_pri[szJWK._ec_pricCsf|jddkr|jdS|jddkr:|j|j�jt��S|jddkr^|j|j|�jt��St�dS)Nr,rr+rr)rVrWr��
public_keyrr��NotImplementedError)r?r�rrr�_get_public_key_s
zJWK._get_public_keycCsf|jddkr|jdS|jddkr:|j|j�jt��S|jddkr^|j|j|�jt��St�dS)Nr,rr+rr)rVrWr�r�rr�r�)r?r�rrr�_get_private_keyis
zJWK._get_private_keycCs�|jjdttj���}|tk	r$|g}|dkrP|jddkrD|jdSt||��n�|dkrn|jd|�|j|�S|dkr�|jd|�|j	|�S|d	ks�|d
kr�|jd|�|j	|�S|dks�|d
kr�|jd|�|j|�St
�dS)a�Get the key object associated to the requested opration.
        For example the public RSA key for the 'verify' operation or
        the private EC key for the 'decrypt' operation.

        :param operation: The requested operation.
         The valid set of operations is availble in the
         :data:`JWKOperationsRegistry` registry.
        :param arg: an optional, context specific, argument
         For example a curve name.

        :raises InvalidJWKOperation: if the operation is unknown or
         not permitted with this key.
        :raises InvalidJWKUsage: if the use constraints do not permit
         the operation.
        r.Nr,rr+r3r1r4r5r7r2r6r8)rVr�rArOrCrWrKr�r�r�r�)r?rNr�Zvalidopsrrr�
get_op_keyss*




zJWK.get_op_keycCspt|tj�r|j|�nTt|tj�r0|j|�n<t|tj�rH|j|�n$t|tj	�r`|j
|�ntd|��dS)NzUnknown key object %r)r�rZ
RSAPrivateKeyrxZRSAPublicKeyr~r
ZEllipticCurvePrivateKeyr�ZEllipticCurvePublicKeyr�rR)r?rlrrr�import_from_pyca�szJWK.import_from_pycacCs�ytj||t�d�}Wn�tk
r�}zr|dk	r4|�ytj|t�d�}WnJtk
r�ytj|t�d�}|j�}Wntk
r�|�YnXYnXWYdd}~XnX|j|�|j	�|j
d<dS)atImports a key from data loaded from a PEM file.
        The key may be encrypted with a password.
        Private keys (PKCS#8 format), public keys, and X509 certificate's
        public keys can be imported with this interface.

        :param data(bytes): The data contained in a PEM file.
        :param password(bytes): An optional password to unwrap the key.
        )�password�backendN)r�r0)r	Zload_pem_private_keyrrfZload_pem_public_keyrZload_pem_x509_certificater�r��
thumbprintrV)r?�datar�rlr%Zcertrrr�import_from_pem�s$
"
zJWK.import_from_pemFcCs�tjj}|rx|jstd��tjj}|dkr4tj�}n0t|t	�rJtj
|�}n|dkr\td��ntd��|j
�j|||d�S|js�td��tjj}|j�j||d�SdS)	a
Exports keys to a data buffer suitable to be stored as a PEM file.
        Either the public or the private key can be exported to a PEM file.
        For private keys the PKCS#8 format is used. If a password is provided
        the best encryption method available as determined by the cryptography
        module is used to wrap the key.

        :param private_key: Whether the private key should be exported.
         Defaults to `False` which means the public key is exported by default.
        :param password(bytes): A password for wrapping the private key.
         Defaults to False which will cause the operation to fail. To avoid
         encryption the user must explicitly pass None, otherwise the user
         needs to provide a password in a bytes buffer.
        zNo private key availableNFz+The password must be None or a bytes stringz!The password string must be bytes)�encoding�formatZencryption_algorithmzNo public key available)r�r�)r	ZEncodingZPEMr�r;Z
PrivateFormatZPKCS8ZNoEncryptionr��bytesZBestAvailableEncryptionrf�	TypeErrorr�Z
private_bytesr�ZPublicFormatZSubjectPublicKeyInfor�Zpublic_bytes)r?r�r�r%�f�arrr�
export_to_pem�s$


zJWK.export_to_pemcCs|�}|j|�|S)N)r�)r_rlr`rrr�	from_pyca�s
z
JWK.from_pycacCs|�}|j||�|S)aCreates a key from PKCS#8 formatted data loaded from a PEM file.
           See the function `import_from_pem` for details.

        :param data(bytes): The data contained in a PEM file.
        :param password(bytes): An optional password to unwrap the key.
        )r�)r_r�r�r`rrr�from_pem�szJWK.from_pemcCstd|jdi}x0tt|d�D]\}}|jr |j|||<q Wtj|t�d�}|jt	t
|�jd���t|j
��S)z{Returns the key thumbprint as specified by RFC 7638.

        :param hashalg: A hash function (defaults to SHA256)
        r,)r��utf8)rVrr�r�rWrZHashrr{r�r�encoder�finalize)r?Zhashalg�trr�Zdigestrrrr��szJWK.thumbprint)N)T)N)N)NN)N)FF)N)4rrrrEr=�classmethodrTrYrgrmrvryrxr~rr�r�r�rZr�r�r�r�r�r�r�r��propertyr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rZSHA256r�rrrrrS�s\&


	

M

	




'

#rSc@seZdZdd�ZdS)�_JWKkeyscCs"t|t�std��tj||�dS)z�Adds a JWK object to the set

        :param elem: the JWK object to add.

        :raises TypeError: if the object is not a JWK.
        z#Only JWK objects are valid elementsN)r�rSr��set�add)r?�elemrrrr�
s
z_JWKkeys.addN)rrrr�rrrrr�sr�csreZdZdZ�fdd�Zdd�Zdd�Z�fdd	�Zd
d�Zdd
�Z	ddd�Z
dd�Zedd��Z
dd�Z�ZS)�JWKSetz�A set of JWK objects.

    Inherits from the standard 'dict' bultin type.
    Creates a special key 'keys' that is of a type derived from 'set'
    The 'keys' attribute accepts only :class:`jwcrypto.jwk.JWK` elements.
    cs2tt|�j�tt|�jdt��|j||�dS)NrC)r<r�r=�__setitem__r�r{)r?�argsr[)r@rrr=szJWKSet.__init__cCs|dj�S)NrC)�__iter__)r?rrrr�"szJWKSet.__iter__cCs|dj|�S)NrC)�__contains__)r?rlrrrr�%szJWKSet.__contains__cs.|dkr|dj|�ntt|�j||�dS)NrC)r�r<r�r�)r?rlr�)r@rrr�(szJWKSet.__setitem__cOs,x&tt||��D]\}}|j||�qWdS)N)rrUr�)r?r�r[r+rQrrrr{.sz
JWKSet.updatecCs|dj|�dS)NrC)r�)r?r�rrrr�2sz
JWKSet.addTcCs`t�}xPt|�D]D\}}|dkrLt�}x |D]}|jt|j|���q,W|}|||<qWt|�S)z�Exports a RFC 7517 keyset using the standard JSON format

        :param private_key(bool): Whether to export private keys.
                                  Defaults to True.
        rC)rUrrArPrr�r)r?Zprivate_keysZexp_dictr+rQrC�jwkrrrr�5s
z
JWKSet.exportcCs�yt|�}Wntk
r&t��YnXd|kr6t��xHt|�D]<\}}|dkrtx*|D]}|djtf|��qVWq@|||<q@W|S)z�Imports a RFC 7517 keyset using the standard JSON format.

        :param keyset: The RFC 7517 representation of a JOSE Keyset.
        rC)rr�rRrr�rS)r?�keysetZjwksetr+rQr�rrr�
import_keysetEs
zJWKSet.import_keysetcCs|�}|j|�S)z�Creates a RFC 7517 keyset from the standard JSON format.

        :param keyset: The RFC 7517 representation of a JOSE Keyset.
        )r�)r_r�r`rrrr�[szJWKSet.from_jsoncCs$x|dD]}|j|kr
|Sq
WdS)zOGets a key from the set.
        :param kid: the 'kid' key identifier.
        rCN)r�)r?r0r�rrr�get_keyds
zJWKSet.get_key)T)rrrrEr=r�r�r�r{r�r�r�r�r�r�rFrr)r@rr�s
	r�)1rjZbinasciirr�collectionsr�enumrZcryptographyrZcryptography.hazmat.backendsrZcryptography.hazmat.primitivesrr	Z)cryptography.hazmat.primitives.asymmetricr
rZsixrZjwcrypto.commonr
rrrrrBrZJWKParameterrrrrr�r�ZJWKEllipticCurveRegistryrHrOr�r;rGrKrR�objectrSr�r�rUr�rrrr�<module>s�



O