§
    ¥”jß  ã                   óJ  — d Z ddlZddlmZ ddlmZmZmZ ddlm	Z	m
Z
mZmZ ddlmZ ddlmZ g d¢Zd	ez  Z G d
„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z ed¬¦  «         G d„ d¦  «        ¦   «         Z G d„ dej        ¦  «        ZdS )zF
Asynchronous API for fetching OCSP responses, CRLs and certificates.
é    N)Ú	dataclass)ÚAsyncGeneratorÚIterableÚUnion)ÚcmsÚcrlÚocspÚx509)Ú	Authority)Ú__version__)ÚDEFAULT_USER_AGENTÚ
CRLFetcherÚCertificateFetcherÚFetcherBackendÚFetchersÚOCSPFetcherzpyhanko_certvalidator %sc                   óÀ   — e Zd ZdZdeej        ej        f         de	de
j        fd„Zdee
j                 fd„Zdeej        ej        f         dee
j                 fd„ZdS )	r   z4Utility interface to fetch and cache OCSP responses.ÚcertÚ	authorityÚreturnc              ƒ   ó   K  — t           ‚)ag  
        Fetch an OCSP response for a certificate.

        :param cert:
            The certificate for which an OCSP response has to be fetched.
        :param authority:
            The issuing authority.
        :raises:
            OCSPFetchError - Raised if an OCSP response could not be obtained.
        :return:
            An OCSP response.
        ©ÚNotImplementedError)Úselfr   r   s      úq/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/pyhanko_certvalidator/fetchers/api.pyÚfetchzOCSPFetcher.fetch   s   è è € õ" "Ð!ó    c                 ó   — t           ‚)zD
        Return all responses fetched by this OCSP fetcher.
        r   ©r   s    r   Úfetched_responseszOCSPFetcher.fetched_responses0   ó
   € õ "Ð!r   c                 ó   — t           ‚)zš
        Return all responses fetched by this OCSP fetcher that are relevant
        to determine the revocation status of the given certificate.
        r   ©r   r   s     r   Úfetched_responses_for_certz&OCSPFetcher.fetched_responses_for_cert6   ó
   € õ "Ð!r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r
   ÚCertificater   ÚAttributeCertificateV2r   r	   ÚOCSPResponser   r   r    r$   © r   r   r   r      s¼   € € € € € Ø>Ð>ð"à�DÔ$ cÔ&@Ð@ÔAð"ð ð"ð 
Ô	ð	"ð "ð "ð "ð&" 8¨DÔ,=Ô#>ð "ð "ð "ð "ð"Ø˜$Ô*¨CÔ,FÐFÔGð"à	�$Ô#Ô	$ð"ð "ð "ð "ð "ð "r   r   c                   óÎ   — e Zd ZdZddœdeej        ej        f         de	e
j                 fd„Zde	e
j                 fd„Zdeej        ej        f         de	e
j                 fd„ZdS )	r   z*Utility interface to fetch and cache CRLs.N)Ú
use_deltasr   r   c             ƒ   ó   K  — t           ‚)a‡  
        Fetches the CRLs for a certificate.

        :param cert:
            An asn1crypto.x509.Certificate object to get the CRL for

        :param use_deltas:
            A boolean indicating if delta CRLs should be fetched

        :raises:
            CRLFetchError - when a network/IO error or decoding error occurs

        :return:
            An iterable of CRLs fetched.
        r   )r   r   r/   s      r   r   zCRLFetcher.fetchC   s   è è € õ4 "Ð!r   c                 ó   — t           ‚)z>
        Return all CRLs fetched by this CRL fetcher.
        r   r   s    r   Úfetched_crlszCRLFetcher.fetched_crls_   r!   r   c                 ó   — t           ‚)a  
        Return all relevant fetched CRLs for the given certificate

        :param cert:
            A certificate.
        :return:
            An iterable of CRLs
        :raise KeyError:
            if no fetch operations have been performed for this certificate
        r   r#   s     r   Úfetched_crls_for_certz CRLFetcher.fetched_crls_for_certe   s
   € õ "Ð!r   )r&   r'   r(   r)   r   r
   r*   r   r+   r   r   ÚCertificateListr   r2   r4   r-   r   r   r   r   @   sÆ   € € € € € Ø4Ð4ð ð	"ð "ð "à�DÔ$ cÔ&@Ð@ÔAð"ð
 
