+
    +b  c                    s	   ^ RI t ^ RIHtHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHtHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHtHt ^ RIHtHt  ! R R4      t. t ^ RIHtHt ]P=                  R4        ^ RI H!t!H"t" ]P=                  R4        ^ RI#H$t$H%t% ]&! ]%RR4      t']'f   ]h]P=                  R4        ^ RI(H)t)H*t* ]P=                  R4       ]! RR4      t+]! RR4      t,]! RR4      t-]! RR4      t.R]+! ]]4      R],! ]!]"4      R]-! ]$]%4      R].! ])]*4      /t/RRRRRRRR /t0  ! R! R"]4      t1]! R#R$4      t2RR%]2! R&R'R']1Pf                  4      R(]2! R)R'R']1Ph                  4      R*]2! R+R'R']1Ph                  4      R,]2! R-R.R.]1Ph                  4      /RR/]2! R0R'R']1Ph                  4      R1]2! R2R'R']1Pj                  4      R,]2! R3R.R.]1Pj                  4      R4]2! R5R.R.]1Pj                  4      R6]2! R7R.R.]1Pj                  4      R8]2! R9R.R.]1Pj                  4      R:]2! R;R.R.]1Pj                  4      R<]2! R=R.R.]1Pj                  4      R>]2! R?R.R.]1Pl                  4      /	RR@]2! RAR.R']1Ph                  4      /RR%]2! R&R'R']1Pf                  4      R(]2! RBR'R']1Ph                  4      R,]2! RCR.R.]1Ph                  4      //t7 RD]2! RER'RR4      RF]2! RGR'RR4      RH]2! RIR'RR4      RJ]2! RKR'RR4      RL]2! RMR'RR4      RN]2! ROR'RR4      RP]2! RQR'RR4      RR]2! RSR'RR4      RT]2! RUR'RR4      /	t8 RVRWRXRYRZR[R\R]RR^RR_RR`RRa/t9 RbRcRdRe/t: RfRgRhRiRjRkRlRmRnRoRpRqRrRsRtRu/t; RvRVRwRXRxRZR\R\/t<Ry]Pz                  ! 4       RzRR{RR|RR}RR~RR]P|                  ! 4       R]P~                  ! 4       R]P                  ! 4       R]P                  ! 4       R]P                  ! 4       R]P                  ! 4       R]P                  ! ^ 4      RRR]P                  ! ^@4      /tF ! R R]4      tG ! R R]4      tH ! R R]4      tI ! R R]4      tJ ! R R]K4      tL ! R R]M4      tN ! R R]K4      tOR#   ] d	    ]t]t ELi ; i  ] d	    ]t!]t" ELi ; i  ] d	    ]t$]t% ELi ; i  ] d	    ]t)]t* ELi ; i)    N)hexlify	unhexlify)
namedtuple)Enum)x509)default_backend)hashesserialization)ec)rsa)
deprecated)JWException)base64url_decodebase64url_encode)json_decodejson_encodec                   sP   a  ] tR t^t o ]R 4       t]R 4       t]R 4       tRtV t	R# )UnimplementedOKPCurveKeyc                    \         hNNotImplementedError)cls   &1/usr/lib/python3.14/site-packages/jwcrypto/jwk.pygenerateZ!UnimplementedOKPCurveKey.generate       !!    c                r   r   r   r   args   &*r   from_public_bytesZ*UnimplementedOKPCurveKey.from_public_bytes   r   r   c                r   r   r   r   r   r   from_private_bytesZ+UnimplementedOKPCurveKey.from_private_bytes   r   r    N)
__name__
__module____qualname____firstlineno__classmethodr   r   r    __static_attributes____classdictcell____classdict__   @r   r   r      s?     " " " " " "r   r   )Ed25519PublicKeyEd25519PrivateKeyZEd25519)Ed448PublicKeyEd448PrivateKeyZEd448)X25519PublicKeyX25519PrivateKeyr    ZX25519)X448PublicKeyX448PrivateKeyZX448zpubkey privkeyECzElliptic CurveRSAoctzOctet sequenceOKPzOctet Key Pairc                   s&    ] tR t^dtRtRtRtRtRtR# )ParmTypezA string with a namezBase64url EncodedzBase64urlUint EncodedzUnsupported Parameterr!   N)	r"   r#   r$   r%   nameb64b64uunsupportedr'   r!   r   r   r8   r8   d   s    !D
C"D)Kr   r8   Z	Parameterz description public required typecrvZCurveTxzX CoordinateyzY CoordinatedzECC Private KeyFnZModuluseZExponentzPrivate ExponentpzFirst Prime FactorqzSecond Prime FactordpzFirst Factor CRT ExponentdqzSecond Factor CRT ExponentqizFirst CRT CoefficientZothzOther Primes Infokz	Key Valuez
Public KeyzPrivate KeyktyzKey TypeusezPublic Key Usekey_opszKey OperationsalgZ	AlgorithmkidzKey IDZx5uz	X.509 URLZx5czX.509 Certificate ChainZx5tz"X.509 Certificate SHA-1 Thumbprintzx5t#S256z$X.509 Certificate SHA-256 ThumbprintP-256zP-256 curveP-384zP-384 curveP-521zP-521 curve	secp256k1zSECG secp256k1 curvez%Ed25519 signature algorithm key pairsz#Ed448 signature algorithm key pairszX25519 function key pairszX448 function key pairssigzDigital Signature or MACencZ
Encryptionsignz Compute digital Signature or MACverifyzVerify digital signature or MACencryptzEncrypt contentdecryptz6Decrypt content and validate decryption, if applicablewrapKeyzEncrypt key	unwrapKeyz2Decrypt key and validate decryption, if applicable	deriveKeyz
Derive key
deriveBitsz#Derive bits not to be used as a keyZ	secp256r1Z	secp384r1Z	secp521r1sha-256zsha-256-128zsha-256-120z
sha-256-96z
sha-256-64z
sha-256-32zsha-384zsha-512zsha3-224zsha3-256zsha3-384zsha3-512zblake2s-256zblake2b-256zblake2b-512c                   s@   a a ] tR t^t oRtRV 3R lltR tRtVtV ;t	# )InvalidJWKTypez^Invalid JWK Type Exception.

