PHP WebShell

Текущая директория: /usr/lib/python3/dist-packages/cryptography/hazmat/primitives/twofactor/__pycache__

Просмотр файла: totp.cpython-310.pyc

o

�)%ax�@sxddlZddlmZmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZddlmZGd	d
�d
e�ZdS)�N)�UnsupportedAlgorithm�_Reasons)�_get_backend)�HMACBackend)�
constant_time)�InvalidToken)�HOTP�_ALLOWED_HASH_TYPES)�
_generate_uric@s~eZdZ		ddededededef
dd	�Zd
ej	ee
fdefdd
�Zded
eddfdd�Zde
deje
de
fdd�ZdS)�TOTPNT�key�length�	algorithm�	time_step�enforce_key_lengthcCs:t|�}t|t�stdtj��||_t|||||�|_dS)Nz.Backend object does not implement HMACBackend.)	r�
isinstancerrr�BACKEND_MISSING_INTERFACE�
_time_stepr�_hotp)�selfrr
rr�backendr�r�O/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/twofactor/totp.py�__init__s	
�z
TOTP.__init__�time�returncCst||j�}|j�|�S)N)�intrr�generate)rr�counterrrrr'sz
TOTP.generate�totpcCst�|�|�|�s
td��dS)Nz#Supplied TOTP value does not match.)r�bytes_eqrr)rrrrrr�verify+s�zTOTP.verify�account_name�issuercCst|jd||dt|j�fg�S)Nr�period)r
rrr)rr"r#rrr�get_provisioning_uri/s�zTOTP.get_provisioning_uri)NT)�__name__�
__module__�__qualname__�bytesrr	�boolr�typing�Union�floatrr!�str�Optionalr%rrrrrs.�����
����r)r+�cryptography.exceptionsrr�cryptography.hazmat.backendsr�'cryptography.hazmat.backends.interfacesr�cryptography.hazmat.primitivesr�(cryptography.hazmat.primitives.twofactorr�-cryptography.hazmat.primitives.twofactor.hotprr	�.cryptography.hazmat.primitives.twofactor.utilsr
�objectrrrrr�<module>s

Выполнить команду


Для локальной разработки. Не используйте в интернете!