�#Ô%Ô	&ð"ð "ð "ð "ð8"˜h sÔ':Ô;ð "ð "ð "ð "ð"Ø˜$Ô*¨CÔ,FÐFÔGð"à	�#Ô%Ô	&ð"ð "ð "ð "ð "ð "r   r   c                   ó¨   — e Zd ZdZdeej        ej        f         de	ej        df         fd„Z
de	ej        df         fd„Zdeej                 fd„ZdS )r   z2Utility interface to fetch and cache certificates.r   r   Nc                 ó   — t           ‚)a†  
        Fetches certificates from the authority information access extension of
        a certificate.

        :param cert:
            A certificate

        :raises:
            CertificateFetchError - when a network I/O or decoding error occurs

        :return:
            An asynchronous generator yielding asn1crypto.x509.Certificate
            objects that were fetched.
        r   r#   s     r   Úfetch_cert_issuersz%CertificateFetcher.fetch_cert_issuersx   ó
   € õ" "Ð!r   c                 ó   — t           ‚)aÁ  
        Fetches certificates from the authority information access extension of
        an asn1crypto.crl.CertificateList.

        :param certificate_list:
            An asn1crypto.crl.CertificateList object

        :raises:
            CertificateFetchError - when a network I/O or decoding error occurs

        :return:
            An asynchronous generator yielding asn1crypto.x509.Certificate
            objects that were fetched.
        r   )r   Úcertificate_lists     r   Úfetch_crl_issuersz$CertificateFetcher.fetch_crl_issuers‹   r9   r   c                 ó   — t           ‚)zP
        Return all certificates retrieved by this certificate fetcher.
        r   r   s    r   Úfetched_certsz CertificateFetcher.fetched_certsž   r!   r   )r&   r'   r(   r)   r   r
   r*   r   r+   r   r8   r<   r   r>   r-   r   r   r   r   u   s§   € € € € € Ø<Ð<ð"Ø˜$Ô*¨CÔ,FÐFÔGð"à	˜Ô(¨$Ð.Ô	/ð"ð "ð "ð "ð&"à	˜Ô(¨$Ð.Ô	/ð"ð "ð "ð "ð&"˜x¨Ô(8Ô9ð "ð "ð "ð "ð "ð "r   r   T)Úfrozenc                   ó2   — e Zd ZU dZeed<   eed<   eed<   dS )r   zã
    Models a collection of fetchers to be used by a validation context.

    The intention is that these can share resources (like a connection pool)
    in a unified, controlled manner. See also :class:`.FetcherBackend`.
    Úocsp_fetcherÚcrl_fetcherÚcert_fetcherN)r&   r'   r(   r)   r   Ú__annotations__r   r   r-   r   r   r   r   ¥   sB   € € € € € € ðð ð ÐÐÑØÐÐÑØ$Ð$Ð$Ñ$Ð$Ð$r   r   c                   ó6   — e Zd ZdZdefd„Zd„ Zdefd„Zd„ ZdS )r   a  
    Generic, bare-bones interface to help abstract away instantiation logic for
    fetcher implementations.

    Intended to operate as an asynchronous context manager, with
    `async with backend_obj as fetchers: ...` putting the resulting
    :class:`.Fetchers` object in to the variable named `fetchers`.

    .. note::
        The initialisation part of the API is necessarily synchronous,
        for backwards compatibility with the old ``ValidationContext`` API.
        If you need asynchronous resource management, handle it elsewhere,
        or use some form of lazy resource provisioning.

        Alternatively, you can pass :class:`Fetchers` objects to the validation
        context yourself, and forgo use of the :class:`.FetcherBackend`
        API altogether.
    r   c                 ó   — t           ‚)zl
        Set up fetchers synchronously.

        .. note::
            This is a synchronous method
        r   r   s    r   Úget_fetcherszFetcherBackend.get_fetchersÇ   r%   r   c              ƒ   ó
   K  — dS )zf
        Clean up the resources associated with this fetcher backend,
        asynchronously.
        Nr-   r   s    r   ÚclosezFetcherBackend.closeÐ   s   è è € ð
 	ˆr   c              ƒ   ó.   K  — |                       ¦   «         S ©N)rG   r   s    r   Ú
__aenter__zFetcherBackend.__aenter__×   s   è è € Ø× Ò Ñ"Ô"Ð"r   c              ƒ   ó:   K  — |                       ¦   «         ƒ d {V —†S rK   )rI   )r   Úexc_typeÚexc_valÚexc_tbs       r   Ú	__aexit__zFetcherBackend.__aexit__Ú   s&   è è € Ø—Z’Z‘\”\Ð!Ð!Ð!Ð!Ð!Ð!Ð!r   N)	r&   r'   r(   r)   r   rG   rI   rL   rQ   r-   r   r   r   r   ³   sr   € € € € € ðð ð&"˜hð "ð "ð "ð "ðð ð ð# (ð #ð #ð #ð #ð"ð "ð "ð "ð "r   r   )r)   ÚabcÚdataclassesr   Útypingr   r   r   Ú
asn1cryptor   r   r	   r
   Úpyhanko_certvalidator.authorityr   Úpyhanko_certvalidator.versionr   Ú__all__r   ÚABCr   r   r   r   r   r-   r   r   ú<module>rZ      s¯  ððð ð €
€
€
Ø !Ð !Ð !Ð !Ð !Ð !Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2à +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +à 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5ðð ð €ð 0°+Ñ=Ð ð#"ð #"ð #"ð #"ð #"�#”'ñ #"ô #"ð #"ðL2"ð 2"ð 2"ð 2"ð 2"�”ñ 2"ô 2"ð 2"ðj-"ð -"ð -"ð -"ð -"˜œñ -"ô -"ð -"ð` €�$ÐÑÔð
%ð 
%ð 
%ð 
%ð 
%ñ 
%ô 
%ñ Ôð
%ð("ð ("ð ("ð ("ð ("�S”Wñ ("ô ("ð ("ð ("ð ("r   