This exception is raised when an invalid parameter type is used.
c                s8   < \         \        V `  4        Wn        R # r   )superr]   __init__value)selfr`   	__class__s   &&r   r_   ZInvalidJWKType.__init__   s    nd,.
r   c                s`    R V P                   : R\        \        P                  4       4      : 2# )zUnknown type "z", valid types are: )r`   listJWKTypesRegistrykeysra   r   r   __str__ZInvalidJWKType.__str__   s$    JJ-22457 	7r   )r`   r   
r"   r#   r$   r%   __doc__r_   rg   r'   r(   __classcell__rb   r*      @@r   r]   r]      s     
7 7r   r]   c                   s<   a a ] tR t^t oRtV 3R ltR tRtVtV ;t	# )InvalidJWKUsagezInvalid JWK usage Exception.

This exception is raised when an invalid key usage is requested,
based on the key type and declared usage constraints.
c                sD   < \         \        V `  4        W n        Wn        R # r   )r^   rm   r_   r`   rJ   )ra   rJ   r`   rb      &&&r   r_   ZInvalidJWKUsage.__init__   s    ot-/
r   c                st   V P                   \        \        P                  4       4      9   d   \        V P                   ,          pMR V P                   ,          pV P                  \        \        P                  4       4      9   d   \        V P                  ,          pMR V P                  ,          pRV: RV: R2# )Unknown(%s)zInvalid usage requested: "". Valid for: "")rJ   rc   JWKUseRegistryre   r`   )ra   usagevalid   &  r   rg   ZInvalidJWKUsage.__str__   s    88tN//122"488,E!DHH,E::n11344"4::.E!DJJ.ECHCHJ 	Jr   )rJ   r`   rh   rk   rl   r   rm   rm      s     

J 
Jr   rm   c                   s<   a a ] tR t^t oRtV 3R ltR tRtVtV ;t	# )InvalidJWKOperationzInvalid JWK Operation Exception.

This exception is raised when an invalid key operation is requested,
based on the key type and declared usage constraints.
c                sD   < \         \        V `  4        Wn        W n        R # r   )r^   rv   r_   opvalues)ra   	operationrx   rb   rn   r   r_   ZInvalidJWKOperation.__init__  s    !413r   c                s   V P                   \        \        P                  4       4      9   d   \        V P                   ,          pMR V P                   ,          p. pV P                   F[  pV\        \        P                  4       4      9   d   VP                  \        V,          4       KC  VP                  R V,          4       K]  	  RV: RV: R2# )ro   zInvalid operation requested: "rp   rq   )rw   rc   JWKOperationsRegistryre   rx   append)ra   rw   rt   v   &   r   rg   ZInvalidJWKOperation.__str__  s    77d055788&tww/B(BAD.335662156]Q./	 
 HJGLN 	Nr   )rw   rx   rh   rk   rl   r   rv   rv      s     
N Nr   rv   c                   s    ] tR tRtRtRtR# )InvalidJWKValuei  zInvalid 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.
r!   N)r"   r#   r$   r%   ri   r'   r!   r   r   r~   r~     s    r   r~   c                   s  a a ] tR tRt oRtV 3R lt]R 4       tR tRER lt	R t
RER ltR	 tR
 tR tRER ltR tR tR tR tR tR tR tR t]R 4       tRFR ltRGR ltR tRGR ltRGR ltRGR ltR t] R 4       t!] R 4       t"] R 4       t#] ]$R  4       4       t%] ]$R! 4       4       t&] ]$R" 4       4       t']$R# 4       t(R$ t)R% t*R& t+R' t,R( t-R) t.R* t/R+ t0R, t1R- t2R. t3R/ t4RER0 lt5RER1 lt6RHR2 lt7R3 t8RHR4 lt9RIR5 lt:]R6 4       t;]RER7 l4       t<]=P|                  ! 4       3R8 lt?RJR9 lt@V 3R: ltAR; tBRER< ltCV 3R= ltDR> tER? tFR@ tGV 3RA ltH]RB 4       tIRC tJRDtKVtLV ;tM# )KJWKi  zJSON Web Key object

This object represents a Key.
It must be instantiated by using the standard defined key/value pairs
as arguments of the initialization function.
c                s   < \         \        V `  4        RV n        RV n        RV9   d   V P
                  ! R/ VB  R# V'       d   V P                  ! R/ VB  R# R# )a  Creates 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: crv(str) (one of P-256, P-384, P-521, secp256k1)
 * OKP: crv(str) (one of Ed25519, Ed448, X25519, X448)

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 strength options (type specific).

:param \**kwargs: parameters (otional).

:raises InvalidJWKType: if the key type is invalid
:raises InvalidJWKValue: if incorrect or inconsistent parameters
    are provided.
Nr   r!   )r^   r   r_   _cache_pub_k_cache_pri_kgenerate_key
import_key)ra   kwargsrb   s   &,r   r_   ZJWK.__init__&  sS    @ 	c4!#  ''OO%f% r   c                s    V ! 4       pR p VR,          p\        VRV,          4      pT! T4       T#   \        \        3 d   p\        T4      ThR p?ii ; i)NrI   _generate_%s)getattrKeyErrorAttributeErrorr]   )r   r   objrI   genrB   s   &,    r   r   ZJWK.generateO  s_    e	--C#~34C 	F
 .) 	- %1,	-s   1 AAAc                s    R p VP                  R4      p\        V RV,          4      pT! T4       R #   \        \        3 d   p\	        T4      ThR p?ii ; i)Nr   r   )popr   r   r   r]   )ra   paramsrI   r   rB   s   &,   r   r   ZJWK.generate_key[  sX    	-**Z(C$ 45C 	F .) 	- %1,	-s   $2 AAAc                s    TpR V9   d   VP                  R 4      pV# RV9   d,    ^ RIHp VP                  VR,          4      pTP                  pV#   \         d   p\        R4      ThRp?ii ; i)sizerL   )JWAzInvalid 'alg' parameterN)r   Zjwcrypto.jwar   Zinstantiate_algr   
