§
    ¥”j•  ã                   ód   — d dl mZ d dlZd dlmZ ddlmZ ddlmZm	Z	 dgZ
 G d„ de¦  «        ZdS )	é    ©Ú	to_threadN)Útspé   )ÚTimeStamper)ÚTimestampRequestErrorÚset_tsp_headersÚHTTPTimeStamperc                   óT   ‡ — e Zd ZdZd
ˆ fd„	Zdefd„Zdej        dej	        fd	„Z
ˆ xZS )r
   z/
    Standard HTTP-based timestamp client.
    Fé   Nc                 óÌ   •— |r$|                      d¦  «        st          d¦  «        ‚|| _        || _        || _        || _        t          ¦   «                              ¦   «          dS )ax  
        Initialise the timestamp client.

        :param url:
            URL where the server listens for timestamp requests.
        :param https:
            Enforce HTTPS.
        :param timeout:
            Timeout (in seconds)
        :param auth:
            Value of HTTP ``Authorization`` header
        :param headers:
            Other headers to include.
        zhttps:zTimestamp URL is not HTTPS.N)Ú
startswithÚ
ValueErrorÚurlÚtimeoutÚauthÚheadersÚsuperÚ__init__)Úselfr   Úhttpsr   r   r   Ú	__class__s         €úv/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/pyhanko/sign/timestamps/requests_client.pyr   zHTTPTimeStamper.__init__   sg   ø€ ð ð 	<˜Ÿš¨Ñ1Ô1ð 	<ÝÐ:Ñ;Ô;Ð;ØˆŒØˆŒØˆŒ	ØˆŒÝ‰Œ×ÒÑÔÐÐÐó    Úreturnc                 ó.   — t          | j        pi ¦  «        S )zc
        Format the HTTP request headers.

        :return:
            Header dictionary.
        )r	   r   )r   s    r   Úrequest_headerszHTTPTimeStamper.request_headers(   s   € õ ˜tœ|Ð1¨rÑ2Ô2Ð2r   Úreqc              ƒ   óD   ‡ ‡K  — ˆˆ fd„}t          |¦  «        ƒ d {V —†}|S )Nc                  óˆ  •— 	 t          j        ‰j        ‰                     ¦   «         ‰                     ¦   «         ‰j        ‰j        ¬¦  «        } n"# t          $ r}t          d¦  «        |‚d }~ww xY w| j	         
                    d¦  «        dk    rt          d| ¦  «        ‚t          j                             | j        ¦  «        S )N)r   r   r   z,Error in communication with timestamp serverzContent-Typezapplication/timestamp-replyz'Timestamp server response is malformed.)ÚrequestsÚpostr   Údumpr   r   r   ÚIOErrorr   r   Úgetr   ÚTimeStampRespÚloadÚcontent)Úraw_resÚer   r   s     €€r   Útaskz8HTTPTimeStamper.async_request_tsa_response.<locals>.task4   sØ   ø€ ðÝ"œ-Ø”HØ—H’H‘J”JØ ×0Ò0Ñ2Ô2ØœØ œLðñ ô ��øõ ð ð ð Ý+ØBñô àðøøøøðøøøð ”×#Ò# NÑ3Ô3Ø0ò1ð 1õ ,Ø=¸wñô ð õ Ô$×)Ò)¨'¬/Ñ:Ô:Ð:s   ƒAA Á
A/ÁA*Á*A/r   )r   r   r+   Úresponses   ``  r   Úasync_request_tsa_responsez*HTTPTimeStamper.async_request_tsa_response1   sJ   øøè è € ð	;ð 	;ð 	;ð 	;ð 	;ð 	;õ. # 4™œÐ(Ð(Ð(Ð(Ð(Ð(ˆØˆr   )Fr   NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Údictr   r   ÚTimeStampReqr&   r-   Ú__classcell__)r   s   @r   r
   r
      sŒ   ø€ € € € € ðð ðð ð ð ð ð ð.3 ð 3ð 3ð 3ð 3ðØÔ#ðà	Ô	ðð ð ð ð ð ð ð r   )Úasyncior   r!   Ú
asn1cryptor   Úapir   Úcommon_utilsr   r	   Ú__all__r
   © r   r   ú<module>r;      s¢   ðØ Ð Ð Ð Ð Ð à €€€Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø @Ð @Ð @Ð @Ð @Ð @Ð @Ð @àÐ
€ð@ð @ð @ð @ð @�kñ @ô @ð @ð @ð @r   