+
    Nj%                        ^ RI Ht ^ RIHt ^ RIt^ RIt^ RIt^RI	H
t
 ^RI	Ht ^RI	Ht ^RI	Ht ^RIHt  ! R R	4      t ! R
 R]4      tRR R llt ! R R]4      tR R lt ! R R4      tR# )    )annotationsN)_base64_alphabet)base64_decode)base64_encode)
want_bytes)BadSignaturec                  2    ] tR t^tRtR R ltR R ltRtR# )SigningAlgorithmz_Subclasses must implement :meth:`get_signature` to provide
signature generation functionality.
c               $    V ^8  d   QhRRRRRR/#    keybytesvaluereturn )formats   "U/data/cameron/venvs/serve_omidlab/lib/python3.14/site-packages/itsdangerous/signer.py__annotate__SigningAlgorithm.__annotate__   s!     $ $ $u $ $    c                    \        4       h)z2Returns the signature for the given key and value.)NotImplementedErrorselfr   r   s   &&&r   get_signatureSigningAlgorithm.get_signature   s    !##r   c               (    V ^8  d   QhRRRRRRRR/# )r   r   r   r   sigr   boolr   )r   s   "r   r   r      s.     H HE H% He H Hr   c                L    \         P                  ! W0P                  W4      4      # )z=Verifies the given signature matches the expected
signature.
)hmaccompare_digestr   )r   r   r   r   s   &&&&r   verify_signature!SigningAlgorithm.verify_signature   s      ""3(:(:3(FGGr   r   N)__name__
__module____qualname____firstlineno____doc__r   r$   __static_attributes__r   r   r   r
   r
      s    $H Hr   r
   c                  &    ] tR t^tRtR R ltRtR# )NoneAlgorithmzXProvides an algorithm that does not perform any signing and
returns an empty signature.
c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   NoneAlgorithm.__annotate__$   s!       u  r   c                	    R # r   r   r   s   &&&r   r   NoneAlgorithm.get_signature$   s    r   r   N)r&   r'   r(   r)   r*   r   r+   r   r   r   r-   r-      s     r   r-   c                    V ^8  d   QhRRRR/# )r   stringr   r   t.Anyr   )r   s   "r   r   r   (   s        u  u  r   c                .    \         P                  ! V 4      # )zDon't access ``hashlib.sha1`` until runtime. FIPS builds may not include
SHA-1, in which case the import and use as a default would fail before the
developer can configure something else.
)hashlibsha1)r4   s   &r   
_lazy_sha1r9   (   s    
 <<r   c                  R    ] tR t^0t$ Rt]! ]4      tR]R&   R
R R llt	R R lt
R	tR# )HMACAlgorithmz*Provides signature generation using HMACs.r5   default_digest_methodNc                   V ^8  d   QhRR/# )r   digest_methodr5   r   )r   s   "r   r   HMACAlgorithm.__annotate__8   s     2 2e 2r   c                	2    Vf   V P                   pWn        R # N)r<   r>   )r   r>   s   &&r   __init__HMACAlgorithm.__init__8   s      66M$1r   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r?   >   s!       u  r   c                	f    \         P                  ! WV P                  R 7      pVP                  4       # ))msg	digestmod)r"   newr>   digest)r   r   r   macs   &&& r   r   HMACAlgorithm.get_signature>   s$    hhs1C1CDzz|r   )r>   rA   )r&   r'   r(   r)   r*   staticmethodr9   r<   __annotations__rB   r   r+   r   r   r   r;   r;   0   s&    4
 $0
#;5;2 r   r;   c                    V ^8  d   QhRRRR/# )r   
secret_key7str | bytes | cabc.Iterable[str] | cabc.Iterable[bytes]r   zlist[bytes]r   )r   s   "r   r   r   C   s     / /G//r   c                    \        V \        \        34      '       d   \        V 4      .# V  Uu. uF  p\        V4      NK  	  up# u upi rA   )
isinstancestrr   r   )rO   ss   & r   _make_keys_listrU   C   s?     *sEl++:&''#-.:aJqM:...s   Ac                      ] tR t^Lt$ Rt]! ]4      tR]R&   Rt	R]R&   RR R	 llt
]R
 R l4       tRR R lltR R ltR R ltR R ltR R ltR R ltRtR# )Signera^  A signer securely signs bytes, then unsigns them to verify that
the value hasn't been changed.

The secret key should be a random string of ``bytes`` and should not
be saved to code or version control. Different salts should be used
to distinguish signing in different contexts. See :doc:`/concepts`
for information about the security of the secret key and salt.

:param secret_key: The secret key to sign and verify with. Can be a
    list of keys, oldest to newest, to support key rotation.
:param salt: Extra key to combine with ``secret_key`` to distinguish
    signatures in different contexts.
:param sep: Separator between the signature and value.
:param key_derivation: How to derive the signing key from the secret
    key and salt. Possible values are ``concat``, ``django-concat``,
    or ``hmac``. Defaults to :attr:`default_key_derivation`, which
    defaults to ``django-concat``.
:param digest_method: Hash function to use when generating the HMAC
    signature. Defaults to :attr:`default_digest_method`, which
    defaults to :func:`hashlib.sha1`. Note that the security of the
    hash alone doesn't apply when used intermediately in HMAC.
:param algorithm: A :class:`SigningAlgorithm` instance to use
    instead of building a default :class:`HMACAlgorithm` with the
    ``digest_method``.

.. versionchanged:: 2.0
    Added support for key rotation by passing a list to
    ``secret_key``.

.. versionchanged:: 0.18
    ``algorithm`` was added as an argument to the class constructor.

.. versionchanged:: 0.14
    ``key_derivation`` and ``digest_method`` were added as arguments
    to the class constructor.