ValueErrorZkeysize)ra   r   Zdefault_sizer   r   rL   rB      &&&    r   _get_gen_sizeZJWK._get_gen_sizee  s|    V::f%D  f_C,))&-8 ;;D  C !:;BCs   A A-A((A-c                s    V P                  V^4      p\        P                  ! V^,          4      pRVR&   \        V4      VR&   V P                  ! R/ VB  R# )i   r6   rI   rH   Nr!   )r   osZurandomr   r   )ra   r   r   key   &&  r   _generate_octZJWK._generate_octr  sL    !!&#.jj#u&s+s!&!r   c                s   ^ pVe   V^,           ^,          ^,          p\        V4      P                  R4      P                  R4      p\        V4      pW58  d
   W5,          pM	V^,          p\	        \        VR,          V,           4      4      # )r    ZLZ0xZ0)ZhexZrstripZlstriplenr   r   )ra   ZiZbit_sizeZextendZhexiZhexl   &&&   r   _encode_intZJWK._encode_inty  st    !|)Q.F1v}}S!((.4y=NFAXF	&3,*= >??r   c                s    R pV P                  VR4      pRV9   d   VP                  R4      p\        P                  ! W#\	        4       4      pV P
                  ! V3/ VB  R# )i  i   Zpublic_exponentN)r   r   r
   generate_private_keyr   _import_pyca_pri_rsa)ra   r   Zpubexpr   r      &&   r   _generate_RSAZJWK._generate_RSA  sX    !!&$/&ZZ 12F&&v_5FG!!#00r   c                s6   VP                  4       pVP                  R V P                  VP                  P                  4      V P                  VP                  P
                  4      V P                  VP                  4      V P                  VP                  4      V P                  VP                  4      V P                  VP                  4      V P                  VP                  4      V P                  VP                  4      R7	       V P                  ! R/ VB  R# )r5   )	rI   rA   rB   r@   rC   rD   rE   rF   rG   Nr!   )private_numbersupdater   public_numbersrA   rB   r@   rC   rD   Zdmp1Zdmq1Ziqmpr   ra   r   r   pn   &&, r   r   ZJWK._import_pyca_pri_rsa  s      "r00223r00223rtt$rtt$rtt$((( 	 
	
 	!&!r   c                s    VP                  4       pVP                  R V P                  VP                  4      V P                  VP                  4      R7       V P
                  ! R/ VB  R# )r5   )rI   rA   rB   Nr!   )r   r   r   rA   rB   r   r   r   r   _import_pyca_pub_rsaZJWK._import_pyca_pub_rsa  sY    !rtt$rtt$ 	 	

 	!&!r   c                s>   V P                  R 4      pVf   TpMVR8X  d   RpMTpV'       d&   TpVR8X  d   RpWT8w  d   \        RV: RV: R24      hV P                  R4      pVe   Ve   Wb8w  d   \        RV: RV: R24      hVR	8X  d   \        P                  ! 4       # VR
8X  d   \        P
                  ! 4       # VR8X  d   \        P                  ! 4       # VR8X  d   \        P                  ! 4       # V\        9   d   \        V,          # \        RV,          4      h)r=   zP-256KrQ   zCurve requested is "z", but key curve is "rq   rI   zCurve Requested is of type "z", but key curve is of type "rN   rO   rP   zUnknown Curve Name [%s])	getr~   r]   r	   Z	SECP256R1Z	SECP384R1Z	SECP521R1Z	SECP256K1_OKP_CURVES_TABLE)ra   r9   ctyper=   ZcnameZccrvrI   r   r   _get_curve_by_nameZJWK._get_curve_by_name  s   hhuo<EX  EE Dx"}%=A3'H I Ihhuo?u0S\ @Es"L M M G<<>!g<<>!g<<>!k!<<>!''$U++!";t"DEEr   c                s    R pRV9   d   VP                  R4      pRV9   d   VP                  R4      pV P                  VR4      p\        P                  ! V\	        4       4      pV P
                  ! V3/ VB  R# )rN   curver=   r4   N)r   r   r	   r   r   _import_pyca_pri_ec)ra   r   r   curve_fnr   r   r   _generate_ECZJWK._generate_EC  sn    fJJw'E F?JJu%E**5$7%%h0AB  //r   c           
     s   VP                  4       pVP                  P                  P                  pVP	                  R \
        VP                  P                  ,          V P                  VP                  P                  V4      V P                  VP                  P                  V4      V P                  VP                  V4      R7       V P                  ! R/ VB  R# )r4   )rI   r=   r>   r?   r@   Nr!   )r   r   r   key_sizer   JWKpycaCurveMapr9   r   r>   r?   Zprivate_valuer   ra   r   r   r   r      &&,  r   r   ZJWK._import_pyca_pri_ec  s      "$$**33		/r0022H=r0022H=r//: 	 	
 	!&!r   c           	     sF   VP                  4       pVP                  P                  pVP                  R \        VP                  P
                  ,          V P                  VP                  V4      V P                  VP                  V4      R7       V P                  ! R/ VB  R# )r4   )rI   r=   r>   r?   Nr!   )
r   r   r   r   r   r9   r   r>   r?   r   r   r   r   _import_pyca_pub_ecZJWK._import_pyca_pub_ec  s|    !88$$		/rttX.rttX.	 	 	
 	!&!r   c                s    R V9  d   \        R4      hV P                  VR ,          R4      pVP                  P                  4       pV P                  ! V3/ VB  R# )r=   z)Must specify "crv" for OKP key generationr7   N)r~   r   privkeyr   _import_pyca_pri_okp)ra   r   r   r   r   r   _generate_OKPZJWK._generate_OKP  sS    !"MNN**6%=%@'')!!#00r   c                s    \         P                  4        F0  w  r#\        WP                  VP                  34      '       g   K.  Vu # 	  \        R V,          4      h)zInvalid OKP Key object %r)r   items
isinstancepubkeyr   r~   )ra   r   r9   valr   r   _okp_curve_from_pyca_keyZJWK._okp_curve_from_pyca_key  sG    *002ID#

CKK899 3 9C?@@r   c                s   VP                  R V P                  V4      \        VP                  \        P
                  P                  \        P                  P                  \        P                  ! 4       4      4      \        VP                  4       P                  \        P
                  P                  \        P                  P                  4      4      R7       V P                  ! R/ VB  R# )r7   )rI   r=   r@   r>   Nr!   )r   r   r   private_bytesr   EncodingRawPrivateFormatNoEncryption
