<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
lá˜_ô  ã               @   s€   d dl mZmZmZ d dlmZmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ d dlmZ d dlmZ G d	d
„ d
eƒZdS )é    )Úabsolute_importÚdivisionÚprint_function)ÚUnsupportedAlgorithmÚ_Reasons)Ú_get_backend)ÚHMACBackend)Úconstant_time)ÚInvalidToken)ÚHOTP)Ú_generate_uric               @   s.   e Zd Zddd„Zdd„ Zdd„ Zd	d
„ ZdS )ÚTOTPNTc             C   s:   t |ƒ}t|tƒstdtjƒ‚|| _t|||||ƒ| _d S )Nz.Backend object does not implement HMACBackend.)	r   Ú
isinstancer   r   r   ZBACKEND_MISSING_INTERFACEÚ
_time_stepr   Ú_hotp)ÚselfÚkeyZlengthÚ	algorithmZ	time_stepZbackendZenforce_key_length© r   ú/usr/lib64/python3.6/totp.pyÚ__init__   s    	
zTOTP.__init__c             C   s   t || j ƒ}| jj|ƒS )N)Úintr   r   Úgenerate)r   ÚtimeZcounterr   r   r   r   $   s    zTOTP.generatec             C   s   t j| j|ƒ|ƒstdƒ‚d S )Nz#Supplied TOTP value does not match.)r	   Zbytes_eqr   r
   )r   Útotpr   r   r   r   Úverify(   s    zTOTP.verifyc             C   s   t | jd||dt| jƒfgƒS )Nr   Zperiod)r   r   r   r   )r   Zaccount_nameZissuerr   r   r   Úget_provisioning_uri,   s    zTOTP.get_provisioning_uri)NT)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r   r      s
    
r   N)Z
__future__r   r   r   Zcryptography.exceptionsr   r   Zcryptography.hazmat.backendsr   Z'cryptography.hazmat.backends.interfacesr   Zcryptography.hazmat.primitivesr	   Z(cryptography.hazmat.primitives.twofactorr
   Z-cryptography.hazmat.primitives.twofactor.hotpr   Z.cryptography.hazmat.primitives.twofactor.utilsr   Úobjectr   r   r   r   r   Ú<module>   s   