+
    4ic                       R t ^ RIHt ^ RIt^ RIt^ RIHt ^RIHt	 ^RI
HtHtHtHt ]P                  ! ]4      ;_uu_ 4        ^ RIHt ^ RIHt RRR4       R.tR	 R
 ltR R ltR R ltR R ltR#   + '       g   i     L-; i)zA
`pyOpenSSL <https://github.com/pyca/pyopenssl>`_-specific code.
)annotationsN)Sequence)extract_patterns)DNS_IDCertificatePatternIPAddress_IDverify_service_identity)X509)
Connectionverify_hostnamec               $    V ^8  d   QhRRRRRR/# )   
connectionr
   hostnamestrreturnNone )formats   "</usr/lib/python3/dist-packages/service_identity/pyopenssl.py__annotate__r      s!      
 c d     c                d    \        \        V P                  4       4      \        V4      .. R7       R# )a  
Verify whether the certificate of *connection* is valid for *hostname*.

Args:
    connection: A pyOpenSSL connection object.

    hostname: The hostname that *connection* should be connected to.

Raises:
    service_identity.VerificationError:
        If *connection* does not provide a certificate that is valid for
        *hostname*.

    service_identity.CertificateError:
        If certificate provided by *connection* contains invalid /
        unexpected data. This includes the case where the certificate
        contains no ``subjectAltName``\ s.

.. versionchanged:: 24.1.0
    :exc:`~service_identity.CertificateError` is raised if the certificate
    contains no ``subjectAltName``\ s instead of
    :exc:`~service_identity.VerificationError`.
cert_patternsobligatory_idsoptional_idsN)r   r   get_peer_certificater   )r   r   s   &&r   r   r      s0    0 &++-
 x()r   c               $    V ^8  d   QhRRRRRR/# )r   r   r
   
ip_addressr   r   r   r   )r   s   "r   r   r   ?   s!     ! !* !# !$ !r   c                d    \        \        V P                  4       4      \        V4      .. R7       R# )a  
Verify whether the certificate of *connection* is valid for *ip_address*.

Args:
    connection: A pyOpenSSL connection object.

    ip_address:
        The IP address that *connection* should be connected to. Can be an
        IPv4 or IPv6 address.

Raises:
    service_identity.VerificationError:
        If *connection* does not provide a certificate that is valid for
        *ip_address*.

    service_identity.CertificateError:
        If the certificate chain of *connection* contains a certificate
        that contains invalid/unexpected data.

.. versionadded:: 18.1.0

.. versionchanged:: 24.1.0
    :exc:`~service_identity.CertificateError` is raised if the certificate
    contains no ``subjectAltName``\ s instead of
    :exc:`~service_identity.VerificationError`.
r   N)r   r   r   r   )r   r   s   &&r   verify_ip_addressr!   ?   s0    6 &++-
 %Z01r   c                    V ^8  d   QhRRRR/# r   certr	   r   zSequence[CertificatePattern]r   )r   s   "r   r   r   c   s     B B4 B$@ Br   c                4    \        V P                  4       4      # )z
Extract all valid ID patterns from a certificate for service verification.

Args:
    cert: The certificate to be dissected.

Returns:
    List of IDs.

.. versionchanged:: 23.1.0
   ``commonName`` is not used as a fallback anymore.
)_cryptography_extract_patternsto_cryptographyr$   s   &r   r   r   c   s     *$*>*>*@AAr   c                    V ^8  d   QhRRRR/# r#   r   )r   s   "r   r   r   s   s     " "d "; "r   c                R    \         P                  ! \        R^R7       \        V 4      # )za
Deprecated and never public API.  Use :func:`extract_patterns` instead.

.. deprecated:: 23.1.0
z?`extract_ids()` is deprecated, please use `extract_patterns()`.)categorymessage
stacklevel)warningswarnDeprecationWarningr   r(   s   &r   extract_idsr1   s   s&     MM#Q
 D!!r   )__doc__
__future__r   
contextlibr.   typingr   cryptographyr   r&   hazmatr   r   r   r   suppressImportErrorOpenSSL.cryptor	   OpenSSL.SSLr
   __all__r   r!   r1   r   r   r   <module>r=      sn    #    L  %%#& & 
B!HB "} &%s   A55B	