public_keypublic_bytesPublicFormatr   ra   r   r      &&,r   r   ZJWK._import_pyca_pri_okp  s    --c2s00&&**++//**, . / s~~/<<&&****.. 0 1 	 
	
 	!&!r   c           
     s   VP                  R V P                  V4      \        VP                  \        P
                  P                  \        P                  P                  4      4      R7       V P                  ! R/ VB  R# )r7   )rI   r=   r>   Nr!   )	r   r   r   r   r   r   r   r   r   r   r   r   _import_pyca_pub_okpZJWK._import_pyca_pub_okp  sh    --c2s//&&****.. 0 1 	 	
 	!&!r   c                s   / p^ pRV n         RV n        \        VP                  4       4      p\        \        P                  4       4       F.  pWQ9   g   K  W,          W%&   WT9   g   K  VP                  V4       K  	  VP                  R4      pV\        9  d   \        V4      h\        \        V,          P                  4       4       F7  pWQ9   g   K  W,          W%&   V^,          pWT9   g   K&  VP                  V4       K  	  \        V,          P                  4        F  w  rWVP                  '       d   WR9  d   \        RV,          4      hVP                  \        P                  8X  d   WR9   d   \        RV,          4      hVP                  \        P                   8X  d   WR9   d    \#        W%,          4       VP                  \        P&                  8X  g   K  WR9   g   K   V P)                  W%,          4       K  	  V F  pW,          W%&   K  	  V^ 8X  d   \        R4      hRV9   dF   VR,           F8  p	^ p
VR,           F  pW8X  g   K  V
^,          p
K  	  V
^8w  g   K/  \        R	4      h	  R
V9   do   RV9   dh   RR.p. ROpVR
,          R8X  d#   V F  pWR,          9   g   K  \        R4      h	  M/VR
,          R8X  d"   V F  pWR,          9   g   K  \        R4      h	  V P+                  4        V P-                  RVR,          4       V P/                  V4       R#   \$         d   p\        RT,          4      ThRp?ii ; i  \$         d   p\        RT,          4      ThRp?ii ; i)r    NrI   zMissing required value %szUnsupported parameter %s"%s" is not base64url encoded!"%s" is not Base64urlUInt encodedzNo Key Values foundrK   zDuplicate values in "key_ops"rJ   rT   rU   rR   zBIncompatible "use" and "key_ops" values specified at the same timerS   )rV   rW   rX   rY   rZ   r[   )r   r   rc   re   JWKParamsRegistryZremover   rd   r]   JWKValuesRegistryr   requiredr~   typer8   r<   r:   r   	Exceptionr;   _decode_intZclear__setitem__r   )ra   r   ZnewkeyZkey_valsZnamesr9   rI   r   rB   ZkoZcZckoZsiglZenclrw   s   &,             r   r   ZJWK.import_key  s
     V[[]#*//12D~%|mLL&	 3 jj&& %%*3/4467D~%|AmLL& 8 +3/557ID||| 2%&AD&HIIxx8///DN%&@4&GHHxx8<<'DN$V\2
 xx8==(T^$$V\2! 8. D!<FL  q=!"788 Y''!),,CyQ - 6)*IJJ ( F?yF2H%D/De}%BI..- /? @ @ 
 %'BI..- /? @ @  	

u.Fg ! )7$> ! );dBs0   (L #M M+L>>MM)M$$M)c                s    V ! 4       p \        V4      pTP                  ! R/ TB  T#   \         d   p\        ThRp?ii ; i)zCreates a RFC 7517 JWK from the standard JSON format.

:param key: The RFC 7517 representation of a JWK.

:return: A JWK object that holds the json key.
:rtype: JWK
Nr!   )r   r   r~   r   )r   r   r   ZjkeyrB   r   r   	from_jsonZJWK.from_jsonl  sJ     e	)s#D 	
  	)!q(	)s   ( ?:?c                sR    VRJ d   V P                  V4      # V P                  V4      # )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 exception is raised.

:param private_key(bool): Whether to export the private key.
                          Defaults to True.

:return: A portable representation of the key.
    If as_dict is True then a dictionary is returned.
    By default a json string
:rtype: `str` or `dict`
T)_export_allexport_public)ra   private_keyas_dict   &&&r   exportZ
JWK.export}  s0     $ ##G,,!!'**r   c                sH    V P                  4       pVRJ d   V# \        V4      # )aw  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.

:param as_dict(bool): If set to True export as python dict not JSON

:return: A portable representation of the public key only.
    If as_dict is True then a dictionary is returned.
    By default a json string
:rtype: `str` or `dict`
T)_public_paramsr   )ra   r   pub   && r   r   ZJWK.export_public  s)     !!#d?J3r   c                s   V P                   '       g   \        R 4      h/ p\        pV FF  pW#,          P                  '       g   K  W0P	                  4       9   g   K3  V P                  V4      W&   KH  	  \        V P                  R4      ,          pV F0  pW#,          P                  '       g   K  V P                  V4      W&   K2  	  V# )No public key availablerI   )
has_publicr]   r   publicre   r   r   )ra   r   regr9   r}   r   r   ZJWK._public_params  s     !:;;Dy99;& $CI   0Dy HHTN	  
r   c                sN    / pVP                  V 4       VR J d   V# \        V4      # )T)r   r   )ra   r   r@   r   r   r   ZJWK._export_all  s(    	d?H1~r   c                s^    V P                   '       d   V P                  V4      # \        R4      h)aY  Export the private key in the standard JSON format.
It fails for a JWK that has only a public key or is symmetric.

:param as_dict(bool): If set to True export as python dict not JSON

:return: A portable representation of a private key.
    If as_dict is True then a dictionary is returned.
    By default a json string
