https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/itsdangerous/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/itsdangerous/signer.pyc
�
-/�_c@s�ddlZddlZddlmZddlmZddlmZddlmZddlmZddl	m
Z
d	efd
��YZdefd��YZ
d
efd��YZdefd��YZdS(i����Ni(tconstant_time_compare(t_base64_alphabet(t
base64_decode(t
base64_encode(t
want_bytes(tBadSignaturetSigningAlgorithmcBs eZdZd�Zd�ZRS(sgSubclasses must implement :meth:`get_signature` to provide
    signature generation functionality.
    cCs
t��dS(s2Returns the signature for the given key and value.N(tNotImplementedError(tselftkeytvalue((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyt
get_signaturescCst||j||��S(sMVerifies the given signature matches the expected
        signature.
        (RR(RR	R
tsig((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pytverify_signatures(t__name__t
__module__t__doc__RR
(((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyRs	t
NoneAlgorithmcBseZdZd�ZRS(s`Provides an algorithm that does not perform any signing and
    returns an empty signature.
    cCsdS(Nt((RR	R
((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyR!s(RRRR(((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyRst
HMACAlgorithmcBs2eZdZeej�Zdd�Zd�Z	RS(s*Provides signature generation using HMACs.cCs%|dkr|j}n||_dS(N(tNonetdefault_digest_methodt
digest_method(RR((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyt__init__-scCs(tj|d|d|j�}|j�S(Ntmsgt	digestmod(thmactnewRtdigest(RR	R
tmac((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyR2sN(
RRRtstaticmethodthashlibtsha1RRRR(((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyR%stSignercBsqeZdZeej�ZdZd
dd
d
d
d�Z	d�Z
d�Zd�Zd�Z
d�Zd	�ZRS(s�This class can sign and unsign bytes, validating the signature
    provided.

    Salt can be used to namespace the hash, so that a signed string is
    only valid for a given namespace. Leaving this at the default value
    or re-using a salt value across different parts of your application
    where the same signed value in one part can mean something different
    in another part is a security risk.

    See :ref:`the-salt` for an example of what the salt is doing and how
    you can utilize it.

    .. versionadded:: 0.14
        ``key_derivation`` and ``digest_method`` were added as arguments
        to the class constructor.

    .. versionadded:: 0.18
        ``algorithm`` was added as an argument to the class constructor.
    s
django-concatt.cCs�t|�|_t|�|_|jtkr<td��n|dkrNdn||_|dkro|j}n||_|dkr�|j	}n||_
|dkr�t|j
�}n||_dS(Ns�The given separator cannot be used because it may be contained in the signature itself. Alphanumeric characters and `-_=` must not be used.sitsdangerous.Signer(
Rt
secret_keytsepRt
ValueErrorRtsalttdefault_key_derivationtkey_derivationRRRt	algorithm(RR#R&R$R(RR)((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyR[s			cCs�t|j�}|jdkr8|j||j�j�S|jdkre|j|d|j�j�S|jdkr�tj|jd|j�}|j|�|j�S|jdkr�|jSt	d��dS(	s+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.
        tconcats
django-concattsignerRRtnonesUnknown key derivation methodN(
RR&R(RR#RRRtupdatet	TypeError(RR&R((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyt
derive_keyws

cCs7t|�}|j�}|jj||�}t|�S(s*Returns the signature for the given value.(RR/R)RR(RR
R	R((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyR�scCs$t|�t|j�|j|�S(sSigns the given string.(RR$R(RR
((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pytsign�scCsG|j�}yt|�}Wntk
r0tSX|jj|||�S(s+Verifies the signature for the given value.(R/Rt	ExceptiontFalseR)R
(RR
RR	((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyR
�s
cCs�t|�}t|j�}||kr=td|j��n|j|d�\}}|j||�rk|Std|d|��dS(sUnsigns the given string.sNo %r found in valueisSignature %r does not matchtpayloadN(RR$RtrsplitR
(Rtsigned_valueR$R
R((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pytunsign�scCs.y|j|�tSWntk
r)tSXdS(snOnly validates the given signed value. Returns ``True`` if
        the signature exists and is valid.
        N(R6tTrueRR2(RR5((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pytvalidate�s


N(RRRRRR RR'RRR/RR0R
R6R8(((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyR!7s						(RRt_compatRtencodingRRRRtexcRtobjectRRRR!(((s;/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyt<module>s	

https://t.me/AnonymousX5 - 2025