r5   r<   django-concatrS   default_key_derivationNc               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r   rO   rP   saltstr | bytes | Nonesepstr | byteskey_derivationz
str | Noner>   zt.Any | None	algorithmzSigningAlgorithm | Noner   )r   s   "r   r   Signer.__annotate__   sF     ,5 ,5K,5 !,5 	,5
 #,5 $,5 +,5r   c                	L   \        V4      V n        \        V4      V n        V P                  \        9   d   \        R 4      hVe   \        V4      pMRpW n        Vf   V P                  pW@n        Vf   V P                  pWPn
        Vf   \        V P                  4      pW`n        R# )zThe given separator cannot be used because it may be contained in the signature itself. ASCII letters, digits, and '-_=' must not be used.N   itsdangerous.Signer)rU   secret_keysr   r]   r   
ValueErrorr[   rY   r_   r<   r>   r;   r`   )r   rO   r[   r]   r_   r>   r`   s   &&&&&&&r   rB   Signer.__init__   s     )8
(C$S/88''7  d#D)D	!!88N#1  66M$1%d&8&89I+4r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   ra      s     $ $E $r   c                (    V P                   R,          # )zThe newest (last) entry in the :attr:`secret_keys` list. This
is for compatibility from before key rotation support was added.
)rd   )r   s   &r   rO   Signer.secret_key   s    
 ##r   c                    V ^8  d   QhRRRR/# )r   rO   r\   r   r   r   )r   s   "r   r   ra      s     = =%7 =5 =r   c                   Vf   V P                   R,          pM\        V4      pV P                  R8X  dJ   \        P                  ! \
        V P                  V P                  V,           4      P                  4       4      # V P                  R8X  dQ   \        P                  ! \
        V P                  V P                  R,           V,           4      P                  4       4      # V P                  R8X  dM   \        P                  ! WP                  R7      pVP                  V P                  4       VP                  4       # V P                  R8X  d   V# \        R4      h)	a  This method is called to derive the key. The default key
derivation choices can be overridden here. Key derivation is not
intended to be used as a security method to make a complex key
out of a short password. Instead you should use large random
secret keys.

:param secret_key: A specific secret key to derive from.
    Defaults to the last item in :attr:`secret_keys`.

.. versionchanged:: 2.0
    Added the ``secret_key`` parameter.
concatrX   s   signerr"   )rG   nonezUnknown key derivation methodri   )rd   r   r_   tcastr   r>   r[   rI   r"   rH   update	TypeError)r   rO   rJ   s   && r   
derive_keySigner.derive_key   s    ))"-J#J/J(*66%!3!3DII
4J!K!R!R!TUU  O366t))$))i*?**LMTTV    F*((:1C1CDCJJtyy!::<  F*;<<r   c                    V ^8  d   QhRRRR/# r   r   r^   r   r   r   )r   s   "r   r   ra      s     " "; "5 "r   c                    \        V4      pV P                  4       pV P                  P                  W!4      p\	        V4      # )z*Returns the signature for the given value.)r   rs   r`   r   r   )r   r   r   r   s   &&  r   r   Signer.get_signature   s7    5!oonn**36S!!r   c                    V ^8  d   QhRRRR/# rv   r   )r   s   "r   r   ra      s     < <+ <% <r   c                h    \        V4      pWP                  ,           V P                  V4      ,           # )zSigns the given string.)r   r]   r   )r   r   s   &&r   signSigner.sign   s)    5!xx$"4"4U";;;r   c               $    V ^8  d   QhRRRRRR/# )r   r   r^   r   r   r    r   )r   s   "r   r   ra      s!      k   r   c                     \        V4      p\        T4      p\        T P                  4       F9  pT P                  T4      pT P                  P                  YAT4      '       g   K8   R# 	  R#   \         d     R# i ; i)z+Verifies the signature for the given value.FT)r   	Exceptionr   reversedrd   rs   r`   r$   )r   r   r   rO   r   s   &&&  r   r$   Signer.verify_signature   ss    	$C 5!"4#3#34J//*-C~~..s3??	 5   		s   A, ,A;:A;c                    V ^8  d   QhRRRR/# )r   signed_valuer^   r   r   r   )r   s   "r   r   ra      s     O O; O5 Or   c                    \        V4      pV P                  V9  d   \        RV P                  : R24      hVP                  V P                  ^4      w  r#V P	                  W#4      '       d   V# \        RV: R2VR7      h)zUnsigns the given string.zNo z found in valuez
Signature z does not match)payload)r   r]   r   rsplitr$   )r   r   r   r   s   &&  r   unsignSigner.unsign   st    !,/88<'TXXL@AA!((15
  ,,LZwo>NNr   c                    V ^8  d   QhRRRR/# )r   r   r^   r   r    r   )r   s   "r   r   ra     s      [ T r   c                N     V P                  V4       R#   \         d     R# i ; i)z^Only validates the given signed value. Returns ``True`` if
the signature exists and is valid.
TF)r   r   )r   r   s   &&r   validateSigner.validate  s(    	KK% 		s    $$)r`   r>   r_   r[   rd   r]   )rc      .NNNrA   )r&   r'   r(   r)   r*   rL   r9   r<   rM   rY   rB   propertyrO   rs   r   r{   r$   r   r   r+   r   r   r   rW   rW   L   sf    #V $0
#;5; #2C1,5\ $ $=B"<
"O r   rW   r1   )
__future__r   collections.abcabccabcr7   r"   typingro   encodingr   r   r   r   excr   r
   r-   r9   r;   rU   rW   r   r   r   <module>r      s_    "     & # #   H H $  $ &/~ ~r   