:rtype: `str` or `dict`
No private key available)has_privater   r]   ra   r      &&r   export_privateZJWK.export_private  s-     ##G,,788r   c                s^    V P                   '       d   V P                  V4      # \        R 4      h)zNot a symmetric key)is_symmetricr   r]   r   r   r   export_symmetricZJWK.export_symmetric  s+    ##G,,233r   c                s8    V P                  4       p\        R/ VB # )Nr!   )r   r   )ra   r      & r   r   Z
JWK.public  s    !!#zSzr   c                s    V P                   '       d   R# \        V P                  R4      ,          pV F4  pW,          P                  '       g   K  W P	                  4       9   g   K3   R# 	  R# )z4Whether this JWK has an asymmetric Public key value.FrI   Tr   r   r   r   re   ra   r   r9   ru   r   r   ZJWK.has_public  sP     0DyDIIK$7  r   c                s    V P                   '       d   R# \        V P                  R4      ,          pV F4  pW,          P                  '       d   K  W P	                  4       9   g   K3   R# 	  R# )z5Whether this JWK has an asymmetric Private key value.FrI   Tr   r   ru   r   r   ZJWK.has_private  sP     0D9###		(;  r   c                s*    V P                  R4      R8H  # )z$Whether this JWK is a symmetric key.rI   r6   r   rf   r   r   r   ZJWK.is_symmetric  s     xx%''r   c                $    V P                  R4      # )zThe Key typerI   r   rf   r   r   key_typeZJWK.key_type  s     xxr   c                r   )zNThe Key ID.
Provided by the kid parameter if present, otherwise returns None.
rM   r   rf   r   r   key_idZ
JWK.key_id  s     xxr   c                sf    V P                  R4      R9  d   \        R4      hV P                  R4      # )zThe Curve Name.rI   zNot an EC or OKP keyr=   )r4   r7   )r   r]   rf   r   r   	key_curveZJWK.key_curve  s.     88E?-/ !788xxr   c                s$    V P                  V4      # )a   Gets the Elliptic Curve associated with the key.

:param arg: an optional curve name

:raises InvalidJWKType: the key is not an EC or OKP key.
:raises InvalidJWKValue: if the curve name is invalid.

:return: An EllipticCurve object
:rtype: `EllipticCurve`
)r   )ra   argr   r   	get_curveZJWK.get_curve  s     &&s++r   c                s    V P                  R 4      pV'       d   W18w  d   \        W4      hV P                  R4      pV'       d-   \        V\        4      '       g   V.pW$9  d   \	        W$4      hR# R# )rJ   rK   N)r   rm   r   rc   rv   )ra   rs   ry   rJ   Zopss   &&&  r   _check_constraintsZJWK._check_constraints  sa    hhuo3<!%--hhy!c4((e#))99 $ r   c                s>    \        \        \        V4      4      ^4      # )i   )Zintr   r   )ra   rA   r   r   r   ZJWK._decode_int  s    7+A./44r   c                s    V P                  V P                  R 4      4      pV P                  V P                  R4      4      p\        P                  ! W4      # )rB   rA   )r   r   r
   ZRSAPublicNumbers)ra   rB   rA   ru   r   
_rsa_pub_nZJWK._rsa_pub_n  sC    TXXc]+TXXc]+##A))r   c           
     s   V P                  V P                  R 4      4      pV P                  V P                  R4      4      pV P                  V P                  R4      4      pV P                  V P                  R4      4      pV P                  V P                  R4      4      pV P                  V P                  R4      4      p\        P                  ! WW4WVV P	                  4       4      # )rC   rD   r@   rE   rF   rG   )r   r   r
   ZRSAPrivateNumbersr   )ra   rC   rD   r@   rE   rF   rG   s   &      r   
_rsa_pri_nZJWK._rsa_pri_n#  s    TXXc]+TXXc]+TXXc]+dhhtn-dhhtn-dhhtn-$$Q1"$//:KLLr   c                    V P                   pVf.   V P                  4       P                  \        4       4      pWn         V# r   )r   r   r   r   ra   rH   r   r   _rsa_pubZJWK._rsa_pub,  s7    9!,,_->?A !r   c                r   r   )r   r   r   r   r   r   r   _rsa_priZJWK._rsa_pri3  s7    9!--o.?@A !r   c                s    V P                  V P                  R 4      4      pV P                  V P                  R4      4      pV P                  VRR7      p\        P                  ! W#V4      # )r>   r?   r4   )r   )r   r   r   r	   ZEllipticCurvePublicNumbers)ra   r   r>   r?   r   r   r   	_ec_pub_nZJWK._ec_pub_n:  sZ    TXXc]+TXXc]+**5*=,,Q8<<r   c                s    V P                  V P                  R 4      4      p\        P                  ! W P	                  V4      4      # )r@   )r   r   r	   ZEllipticCurvePrivateNumbersr   )ra   r   r@   r   r   	_ec_pri_nZJWK._ec_pri_n@  s4    TXXc]+--a1FGGr   c                    V P                   pVf/   V P                  V4      P                  \        4       4      pW n         V# r   )r   r   r   r   ra   r   rH   r   r   _ec_pubZJWK._ec_pubD  s9    9u%001BCA !r   c                r   r   )r   r   r   r   r   r   r   _ec_priZJWK._ec_priK  s9    9u%11/2CDA !r   c                &   V P                   pVf[   V P                  R4      p \        V,          P                  p\        T P                  R4      4      pTP                  T4      pYn         V#   \         d   p\        RT,          4      ThR p?ii ; i)Nr=   Unknown curve "%s"r>   )r   r   r   r   r   r~   r   r   )ra   rH   r=   r   rB   r>      &     r   _okp_pubZJWK._okp_pubR  s    9((5/CI*3/66 !#/A((+A !  I%&:S&@AqHI   A- -B8BBc                r   )Nr=   r   r@   )r   r   r   r   r   r~   r   r    )ra   rH   r=   r   rB   r@   r   r   _okp_priZJWK._okp_pri`  s    9((5/CI+C088 !#/A**1-A !  I%&:S&@AqHIr   c                    V P                  R 4      pVR8X  d   V P                  R4      # VR8X  d   V P                  4       # VR8X  d   V P                  V4      # VR8X  d   V P                  4       # \        hrI   r6   rH   r5   r4   r7   )r   r   r   r   r   ra   r   Zktyper   r   _get_public_keyZJWK._get_public_keyn  f    E>88C= e^==?"d]<<$$e^==?"%%r   c                r   r   )r   r   r   r   r   r  r   r   _get_private_keyZJWK._get_private_key{  r  r   c                sZ   V P                  R\        \        P                  4       4      4      pV\        Jd   V.pVf3   V P                  R4      R8X  d   V P                  R4      # \	        W4      hVR8X  d$   V P                  RV4       V P                  V4      # VR8X  d$   V P                  RV4       V P                  V4      # VR8X  g   VR	8X  d$   V P                  R
V4       V P                  V4      # VR8X  g   VR8X  d$   V P                  R
V4       V P                  V4      # \        h)a  Get the key object associated to the requested operation.
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 available 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.

