a ‚oe²ã@s ddlmZddlZddlZddlZddlZddlZGdd„deƒZeZ eZ eZ eZ ddddœd d „Z ddddœd d „Zd*d dddœdd„Zdddœdd„ZGdd„deƒZGdd„dƒZGdd„dejƒZd+ddddddd œd!d"„Zd#d$d%œd&d'„ZGd(d)„d)ejƒZdS),é)Ú annotationsNc@s eZdZdS)ÚCryptographyDeprecationWarningN©Ú__name__Ú __module__Ú __qualname__©rrú3C:\Program Files\Certbot\pkgs\cryptography\utils.pyrsrÚstrÚbytesÚNone)ÚnameÚvalueÚreturncCst|tƒst|›d�ƒ‚dS)Nz must be bytes)Ú isinstancer Ú TypeError©r rrrr Ú _check_bytess rcCs2z t|ƒWn ty,t|›d�ƒ‚Yn0dS)Nz must be bytes-like)Ú memoryviewrrrrr Ú_check_byteslike"s  rÚintztyping.Optional[int])ÚintegerÚlengthrcCs | |p| ¡ddpdd¡S)NéééZbig)Úto_bytesÚ bit_length)rrrrr Ú int_to_bytes)sÿrz typing.Anyztyping.Tuple[typing.Any, int])ÚobjrcCs.ddlm}|j |¡}|t|j d|¡ƒfS)Nr)Ú_opensslZ uintptr_t)Z"cryptography.hazmat.bindings._rustr ZffiZ from_bufferrÚcast)rr Úbufrrr Ú_extract_buffer_length/s  r#c@s eZdZdS)ÚInterfaceNotImplementedNrrrrr r$6sr$c@seZdZdddœdd„ZdS)Ú_DeprecatedValueÚobjectr )rÚmessagecCs||_||_||_dS©N)rr'Ú warning_class)Úselfrr'r)rrr Ú__init__;sz_DeprecatedValue.__init__N)rrrr+rrrr r%:sr%csbeZdZddœ‡fdd„ Zdddœdd „Zddd d œd d „Zdd dœdd„Zddœdd„Z‡ZS)Ú_ModuleWithDeprecationsztypes.ModuleType)Úmodulecstƒ |j¡||jd<dS©NÚ_module)Úsuperr+rÚ__dict__)r*r-©Ú __class__rr r+Bsz _ModuleWithDeprecations.__init__r r&)ÚattrrcCs4t|j|ƒ}t|tƒr0tj|j|jdd�|j}|S©Né)Ú stacklevel) Úgetattrr/rr%ÚwarningsÚwarnr'r)r©r*r4rrrr Ú __getattr__Fs   z#_ModuleWithDeprecations.__getattr__r )r4rrcCst|j||ƒdSr()Úsetattrr/)r*r4rrrr Ú __setattr__Msz#_ModuleWithDeprecations.__setattr__cCs:t|j|ƒ}t|tƒr*tj|j|jdd�t|j|ƒdSr5) r8r/rr%r9r:r'r)Údelattrr;rrr Ú __delattr__Ps  z#_ModuleWithDeprecations.__delattr__ztyping.Sequence[str]©rcCsdgt|jƒSr.)Údirr/©r*rrr Ú__dir__Wsz_ModuleWithDeprecations.__dir__) rrrr+r<r>r@rDÚ __classcell__rrr2r r,As r,r&ztyping.Type[Warning]ztyping.Optional[str])rÚ module_namer'r)r rcCsJtj|}t|tƒs&t|ƒtj|<}t|||ƒ}|durFt|||ƒ|Sr()ÚsysÚmodulesrr,r%r=)rrFr'r)r r-Zdvrrr Ú deprecated[s    rIztyping.CallableÚproperty)Úfuncrcs.dˆ›�‰tƒ‰ddœ‡‡‡fdd„ }t|ƒS)NZ_cached_r&)Úinstancecs0t|ˆˆƒ}|ˆur|Sˆ|ƒ}t|ˆ|ƒ|Sr()r8r=)rLÚcacheÚresult©Z cached_namerKÚsentinelrr Úinnerps   zcached_property..inner)r&rJ)rKrQrrOr Úcached_propertyls rRc@s(eZdZddœdd„Zddœdd„ZdS)ÚEnumr rAcCs d|jj›d|j›d|j›d�S)Nú<Ú.z: ú>)r3rÚ_name_Ú_value_rCrrr Ú__repr__~sz Enum.__repr__cCs|jj›d|j›�S)NrU)r3rrWrCrrr Ú__str__�sz Enum.__str__N)rrrrYrZrrrr rS}srS)N)N)Z __future__rÚenumrGÚtypesÚtypingr9Ú UserWarningrZDeprecatedIn36ZDeprecatedIn37ZDeprecatedIn40ZDeprecatedIn41rrrr#Ú Exceptionr$r%Ú ModuleTyper,rIrRrSrrrr Ús* û