Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/itsdangerous/__pycache__/signer.cpython-37.pyc

67 lines
5.6 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
<00>/<2F>]<5D><00>@s<>ddlZddlZddlmZddlmZddlmZddlmZddlmZddl m
Z
Gd d
<EFBFBD>d
e <0B>Z Gd d <0C>d e <0C>Z Gd d<0E>de <0C>ZGdd<10>de <0B>ZdS)<11>N<>)<01>constant_time_compare)<01>_base64_alphabet)<01> base64_decode)<01> base64_encode)<01>
want_bytes)<01> BadSignaturec@s eZdZdZdd<03>Zdd<05>ZdS)<07>SigningAlgorithmzgSubclasses must implement :meth:`get_signature` to provide
signature generation functionality.
cCs
t<00><00>dS)z2Returns the signature for the given key and value.N)<01>NotImplementedError)<03>self<6C>key<65>value<75>r<00>=/tmp/pip-install-c3kgu56x/itsdangerous/itsdangerous/signer.py<70> get_signatureszSigningAlgorithm.get_signaturecCst||<00>||<02><02>S)zMVerifies the given signature matches the expected
signature.
)rr)r r r <00>sigrrr<00>verify_signaturesz!SigningAlgorithm.verify_signatureN)<06>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rrrrrrr sr c@seZdZdZdd<03>ZdS)<05> NoneAlgorithmz`Provides an algorithm that does not perform any signing and
returns an empty signature.
cCsdS)N<>r)r r r rrrr!szNoneAlgorithm.get_signatureN)rrrrrrrrrrsrc@s,eZdZdZeej<06>Zddd<04>Zdd<06>Z dS)<08> HMACAlgorithmz*Provides signature generation using HMACs.NcCs|dkr|j}||_dS)N)<02>default_digest_method<6F> digest_method)r rrrr<00>__init__-szHMACAlgorithm.__init__cCstj|||jd<01>}|<03><03>S)N)<02>msg<73> digestmod)<04>hmac<61>newr<00>digest)r r r <00>macrrrr2szHMACAlgorithm.get_signature)N)
rrrr<00> staticmethod<6F>hashlib<69>sha1rrrrrrrr%s

rc@sXeZdZdZeej<06>ZdZddd<06>Z dd<08>Z
d d
<EFBFBD>Z d d <0C>Z d d<0E>Z dd<10>Zdd<12>ZdS)<14>Signera<72>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.
z django-concatN<74>.cCs|t|<01>|_t|<03>|_|jtkr&td<01><01>|dkr2dn||_|dkrF|j}||_|dkrZ|j}||_ |dkrrt
|j <09>}||_ dS)Nz<4E>The given separator cannot be used because it may be contained in the signature itself. Alphanumeric characters and `-_=` must not be used.zitsdangerous.Signer) r<00>
secret_key<EFBFBD>sepr<00>
ValueError<EFBFBD>salt<6C>default_key_derivation<6F>key_derivationrrr<00> algorithm)r r(r+r)r-rr.rrrr[s



zSigner.__init__cCs<>t|j<01>}|jdkr(|<00>||j<00><01><05>S|jdkrJ|<00>|d|j<00><01><05>S|jdkrxtj|j|jd<05>}|<02>|<01>|<02><05>S|jdkr<>|jSt d<07><01>dS) 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.
<20>concatz django-concatssignerr)r<00>nonezUnknown key derivation methodN)
rr+r-rr(r!rr <00>update<74> TypeError)r r+r"rrr<00>
derive_keyws





zSigner.derive_keycCs&t|<01>}|<00><01>}|j<02>||<01>}t|<03>S)z*Returns the signature for the given value.)rr3r.rr)r r r rrrrr<00>szSigner.get_signaturecCst|<01>t|j<01>|<00>|<01>S)zSigns the given string.)rr)r)r r rrr<00>sign<67>sz Signer.signcCs:|<00><00>}y t|<02>}Wntk
r(dSX|j<03>|||<02>S)z+Verifies the signature for the given value.F)r3r<00> Exceptionr.r)r r rr rrrr<00>s  zSigner.verify_signaturecCs\t|<01>}t|j<01>}||kr(td|j<00><01>|<01>|d<02>\}}|<00>||<04>rH|Std||d<04><02>dS)zUnsigns the given string.zNo %r found in valuerzSignature %r does not match)<01>payloadN)rr)r<00>rsplitr)r <00> signed_valuer)r rrrr<00>unsign<67>s
 z Signer.unsigncCs(y|<00>|<01>dStk
r"dSXdS)znOnly validates the given signed value. Returns ``True`` if
the signature exists and is valid.
TFN)r9r)r r8rrr<00>validate<74>s

zSigner.validate)Nr'NNN)rrrrr#r$r%rr,rr3rr4rr9r:rrrrr&7s

  r&)r$r<00>_compatr<00>encodingrrrr<00>excr<00>objectr rrr&rrrr<00><module>s