:return: A Python Cryptography key object for asymmetric keys
    or a baseurl64_encoded octet string for symmetric keys
rK   rI   r6   rH   rT   rR   rU   rV   rX   rS   rW   rY   )	r   rc   rz   re   rv   r   r  r  r   )ra   ry   r   Zvalidops   &&& r   
get_op_keyZJWK.get_op_key  s   & 88I !6!;!;!=>@4 zHxx%'xx}$%i::& ##E95((--("##E95'',,)#yI'=##E95'',,)#yK'?##E95((--%%r   c                sz   \        V\        P                  4      '       d   V P                  V4       R# \        V\        P                  4      '       d   V P                  V4       R# \        V\        P                  4      '       d   V P                  V4       R# \        V\        P                  4      '       d   V P                  V4       R# \        V\        \        34      '       d   V P                  V4       R# \        V\        \        34      '       d   V P!                  V4       R# \#        R V,          4      h)zUnknown key object %rN)r   r
   ZRSAPrivateKeyr   ZRSAPublicKeyr   r	   ZEllipticCurvePrivateKeyr   ZEllipticCurvePublicKeyr   r-   r/   r   r,   r.   r   r~   ra   r   r   r   import_from_pycaZJWK.import_from_pyca  s    c3,,--%%c*S--..%%c*R7788$$S)R6677$$S)/ABB%%c*.?@@%%c*!"9C"?@@r   c                s    \         P                  ! W\        4       R7      pT P                  T4       Tf   T P                  4       pT P                  RT4       R#   \         d   pTe   Th \         P                  ! T\        4       R7      p Rp?Lp  \         dJ     \
        P                  ! T\        4       R7      pTP                  4       p  Rp?L  \         d    Thi ; ii ; iRp?ii ; i)aD  Imports 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
  rM   )r   Zload_pem_private_keyr   r   Zload_pem_public_keyr   Zload_pem_x509_certificater   r  
thumbprintr   )ra   datar	  rM   r   rB   Zcerts   &&&&   r   import_from_pemZJWK.import_from_pem  s    	441BDC" 	c";//#C$%  	#
#77/"35 99o&79D//+C! G	sA    A C.&C)- BC&0CC)C""C&&C))C.c                sj   \         P                  P                  pV'       d   V P                  '       g   \	        R4      h\         P
                  P                  pVf   \         P                  ! 4       pMI\        V\        4      '       d   \         P                  ! V4      pMVRJ d   \        R4      h\        R4      hV P                  4       P                  W4VR7      # V P                  '       g   \	        R4      h\         P                   P"                  pV P%                  4       P'                  W4R7      # )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.

:return: A serialized bytes buffer containing a PEM formatted key.
:rtype: `bytes`
r   Fz+The password must be None or a bytes stringz!The password string must be bytes)encodingformatZencryption_algorithmr   )r  r  )r   r   ZPEMr   r]   r   ZPKCS8r   r   bytesZBestAvailableEncryptionr   	TypeErrorr  r   r   r   ZSubjectPublicKeyInfor  r   )ra   r   r	  rB   ZfZar   r   export_to_pemZJWK.export_to_pem  s    " ""&&###$%?@@++11A!..0He,,!99(CU" !NOO CDD((*881 9 > > ???$%>??**??A'')666LLr   c                6    V ! 4       pVP                  V4       V# r   )r  )r   r   r   r   r   	from_pycaZJWK.from_pyca	  s    eS!
r   c                s6    V ! 4       pVP                  W4       V# )a  Creates 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.

:return: A JWK object.
:rtype: JWK
)r  )r   r  r	  r   r  r   from_pemZJWK.from_pem  s     eD+
r   c                s   RV P                  R4      /p\        VR,          ,          P                  4        F,  w  r4VP                  '       g   K  V P                  V4      W#&   K.  	  \        P
                  ! V\        4       R7      pVP                  \        \        V4      P                  R4      4      4       \        VP                  4       4      # )zReturns the key thumbprint as specified by RFC 7638.

:param hashalg: A hash function (defaults to SHA256)

:return: A base64url encoded digest of the key
:rtype: `str`
rI   r  utf8)r   r   r   r   r   ZHashr   r   r  r   encoder   Zfinalize)ra   Zhashalgtr9   r   Zdigests   &&    r   r  ZJWK.thumbprint  s     DHHUO$*1U84::<ID|||((4. = Wo.?@eKN11&9:; 122r   c                s     \         V,          pTf   \        RP                  T4      4      hT P	                  T4      pRP                  Y4      #   \         d!   p\        RP                  T4      4      ThRp?ii ; i)a,  Returns the key thumbprint URI as specified by RFC 9278.

:param hname: A hash function name as specified in IANA's
 Named Information registry:
 https://www.iana.org/assignments/named-information/
 Values from `IANANamedInformationHashAlgorithmRegistry`

:return: A JWK Thumbprint URI
:rtype: `str`
zUnknown hash "{}"NzUnsupported hash "{}"z*urn:ietf:params:oauth:jwk-thumbprint:{}:{}))IANANamedInformationHashAlgorithmRegistryr   r~   r  r  )ra   ZhnameZhrB   r  r   r   thumbprint_uriZJWK.thumbprint_uri/  s|    	L9%@A 9!"9"@"@"GHHOOA;BB5LL  	L!"5"<"<U"CD!K	Ls   A A:A55A:c                s  < V P                  R 4      pVR 8X  dA   Vf,   V\        9  d   \        V4      h\        \        V `  W4       R# W28w  d   \        R4      hV\        \        V,          P                  4       4      9   d   RV n
        RV n        \        V,          V,          P                  \        P                  8X  d)    \        V4      pVR8X  d   VR8w  d   VR8w  d   \        hMC\        V,          V,          P                  \        P$                  8X  d    V P'                  V4       \        \        V `  W4       R# V\        \(        P                  4       4      9   d   \        \        V `  W4       R# \        \        P                  4       4       FN  pWc8X  d   K  V\        \        V,          P                  4       4      9   g   K6  \+        RP-                  W4      4      h	  \        \        V `  W4       R#   \          d   p\#        RT,          4      ThRp?ii ; i  \          d   p\#        RT,          4      ThRp?ii ; i)	rI   NzCannot change key typer   r6   rH   r   r   z Cannot set '{}' on '{}' key type)r   rd   r]   r^   r   r   r   rc   r   re   r   r   r   r8   r:   r   r   r~   r;   r   r   r   r  )ra   itemr`   rI   r|   rB   r9   rb   s   &&&    r   r   ZJWK.__setitem__F  s   hhuo5={ 00(//c4,T9 !9:: 4)#.33566 $D $D %d+00HLL@
