+
    Gb  c                   s.   ^ RI t ^ RIt^ RIHtHt ^ RIHt ^ RIHt R t	R t
R tR t ! R	 R
]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t]! RR4      t ! R R]4      tR# )i    N)urlsafe_b64decodeurlsafe_b64encode)
namedtuple)MutableMappingc                 s    \        V \        4      '       g   V P                  R 4      p \        V 4      pVP	                  R 4      P                  R4      # )utf-8=)
isinstancebytesencoder   decodeZrstrip)payloadr      & 4/usr/lib/python3.14/site-packages/jwcrypto/common.pybase64url_encoder      sA    gu%%..)w'F==!((--    c                 s    \        V 4      ^,          pV^8X  d   V R,          p M#V^8X  d   V R,          p MV^ 8w  d   \        R4      h\        V P                  R4      4      # )i   z==r   zInvalid base64 stringr   )ZlenZ
ValueErrorr    r   )r
   Zsizer   r   base64url_decoder      sW    w<!Dqy4	3	011W^^G455r   c                 s    \        V \        4      '       d   V P                  R 4      p \        P                  ! V RRR7      # )r   T)Z
separatorsZ	sort_keys)Z,Z:)r   r   r	   jsonZdumpsZstring   &r   json_encoder   !   s0    &%  w'::ftDDr   c                 s|    \        V \        4      '       d   V P                  R 4      p \        P                  ! V 4      # )r   )r   r   r	   r   Zloadsr   r   r   json_decoder   '   s,    &%  w'::fr   c                   s    ] tR t^-tRtR# )JWException N)__name__
__module____qualname____firstlineno____static_attributes__r   r   r   r   r   -   s    r   r   c                   s6   a a ] tR t^1t oRV 3R lltRtVtV ;t# )InvalidJWAAlgorithmc                sb   < R pV'       d   VRV,          ,          p\         \        V `  V4       R# )zInvalid JWA Algorithm namez (%s)N)superr   __init__selfmessagemsg	__class__   && r   r   ZInvalidJWAAlgorithm.__init__2   s*    *7W$$C!41#6r   r   N)r   r   r   r   r   r   __classdictcell____classcell__r#   __classdict__   @@r   r   r   1   s     7 7r   r   c                   s6   a a ] tR t^9t oRtV 3R ltRtVtV ;t# )InvalidCEKeyLengthztInvalid CEK Key Length.

This exception is raised when a Content Encryption Key does not match
the required length.
c                B   < R W3,          p\         \        V `  V4       R# )z&Expected key of length %d bits, got %dN)r   r+   r   r    ZexpectedZobtainedr"   r#      &&& r   r   ZInvalidCEKeyLength.__init__@   s     6(9MM $05r   r   	r   r   r   r   Z__doc__r   r   r&   r'   r(   r*   r   r+   r+   9   s     6 6r   r+   c                   s:   a a ] tR t^Et oRtRV 3R lltRtVtV ;t# )InvalidJWEOperationzzInvalid JWS Object.

This exception is raised when a requested operation cannot
be execute due to unsatisfied conditions.
c                   < R pV'       d   TpMRpV'       d   VR\        V4      ,          ,          p\        \        V `  V4       R # NzUnknown Operation Failurez {%s})reprr   r0   r   r    r!   Z	exceptionr"   r#   r.   r   r   ZInvalidJWEOperation.__init__L   s;    C-C7T)_,,C!41#6r   r   NNr/   r(   r*   r   r0   r0   E   s     7 7r   r0   c                   s6   a a ] tR t^Wt oRtV 3R ltRtVtV ;t# )InvalidJWEKeyTypezInvalid JWE Key Type.

