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we+gejx_He+ejx_Ie+gejy_Hdejy_Ie+gejz_He*ejz_Ie,e
e"gej{_He/ej{_Ie/e"gej|_He
ej|_Ie/e
e!e"gej}_Heej}_Ie,e
e!gej~_He.ej~_Ie.gej_He!ej_Ie.gej_Heej_Ie,ee+ee+e!e4e5gej_He2ej_Ie2e+gej_He+ej_Ie,ee+e!e3gej_He0ej_Ie,e!e3gej_He1ej_Ie1egej_Hdej_Ie0gej_He!ej_Ie0e!gej_Heej_Ie,uede_euede_euede_euede_e+e_+e0e_0e/e_/e2e_2W n  etk
r   eddY nX G dd dZdS )ay  
This module uses ctypes to bind a whole bunch of functions and constants from
SecureTransport. The goal here is to provide the low-level API to
SecureTransport. These are essentially the C-level functions and constants, and
they're pretty gross to work with.

This code is a bastardised version of the code found in Will Bond's oscrypto
library. An enormous debt is owed to him for blazing this trail for us. For
that reason, this code should be considered to be covered both by urllib3's
license and by oscrypto's:

    Copyright (c) 2015-2016 Will Bond <will@wbond.net>

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the "Software"),
    to deal in the Software without restriction, including without limitation
    the rights to use, copy, modify, merge, publish, distribute, sublicense,
    and/or sell copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    DEALINGS IN THE SOFTWARE.
    )annotationsN)CDLL	CFUNCTYPEPOINTERc_boolc_bytec_char_pc_int32c_longc_size_tc_uint32c_ulongc_void_p)find_libraryDarwinzOnly macOS is supported.)
      z,Only OS X 10.8 and newer are supported, not    strr   )namemacos10_16_pathreturnc                 C  sX   z,t dkr|}nt| }|s tt|ddW S  tk
rR   td|  ddY nX dS )z:Loads a CDLL by name, falling back to known path on 10.16+)r      T)Z	use_errnozThe library z failed to loadN)version_infor   OSErrorr   ImportError)r   r   path r   h/var/www/html/Darija-Ai-API/env/lib/python3.8/site-packages/urllib3/contrib/_securetransport/bindings.py	load_cdllA   s    r    Securityz6/System/Library/Frameworks/Security.framework/SecurityCoreFoundationzB/System/Library/Frameworks/CoreFoundation.framework/CoreFoundationkSecImportExportPassphrasekSecImportItemIdentitykCFAllocatorDefaultkCFTypeArrayCallBackskCFTypeDictionaryKeyCallBackskCFTypeDictionaryValueCallBackszError initializing ctypesc                   @  s   e Zd ZdZedZdS )CFConstz_
    A class object that acts as essentially a namespace for CoreFoundation
    constants.
    i  N)__name__
__module____qualname____doc__CFStringEncodingZkCFStringEncodingUTF8r   r   r   r   r)     s   r)   )r-   
__future__r   platformctypesr   r   r   r   r   r   r	   r
   r   r   r   r   ctypes.utilr   systemr   mac_verversiontuplemapintsplitr   r   r    r!   r"   BooleanZCFIndexr.   ZCFDataZCFStringZCFArrayZCFMutableArrayZCFDictionaryZCFErrorZCFTypeZCFTypeIDZ	CFTypeRefZCFAllocatorRefZOSStatusZ	CFDataRefZCFStringRefZ
CFArrayRefZCFMutableArrayRefZCFDictionaryRefZCFArrayCallBacksZCFDictionaryKeyCallBacksZCFDictionaryValueCallBacksZSecCertificateRefZSecExternalFormatZSecExternalItemTypeZSecIdentityRefZSecItemImportExportFlagsZ SecItemImportExportKeyParametersZSecKeychainRefSSLProtocolZSSLCipherSuiteZSSLContextRefZSecTrustRefZSSLConnectionRefZSecTrustResultTypeZSecTrustOptionFlagsZSSLProtocolSideZSSLConnectionTypeZSSLSessionOptionZSecItemImportZargtypesrestypeZSecCertificateGetTypeIDZSecIdentityGetTypeIDZSecKeyGetTypeIDZSecCertificateCreateWithDataZSecCertificateCopyDataZSecCopyErrorMessageStringZ SecIdentityCreateWithCertificateZSecKeychainCreateZSecKeychainDeleteZSecPKCS12ImportZSSLReadFuncZSSLWriteFuncZSSLSetIOFuncsZSSLSetPeerIDZSSLSetCertificateZSSLSetCertificateAuthoritiesZSSLSetConnectionZSSLSetPeerDomainNameZSSLHandshakeZSSLReadZSSLWriteZSSLCloseZSSLGetNumberSupportedCiphersZSSLGetSupportedCiphersZSSLSetEnabledCiphersZSSLGetNumberEnabledCiphersZargtypeZSSLGetEnabledCiphersZSSLGetNegotiatedCipherZSSLGetNegotiatedProtocolVersionZSSLCopyPeerTrustZSecTrustSetAnchorCertificatesZ!SecTrustSetAnchorCertificatesOnlyZ	argstypesZSecTrustEvaluateZSecTrustGetCertificateCountZSecTrustGetCertificateAtIndexZSSLCreateContextZSSLSetSessionOptionZSSLSetProtocolVersionMinZSSLSetProtocolVersionMaxZSSLSetALPNProtocolsAttributeErrorZin_dllr#   r$   ZCFRetainZ	CFReleaseZCFGetTypeIDZCFStringCreateWithCStringZCFStringGetCStringPtrZCFStringGetCStringZCFDataCreateZCFDataGetLengthZCFDataGetBytePtrZCFDictionaryCreateZCFDictionaryGetValueZCFArrayCreateZCFArrayCreateMutableZCFArrayAppendValueZCFArrayGetCountZCFArrayGetValueAtIndexr%   r&   r'   r(   r)   r   r   r   r   <module>   s.   8 


   


  





    