(/A CxC5LTS[((
 #3'-22hmmC$$U+
 #t(5 4)..011#t(5
 )..01D{t-d388:;;AHH# * + +	 2 	c4$T1= ! )7$> ! );dBs0   &G= H# =H HH #I.IIc                l    \        V/ VB P                  4        F  w  r4V P                  W44       K  	  R# z>
:param \*args: arguments
:param \**kwargs: keyword arguments
Ndictr   r   ra   r   r   rH   r|      &*,  r   r   Z
JWK.update  1    
 $)&)//1DAQ" 2r   c                n    WP                  4       9  d   V P                  W4       V P                  V4      # r   re   r   r   ra   r   Zdefaultr   r   
setdefaultZJWK.setdefault  *    iik!S*xx}r   c                s  < V P                  V4      pVf   \        V4      hVR8X  dJ   \        \        V,          P	                  4       4       F!  pV P                  V4      f   K  \        R4      h	  V P                  R4      pVe8   V\        \        V,          P	                  4       4      9   d   R V n        R V n        \        \        V `'  V4       R # )NrI   z#Cannot remove 'kty', values present)
r   r   rc   r   re   r   r   r^   r   __delitem__)ra   r  Zparamr9   rI   rb   s   &&   r   r)  ZJWK.__delitem__  s    =4. 5=.u5::<=88D>-"#HII > hhuo?tt,=c,B,G,G,I'JJ $D $Dc4$T*r   c                s    \        V\        4      '       g   \        # V P                  4       VP                  4       8H  ;'       d$    V P	                  R 4      VP	                  R 4      8H  # rM   )r   r   ZNotImplementedr  r   )ra   Zotherr   r   __eq__Z
JWK.__eq__  sU    %%%!! E$4$4$66 0 0HHUOuyy//	0r   c                sV    \        V P                  4       V P                  R 4      34      # r*  )Zhashr  r   rf   r   r   __hash__ZJWK.__hash__  s!    T__&899r   c                s    V\         P                  4       9   d&   WP                  4       9   d   V P                  V4      # V P                  R 4      pVeO   V\        \        V,          P                  4       4      9   d&   WP                  4       9   d   V P                  V4      # \
        h  \
         d    \        T4      Rhi ; i)rI   N)r   re   r   rc   r   r   r   )ra   r  rI   r   r   __getattr__ZJWK.__getattr__  s    	1(--//99;&88D>)((5/C4 1# 6 ; ; =>>yy{*#xx~-N 	1 &D0	1s   =B)  A"B) #B) )Cc                sz  <  V\         P                  4       9   d   V P                  W4       \        \        P                  4       4       F?  pV\        \
        V,          P                  4       4      9   g   K.  V P                  W4       KA  	  \        \        V `#  W4       R #   \         d    \        T4      R hi ; ir   )r   re   r   rc   rd   r   r^   r   __setattr__r   r   )ra   r  r`   r9   rb   s   &&& r   r.  ZJWK.__setattr__  s    	1(--//  --22454 1$ 7 < < >??$$T1 6 #t(5 	1 &D0	1s   B" AB" 8(B" "B:c                s    V ! 4       pRR/p \        VP                  R4      4      VR&   TP                  ! R/ TB  T#   \         d   p\        ThRp?ii ; i)zCreates a symmetric JWK key from a user password.

:param password: A password in utf8 format.

:return: a JWK object
:rtype: JWK
rI   r6   r  rH   Nr!   )r   r  r   r~   r   )r   r	  r   r   rB   r   r   from_passwordZJWK.from_password  s`     e	)*8??6+BCF3K 	  
  	)!q(	)s   > A	AAc                sl    / pV P                  R R4      VR &   V P                  4       VR&   \        V4      # )rM   zMissing Key IDr  )r   r  r   )ra   	repr_dictr   r   __repr__ZJWK.__repr__  s9    	88E+;<	%"&//"3	,9%%r   )r   r   r   TF)F)NN)FF)r\   )Nr"   r#   r$   r%   ri   r_   r&   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Zpropertyr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r  r   SHA256r  r  r   r   r'  r)  r+  r,  r-  r.  r/  r1  r'   r(   rj   rk   rl   r   r   r     s;    '&R 	 	"
@1""&FP
0
"	"1A""Un   +( "94
     ( (          , ,	:5*
M=H&&(&TA %B$ML  
   "( 3"M.72r#
+$0:1	1  $& &r   r   c                   s&   a  ] tR tRt o R tRtV tR# )_JWKkeysi  c                sr    \        V\        4      '       g   \        R4      h\        P	                  W4       R# )zrAdds 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   r   r  setaddra   Zelemr   r   r6  Z_JWKkeys.add  s)     $$$ABBr   r!   N)r"   r#   r$   r%   r6  r'   r(   r)   r+   r   r4  r4    s     	 	r   r4  c                   s   a a ] tR tRt oRtV 3R ltR tR tV 3R ltR t	RR lt
R	 tRR
 ltR t]R 4       tR tR tR tRtVtV ;t# )JWKSeti  zA set of JWK objects.

Inherits from the standard 'dict' builtin type.
Creates a special key 'keys' that is of a type derived from 'set'
The 'keys' attribute accepts only :class:`jwcrypto.jwk.JWK` elements.
c                s   < \         \        V `  4        \         \        V `  R \	        4       4       V P
                  ! V/ VB  R# re   N)r^   r8  r_   r   r4  r   )ra   r   r   rb   s   &*,r   r_   ZJWKSet.__init__  s4    fd$&fd'
;T$V$r   c                s0    V R ,          P                  4       # re   )__iter__rf   r   r   r;  ZJWKSet.__iter__  s    F|$$&&r   c                s2    V R ,          P                  V4      # r:  )__contains__r  r   r   r<  ZJWKSet.__contains__  s    F|((--r   c                s   < VR 8X  d1   \        V\        4      '       g   V R ,          P                  V4       R# \        \        V `  W4       R# r9  )r   r4  r6  r^   r8  r   )ra   r   r   rb   rn   r   r   ZJWKSet.__setitem__  s7    &=C!:!:LS!&$+C5r   c                r  r  r  r!  r"  r   r   ZJWKSet.update  r#  r   c                r$  r   r%  r&  r   r   r'  ZJWKSet.setdefault	  r(  r   c                s6    V R ,          P                  V4       R# r9  )r6  r7  r   r   r6  Z
JWKSet.add  s    Vr   c           	     s    / pV P                  4        F?  w  rEVR8X  d0   . pV F%  pVP                  VP                  VRR7      4       K'  	  TpWSV&   KA  	  VRJ d   V# \        V4      # )a  Exports a RFC 7517 key set.
   Exports as json by default, or as dict if requested.