This exception is raised when the provided JWK Key does not match
the type required by the specified algorithm.
c                sB   < R V: RV: 2p\         \        V `  V4       R# )zExpected key type z, got N)r   r6   r   r-   r.   r   r   ZInvalidJWEKeyType.__init__^   s    08(C/4r   r   r/   r(   r*   r   r6   r6   W   s     5 5r   r6   c                   s6   a a ] tR t^ct oRtV 3R ltRtVtV ;t# )InvalidJWEKeyLengthzInvalid JWE Key Length.

This exception is raised when the provided JWK Key does not match
the length required by the specified algorithm.
c                r,   )z!Expected key of length %d, got %dN)r   r7   r   r-   r.   r   r   ZInvalidJWEKeyLength.__init__j   s     1X4HH!41#6r   r   r/   r(   r*   r   r7   r7   c   s     7 7r   r7   c                   s:   a a ] tR t^ot oRtRV 3R lltRtVtV ;t# )InvalidJWSERegOperationzInvalid JWSE Header Registry Operation.

This exception is raised when there is an error in trying to add a JW
Signature or Encryption header to the Registry.
c                r1   r2   )r3   r   r8   r   r4   r.   r   r   Z InvalidJWSERegOperation.__init__v   s;    C-C7T)_,,C%t5c:r   r   r5   r/   r(   r*   r   r8   r8   o   s     ; ;r   r8   c                   s:   a a ] tR t^t oRtRV 3R lltRtVtV ;t# )JWKeyNotFoundzThe key needed to complete the operation was not found.

This exception is raised when a JWKSet is used to perform
some operation and the key required to successfully complete
the operation is not found.
c                sH   < V'       d   TpMR p\         \        V `  V4       R# )zKey Not FoundN)r   r9   r   r   r$   r   r   ZJWKeyNotFound.__init__   s    C!CmT+C0r   r   r%   r/   r(   r*   r   r9   r9      s     1 1r   r9   Z	Parameterz*description mustprotect supported check_fnc                   sN   a  ] tR t^t o R
R ltR tR tR tR tR t	R t
R	tV tR# )JWSEHeaderRegistryNc                s    V'       d>   \        V\        4      '       d   \        P                  ! V4      V n        M\        R 4      h/ V n        \        P                  ! V 4       R# )zUnknown input typeN)r   ZdictcopyZdeepcopy	_registryr8   r   r   )r    Zinit_registry   &&r   r   ZJWSEHeaderRegistry.__init__   sC    -..!%}!=-.BCCDN%r   c                s    WP                   9  d   \        R V,          4      hV P                   V,          pVP                  f   R# VP                  V4      # )z No header "%s" found in registryT)r<   r8   Zcheck_fn)r    hZvalueZparam   &&& r   check_headerZJWSEHeaderRegistry.check_header   sP    NN")*L,-+. / / q!>>!>>%((r   c                s8    V P                   P                  V4      # r%   )r<   __getitem__r    Zkeyr=   r   rA   ZJWSEHeaderRegistry.__getitem__   s    ~~))#..r   c                6    V P                   P                  4       # r%   )r<   __iter__r    r   r   rD   ZJWSEHeaderRegistry.__iter__   s    ~~&&((r   c                s    V P                   V,          P                  '       g$   V P                   V,          P                  '       d   \        R 4      hV P                   P	                  V4       R# )z-Unable to delete protected or supported fieldN)r<   mustprotect	supportedr8   __delitem__rB   r=   r   rH   ZJWSEHeaderRegistry.__delitem__   sR    >>#***>>#((() +< = = NN&&s+r   c                s   WP                   9   dm   V P                   V,          pVP                  '       d   \        R 4      hVP                  '       d   VP                  '       g   \        R4      hV P                   V W P                   V&   R# )z+Supported header already exists in registryz,Header specified should bea protected headerN)r<   rG   r8   rF   )r    r>   Zjwse_header_paramZpr?   r   __setitem__ZJWSEHeaderRegistry.__setitem__   sy    q!A{{{- /= > >'8'D'D'D- /C D D NN1%-qr   c                rC   r%   )r<   __len__rE   r   r   rJ   ZJWSEHeaderRegistry.__len__   s    ~~%%''r   )r<   r%   )r   r   r   r   r   r@   rA   rD   rH   rI   rJ   r   r&   )r)   s   @r   r:   r:      s-     	&	)/),.( (r   r:   )r;   r   Zbase64r    r   Zcollectionsr   Zcollections.abcr   r   r   r   r   Z	Exceptionr   r   r+   r0   r6   r7   r8   r9   ZJWSEHeaderParameterr:   r   r   r   <module>rK      s      7 " *.6E	) 	7+ 7	6 	67+ 7$	5 	5	7+ 	7;k ;$1K 1( !!MO 5( 5(r   