:param private_key(bool): Whether to export private keys.
                          Defaults to True.
:param as_dict(bool): Whether to return a dict instead of
                      a JSON object

:return: A portable representation of the key set.
    If as_dict is True then a dictionary is returned.
    By default a json string
:rtype: `str` or `dict`
re   T)r   )r   r{   r   r   )ra   Zprivate_keysr   Zexp_dictrH   r|   re   jwks   &&&     r   r   ZJWKSet.export  so     JJLDAF{CKK

<
 FG QK ! d?O8$$r   c           	     s    \        V4      pRT9  d   \        hTP                  4        F<  w  rETR8X  d-   T F$  pT R,          P	                  \        R/ TB 4       K&  	  K8  YPT&   K>  	  R#   \         d   p\        ThRp?ii ; i)zzImports a RFC 7517 key set using the standard JSON format.

:param keyset: The RFC 7517 representation of a JOSE key set.
Nre   r!   )r   r   r~   r   r6  r   )ra   keysetZjwksetrB   rH   r|   r=  s   &&     r   import_keysetZJWKSet.import_keyset+  s    
	) (F !!LLNDAF{CL$$SZ3Z0  Q #  	)!q(	)s   A, ,B7A>>Bc                r  )zCreates a RFC 7517 key set from the standard JSON format.

:param keyset: The RFC 7517 representation of a JOSE key set.

:return: A JWKSet object.
:rtype: JWKSet
)r?  )r   r>  r   r   r   r   ZJWKSet.from_json?  s     e&!
r   c                s    V P                  V4      p\        V4      ^8  d   \        R4      h \        V4      ^ ,          #   \         d     R# i ; i)zhGets a key from the set.
:param kid: the 'kid' key identifier.

:return: A JWK from the set
:rtype: JWK
z3Duplicate keys found with requested kid: 1 expectedN)get_keysr   r~   ZtupleZ
IndexError)ra   rM   re   r   r   get_keyZJWKSet.get_keyL  sT     }}S!t9q=!EG G	;q>! 		s   A   AAc                sl    V R,           Uu0 uF  q"P                  R4      V8X  g   K  VkK  	  up# u upi )zxGets keys from the set with matching kid.
:param kid: the 'kid' key identifier.

:return: a List of keys
:rtype: `list`
re   rM   r   )ra   rM   r   r   r   r@  ZJWKSet.get_keys\  s/      $F|E|wwu~/D|EEEs   11c                s    / pV P                  4        F7  w  r#VR 8X  d(   . pV F  pVP                  \        V4      4       K  	  TpW1V&   K9  	  \        V4      # r:  )r   r{   Zreprr   )ra   r0  rH   r|   re   r=  r   r   r1  ZJWKSet.__repr__e  sX    	JJLDAF{CKKS	* aL ! 9%%r   r!   r   r2  )r"   r#   r$   r%   ri   r_   r;  r<  r   r   r'  r6  r   r?  r&   r   rA  r@  r1  r'   r(   rj   rk   rl   r   r8  r8    s`     %
'.6#
%4( 
 
 F	& 	&r   r8  )Pr   Zbinasciir   r   Zcollectionsr   Zenumr   Zcryptographyr   Zcryptography.hazmat.backendsr   Zcryptography.hazmat.primitivesr   r   Z)cryptography.hazmat.primitives.asymmetricr	   r
   r   Zjwcrypto.commonr   r   r   r   r   r   ZImplementedOkpCurvesZ1cryptography.hazmat.primitives.asymmetric.ed25519r,   r-   r{   ZImportErrorZ/cryptography.hazmat.primitives.asymmetric.ed448r.   r/   Z0cryptography.hazmat.primitives.asymmetric.x25519r0   r1   r   Z
priv_bytesZ.cryptography.hazmat.primitives.asymmetric.x448r2   r3   Z_Ed25519_CURVEZ_Ed448_CURVEZ_X25519_CURVEZ_X448_CURVEr   rd   r8   ZJWKParameterr9   r:   r;   r<   r   r   ZJWKEllipticCurveRegistryrr   rz   r   r3  ZSHA384ZSHA512ZSHA3_224ZSHA3_256ZSHA3_384ZSHA3_512ZBLAKE2sZBLAKE2br  r]   rm   rv   r~   r   r   r5  r4  r8  r!   r   r   <module>rB     s   
 ' "   8 @ 8 9 ! ' > 4" "  
1 	*/ (
0 )+?FJ). ' I'78'#348%56!12~.0AB\./:mO-=>
K~6	  *5++-  "*t * +'IJ|GT4?\.$hllC\.$hllC\+UE8<<H	 
\)T4>\*dD(--@\,eUHMMJ\.uhmmL\/x}}Ml6 %8l7 %8l2 %8|/!5(*>*>@ 
\+udHLLA 
|GT4?\,dHLLA\-x||D3 > # 
<
D$5	<($d;|,dD$?	<T46	<$d3	<T46	<14tD	<<dD*C!4/  ' $]#]#]')?%'N#%J$&A"$=?  * 3'   !C!#D"$5" %A"M$ 'A$l%'L	N  %- v}}44$$$v}}v}}!!!!6>>"%46>>"%- )&7[ 7Jk J2N+ N6k z&$ z&zs E&T E&y%  1/01  /-N.O/  0.O/0  .,M-N.sH   "Q <Q )Q+  Q= QQQ('Q(+Q:9Q:=RR