o
    àý°j—0 ã                   @  sÊ  d dl mZ d dlZd dlZd dlZd dlZd dlZd dlmZm	Z	 d dl
mZ d dlmZ d dlmZ d dlmZmZ d dlmZ d d	lmZ d d
lmZmZ d dlmZ d dlmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% d dl&m'Z'm(Z( d dl)m*Z*m+Z+m,Z,m-Z- ej.dddd�Z/dŠdd„Z0d‹dd„Z1G dd„ de2ƒZ3G dd „ d e2ƒZ4G d!d„ dej5d"�Z6G d#d$„ d$ƒZ7G d%d&„ d&e6ƒZ8G d'd(„ d(e6ƒZ9G d)d*„ d*e6ƒZ:G d+d,„ d,e6ƒZ;G d-d.„ d.e6ƒZ<G d/d0„ d0ƒZ=G d1d2„ d2e6ƒZ>G d3d4„ d4e6ƒZ?G d5d6„ d6e6ƒZ@G d7d8„ d8e6ƒZAG d9d:„ d:ƒZBG d;d<„ d<ejCƒZDeDjEeDjFeDjGeDjHeDjIeDjJeDjKeDjLd=œZMeDjEd>eDjFd?eDjGd@eDjHdAeDjIdBeDjJdCeDjKdDeDjLdEiZNeDjOd eDjEd>eDjFd?eDjGd@eDjHdAeDjIdBeDjJdCeDjPdEeDjKdFeDjLdGi
ZQG dHdI„ dIe6ƒZRG dJdK„ dKe6ƒZSG dLdM„ dMƒZTG dNdO„ dOƒZUG dPdQ„ dQƒZVG dRdS„ dSe6ƒZWG dTdU„ dUe6ƒZXG dVdW„ dWe6ƒZYG dXdY„ dYe6ƒZZG dZd[„ d[ejCƒZ[d\d]„ e[D ƒZ\G d^d_„ d_e6ƒZ]G d`da„ dae6ƒZ^G dbdc„ dce6ƒZ_G ddde„ dee6ƒZ`G dfdg„ dgejae/ ƒZbG dhdi„ diƒZcG djdk„ dke6ƒZdG dldm„ dme6ƒZeG dndo„ doe6ƒZfG dpdq„ dqe6ƒZgG drds„ dse6ƒZhG dtdu„ due6ƒZiG dvdw„ dwe6ƒZjG dxdy„ dye6ƒZkG dzd{„ d{e6ƒZlG d|d}„ d}e6ƒZmG d~d„ de6ƒZnG d€d�„ d�ƒZoG d‚dƒ„ dƒƒZpG d„d…„ d…ƒZqG d†d‡„ d‡e6ƒZrG dˆd‰„ d‰e6ƒZsdS )Œé    )ÚannotationsN)ÚIterableÚIterator)Úutils)Úasn1)Úx509)Ú_serializationÚconstant_time)ÚEllipticCurvePublicKey)ÚRSAPublicKey)ÚCertificateIssuerPublicKeyTypesÚCertificatePublicKeyTypes)ÚSignedCertificateTimestamp)	ÚDirectoryNameÚDNSNameÚGeneralNameÚ	IPAddressÚ	OtherNameÚRegisteredIDÚ
RFC822NameÚUniformResourceIdentifierÚ_IPAddressTypes)ÚNameÚRelativeDistinguishedName)ÚCRLEntryExtensionOIDÚExtensionOIDÚObjectIdentifierÚOCSPExtensionOIDÚExtensionTypeVarÚExtensionTypeT)ÚboundÚ	covariantÚ
public_keyr   ÚreturnÚbytesc                 C  sl   t | tƒr|  tjjtjj¡}nt | tƒr |  tjj	tjj
¡}n|  tjjtjj¡}t |¡}t |¡ ¡ S ©N)Ú
isinstancer   Úpublic_bytesr   ÚEncodingÚDERÚPublicFormatÚPKCS1r
   ÚX962ÚUncompressedPointÚSubjectPublicKeyInfor   Úparse_spki_for_dataÚhashlibÚsha1Údigest)r"   ÚdataÚ
serialized© r5   ú�/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/cryptography/x509/extensions.pyÚ_key_identifier_from_public_key3   s    
þ
þþ
r7   Ú
field_nameÚstrc                   s0   d	‡ fdd„}‡ fdd„}‡ fdd„}|||fS )
Nr#   Úintc                   ó   t t| ˆ ƒƒS r%   )ÚlenÚgetattr©Úself©r8   r5   r6   Ú
len_methodL   ó   z*_make_sequence_methods.<locals>.len_methodc                   r;   r%   )Úiterr=   r>   r@   r5   r6   Úiter_methodO   rB   z+_make_sequence_methods.<locals>.iter_methodc                   s   t | ˆ ƒ| S r%   )r=   )r?   Úidxr@   r5   r6   Úgetitem_methodR   rB   z._make_sequence_methods.<locals>.getitem_method©r#   r:   r5   )r8   rA   rD   rF   r5   r@   r6   Ú_make_sequence_methodsK   s   
rH   c                      ó   e Zd Zd	‡ fdd„Z‡  ZS )
ÚDuplicateExtensionÚmsgr9   Úoidr   r#   ÚNonec                   ó   t ƒ  |¡ || _d S r%   ©ÚsuperÚ__init__rL   ©r?   rK   rL   ©Ú	__class__r5   r6   rQ   Y   ó   
zDuplicateExtension.__init__©rK   r9   rL   r   r#   rM   ©Ú__name__Ú
__module__Ú__qualname__rQ   Ú__classcell__r5   r5   rS   r6   rJ   X   ó    rJ   c                      rI   )
ÚExtensionNotFoundrK   r9   rL   r   r#   rM   c                   rN   r%   rO   rR   rS   r5   r6   rQ   _   rU   zExtensionNotFound.__init__rV   rW   r5   r5   rS   r6   r]   ^   r\   r]   c                   @  s    e Zd ZU ded< ddd„ZdS )	r   z!typing.ClassVar[ObjectIdentifier]rL   r#   r$   c                 C  s   t d| ›�ƒ‚)z7
        Serializes the extension type to DER.
        z3public_bytes is not implemented for extension type )ÚNotImplementedErrorr>   r5   r5   r6   r'   g   s   ÿzExtensionType.public_bytesN©r#   r$   )rX   rY   rZ   Ú__annotations__r'   r5   r5   r5   r6   r   d   s   
 )Ú	metaclassc                   @  sB   e Zd Zddd„Zdd
d„Zddd„Zedƒ\ZZZ	ddd„Z
dS )Ú
ExtensionsÚ
extensionsú"Iterable[Extension[ExtensionType]]r#   rM   c                 C  ó   t |ƒ| _d S r%   )ÚlistÚ_extensions)r?   rc   r5   r5   r6   rQ   q   rB   zExtensions.__init__rL   r   úExtension[ExtensionType]c                 C  s.   | D ]}|j |kr|  S qtd|› d�|ƒ‚)NúNo ú extension was found)rL   r]   )r?   rL   Úextr5   r5   r6   Úget_extension_for_oidt   s
   
ÿz Extensions.get_extension_for_oidÚextclassútype[ExtensionTypeVar]úExtension[ExtensionTypeVar]c                 C  sB   |t u rtdƒ‚| D ]}t|j|ƒr|  S q
td|› d�|jƒ‚)Nz|UnrecognizedExtension can't be used with get_extension_for_class because more than one instance of the class may be present.ri   rj   )ÚUnrecognizedExtensionÚ	TypeErrorr&   Úvaluer]   rL   )r?   rm   rk   r5   r5   r6   Úget_extension_for_class}   s   ÿÿÿz"Extensions.get_extension_for_classrg   r9   c                 C  ó   d| j › d�S )Nz<Extensions(ú)>)rg   r>   r5   r5   r6   Ú__repr__‘   rB   zExtensions.__repr__N)rc   rd   r#   rM   )rL   r   r#   rh   )rm   rn   r#   ro   ©r#   r9   )rX   rY   rZ   rQ   rl   rs   rH   Ú__len__Ú__iter__Ú__getitem__rv   r5   r5   r5   r6   rb   p   s    


	rb   c                   @  sR   e Zd ZejZddd„Zdd
d„Zddd„Zddd„Z	e
ddd„ƒZddd„ZdS )Ú	CRLNumberÚ
crl_numberr:   r#   rM   c                 C  ó   t |tƒs	tdƒ‚|| _d S ©Nzcrl_number must be an integer©r&   r:   rq   Ú_crl_number©r?   r|   r5   r5   r6   rQ   ˜   ó   

zCRLNumber.__init__ÚotherÚobjectÚboolc                 C  ó   t |tƒstS | j|jkS r%   )r&   r{   ÚNotImplementedr|   ©r?   rƒ   r5   r5   r6   Ú__eq__ž   ó   
zCRLNumber.__eq__c                 C  ó
   t | jƒS r%   ©Úhashr|   r>   r5   r5   r6   Ú__hash__¤   ó   
zCRLNumber.__hash__r9   c                 C  rt   )Nz<CRLNumber(ru   ©r|   r>   r5   r5   r6   rv   §   rB   zCRLNumber.__repr__c                 C  ó   | j S r%   ©r€   r>   r5   r5   r6   r|   ª   ó   zCRLNumber.crl_numberr$   c                 C  ó
   t  | ¡S r%   ©Ú	rust_x509Úencode_extension_valuer>   r5   r5   r6   r'   ®   r�   zCRLNumber.public_bytesN©r|   r:   r#   rM   ©rƒ   r„   r#   r…   rG   rw   r_   )rX   rY   rZ   r   Ú
CRL_NUMBERrL   rQ   r‰   rŽ   rv   Úpropertyr|   r'   r5   r5   r5   r6   r{   •   ó    



r{   c                   @  sŠ   e Zd ZejZd)d	d
„Zed*dd„ƒZed+dd„ƒZ	d,dd„Z
d-dd„Zd.dd„Zed/dd„ƒZed0d!d"„ƒZed1d#d$„ƒZd2d&d'„Zd(S )3ÚAuthorityKeyIdentifierÚkey_identifierúbytes | NoneÚauthority_cert_issuerúIterable[GeneralName] | NoneÚauthority_cert_serial_numberú
int | Noner#   rM   c                 C  sr   |d u |d u krt dƒ‚|d ur!t|ƒ}tdd„ |D ƒƒs!tdƒ‚|d ur.t|tƒs.tdƒ‚|| _|| _|| _d S )NzXauthority_cert_issuer and authority_cert_serial_number must both be present or both Nonec                 s  ó   � | ]}t |tƒV  qd S r%   ©r&   r   ©Ú.0Úxr5   r5   r6   Ú	<genexpr>Å   ó   € 

ÿz2AuthorityKeyIdentifier.__init__.<locals>.<genexpr>z;authority_cert_issuer must be a list of GeneralName objectsz/authority_cert_serial_number must be an integer)	Ú
ValueErrorrf   Úallrq   r&   r:   Ú_key_identifierÚ_authority_cert_issuerÚ_authority_cert_serial_number)r?   rž   r    r¢   r5   r5   r6   rQ   µ   s*   ÿÿÿÿ
ÿ
zAuthorityKeyIdentifier.__init__r"   r   c                 C  s   t |ƒ}| |d d d�S ©N©rž   r    r¢   ©r7   )Úclsr"   r2   r5   r5   r6   Úfrom_issuer_public_keyÛ   s   ýz-AuthorityKeyIdentifier.from_issuer_public_keyÚskiÚSubjectKeyIdentifierc                 C  s   | |j d d d�S r°   ©r2   )r³   rµ   r5   r5   r6   Ú"from_issuer_subject_key_identifieræ   s
   ýz9AuthorityKeyIdentifier.from_issuer_subject_key_identifierr9   c                 C  s   d| j ›d| j› d| j› d�S )Nz'<AuthorityKeyIdentifier(key_identifier=z, authority_cert_issuer=z, authority_cert_serial_number=ru   r±   r>   r5   r5   r6   rv   ð   ó   
ÿþÿzAuthorityKeyIdentifier.__repr__rƒ   r„   r…   c                 C  ó2   t |tƒstS | j|jko| j|jko| j|jkS r%   )r&   r�   r‡   rž   r    r¢   rˆ   r5   r5   r6   r‰   ø   s   

ÿÿýzAuthorityKeyIdentifier.__eq__r:   c                 C  s,   | j d u rd }nt| j ƒ}t| j|| jfƒS r%   )r    Útupler�   rž   r¢   )r?   Úacir5   r5   r6   rŽ     s   

ÿzAuthorityKeyIdentifier.__hash__c                 C  r‘   r%   )r­   r>   r5   r5   r6   rž     r“   z%AuthorityKeyIdentifier.key_identifierúlist[GeneralName] | Nonec                 C  r‘   r%   )r®   r>   r5   r5   r6   r      ó   z,AuthorityKeyIdentifier.authority_cert_issuerc                 C  r‘   r%   )r¯   r>   r5   r5   r6   r¢     r“   z3AuthorityKeyIdentifier.authority_cert_serial_numberr$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'     r�   z#AuthorityKeyIdentifier.public_bytesN)rž   rŸ   r    r¡   r¢   r£   r#   rM   )r"   r   r#   r�   )rµ   r¶   r#   r�   rw   r™   rG   ©r#   rŸ   ©r#   r½   ©r#   r£   r_   )rX   rY   rZ   r   ÚAUTHORITY_KEY_IDENTIFIERrL   rQ   Úclassmethodr´   r¸   rv   r‰   rŽ   r›   rž   r    r¢   r'   r5   r5   r5   r6   r�   ²   s"    
&

	

	r�   c                   @  sn   e Zd ZejZddd„Zedd	d
„ƒZe	ddd„ƒZ
e	ddd„ƒZd dd„Zd!dd„Zd"dd„Zddd„ZdS )#r¶   r2   r$   r#   rM   c                 C  s
   || _ d S r%   ©Ú_digest)r?   r2   r5   r5   r6   rQ   !  r�   zSubjectKeyIdentifier.__init__r"   r   c                 C  s   | t |ƒƒS r%   r²   )r³   r"   r5   r5   r6   Úfrom_public_key$  s   z$SubjectKeyIdentifier.from_public_keyc                 C  r‘   r%   rÄ   r>   r5   r5   r6   r2   *  r“   zSubjectKeyIdentifier.digestc                 C  r‘   r%   rÄ   r>   r5   r5   r6   rž   .  r“   z#SubjectKeyIdentifier.key_identifierr9   c                 C  ó   d| j ›d�S )Nz<SubjectKeyIdentifier(digest=ru   r·   r>   r5   r5   r6   rv   2  rB   zSubjectKeyIdentifier.__repr__rƒ   r„   r…   c                 C  s   t |tƒstS t | j|j¡S r%   )r&   r¶   r‡   r	   Úbytes_eqr2   rˆ   r5   r5   r6   r‰   5  s   
zSubjectKeyIdentifier.__eq__r:   c                 C  r‹   r%   )r�   r2   r>   r5   r5   r6   rŽ   ;  r�   zSubjectKeyIdentifier.__hash__c                 C  r”   r%   r•   r>   r5   r5   r6   r'   >  r�   z!SubjectKeyIdentifier.public_bytesN)r2   r$   r#   rM   )r"   r   r#   r¶   r_   rw   r™   rG   )rX   rY   rZ   r   ÚSUBJECT_KEY_IDENTIFIERrL   rQ   rÃ   rÆ   r›   r2   rž   rv   r‰   rŽ   r'   r5   r5   r5   r6   r¶     s    



r¶   c                   @  óR   e Zd ZejZddd„Zedƒ\ZZ	Z
dd	d
„Zddd„Zddd„Zddd„ZdS )ÚAuthorityInformationAccessÚdescriptionsúIterable[AccessDescription]r#   rM   c                 C  ó,   t |ƒ}tdd„ |D ƒƒstdƒ‚|| _d S )Nc                 s  r¤   r%   ©r&   ÚAccessDescriptionr¦   r5   r5   r6   r©   G  ó   € z6AuthorityInformationAccess.__init__.<locals>.<genexpr>ú@Every item in the descriptions list must be an AccessDescription©rf   r¬   rq   Ú_descriptions©r?   rÌ   r5   r5   r6   rQ   E  ó   ÿ
z#AuthorityInformationAccess.__init__rÔ   r9   c                 C  rt   )Nz<AuthorityInformationAccess(ru   ©rÔ   r>   r5   r5   r6   rv   Q  rB   z#AuthorityInformationAccess.__repr__rƒ   r„   r…   c                 C  r†   r%   )r&   rË   r‡   rÔ   rˆ   r5   r5   r6   r‰   T  rŠ   z!AuthorityInformationAccess.__eq__r:   c                 C  ó   t t| jƒƒS r%   ©r�   r»   rÔ   r>   r5   r5   r6   rŽ   Z  rB   z#AuthorityInformationAccess.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   ]  r�   z'AuthorityInformationAccess.public_bytesN©rÌ   rÍ   r#   rM   rw   r™   rG   r_   )rX   rY   rZ   r   ÚAUTHORITY_INFORMATION_ACCESSrL   rQ   rH   rx   ry   rz   rv   r‰   rŽ   r'   r5   r5   r5   r6   rË   B  ó    




rË   c                   @  rÊ   )ÚSubjectInformationAccessrÌ   rÍ   r#   rM   c                 C  rÎ   )Nc                 s  r¤   r%   rÏ   r¦   r5   r5   r6   r©   f  rÑ   z4SubjectInformationAccess.__init__.<locals>.<genexpr>rÒ   rÓ   rÕ   r5   r5   r6   rQ   d  rÖ   z!SubjectInformationAccess.__init__rÔ   r9   c                 C  rt   )Nz<SubjectInformationAccess(ru   r×   r>   r5   r5   r6   rv   p  rB   z!SubjectInformationAccess.__repr__rƒ   r„   r…   c                 C  r†   r%   )r&   rÝ   r‡   rÔ   rˆ   r5   r5   r6   r‰   s  rŠ   zSubjectInformationAccess.__eq__r:   c                 C  rØ   r%   rÙ   r>   r5   r5   r6   rŽ   y  rB   z!SubjectInformationAccess.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   |  r�   z%SubjectInformationAccess.public_bytesNrÚ   rw   r™   rG   r_   )rX   rY   rZ   r   ÚSUBJECT_INFORMATION_ACCESSrL   rQ   rH   rx   ry   rz   rv   r‰   rŽ   r'   r5   r5   r5   r6   rÝ   a  rÜ   rÝ   c                   @  óP   e Zd Zddd„Zdd
d„Zddd„Zddd„Zeddd„ƒZeddd„ƒZ	dS )rÐ   Úaccess_methodr   Úaccess_locationr   r#   rM   c                 C  s4   t |tƒs	tdƒ‚t |tƒstdƒ‚|| _|| _d S )Nz)access_method must be an ObjectIdentifierz%access_location must be a GeneralName)r&   r   rq   r   Ú_access_methodÚ_access_location)r?   rà   rá   r5   r5   r6   rQ   �  s   


zAccessDescription.__init__r9   c                 C  ó   d| j › d| j› d�S )Nz!<AccessDescription(access_method=z, access_location=ru   )rà   rá   r>   r5   r5   r6   rv   �  ó   
ÿÿzAccessDescription.__repr__rƒ   r„   r…   c                 C  ó&   t |tƒstS | j|jko| j|jkS r%   )r&   rÐ   r‡   rà   rá   rˆ   r5   r5   r6   r‰   “  ó
   

þzAccessDescription.__eq__r:   c                 C  ó   t | j| jfƒS r%   )r�   rà   rá   r>   r5   r5   r6   rŽ   œ  ó   zAccessDescription.__hash__c                 C  r‘   r%   )râ   r>   r5   r5   r6   rà   Ÿ  r“   zAccessDescription.access_methodc                 C  r‘   r%   )rã   r>   r5   r5   r6   rá   £  r“   z!AccessDescription.access_locationN)rà   r   rá   r   r#   rM   rw   r™   rG   ©r#   r   )r#   r   )
rX   rY   rZ   rQ   rv   r‰   rŽ   r›   rà   rá   r5   r5   r5   r6   rÐ   €  ó    



	rÐ   c                   @  s`   e Zd ZejZddd„Zedd	d
„ƒZeddd„ƒZ	ddd„Z
ddd„Zd dd„Zd!dd„ZdS )"ÚBasicConstraintsÚcar…   Úpath_lengthr£   r#   rM   c                 C  sX   t |tƒs	tdƒ‚|d ur|stdƒ‚|d ur$t |tƒr |dk r$tdƒ‚|| _|| _d S )Nzca must be a boolean valuez)path_length must be None when ca is Falser   z2path_length must be a non-negative integer or None)r&   r…   rq   r«   r:   Ú_caÚ_path_length)r?   rí   rî   r5   r5   r6   rQ   «  s   
ÿÿ
zBasicConstraints.__init__c                 C  r‘   r%   )rï   r>   r5   r5   r6   rí   ¼  r“   zBasicConstraints.cac                 C  r‘   r%   )rð   r>   r5   r5   r6   rî   À  r“   zBasicConstraints.path_lengthr9   c                 C  rä   )Nz<BasicConstraints(ca=z, path_length=ru   )rí   rî   r>   r5   r5   r6   rv   Ä  s   ÿzBasicConstraints.__repr__rƒ   r„   c                 C  ræ   r%   )r&   rì   r‡   rí   rî   rˆ   r5   r5   r6   r‰   É  ó   
zBasicConstraints.__eq__r:   c                 C  rè   r%   )r�   rí   rî   r>   r5   r5   r6   rŽ   Ï  ré   zBasicConstraints.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   Ò  r�   zBasicConstraints.public_bytesN)rí   r…   rî   r£   r#   rM   ©r#   r…   rÁ   rw   r™   rG   r_   )rX   rY   rZ   r   ÚBASIC_CONSTRAINTSrL   rQ   r›   rí   rî   rv   r‰   rŽ   r'   r5   r5   r5   r6   rì   ¨  s    



rì   c                   @  sR   e Zd ZejZddd„Zeddd„ƒZddd„Z	ddd„Z
ddd„Zddd„ZdS )ÚDeltaCRLIndicatorr|   r:   r#   rM   c                 C  r}   r~   r   r�   r5   r5   r6   rQ   Ù  r‚   zDeltaCRLIndicator.__init__c                 C  r‘   r%   r’   r>   r5   r5   r6   r|   ß  r“   zDeltaCRLIndicator.crl_numberrƒ   r„   r…   c                 C  r†   r%   )r&   rô   r‡   r|   rˆ   r5   r5   r6   r‰   ã  rŠ   zDeltaCRLIndicator.__eq__c                 C  r‹   r%   rŒ   r>   r5   r5   r6   rŽ   é  r�   zDeltaCRLIndicator.__hash__r9   c                 C  rt   )Nz<DeltaCRLIndicator(crl_number=ru   r�   r>   r5   r5   r6   rv   ì  rB   zDeltaCRLIndicator.__repr__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   ï  r�   zDeltaCRLIndicator.public_bytesNr˜   rG   r™   rw   r_   )rX   rY   rZ   r   ÚDELTA_CRL_INDICATORrL   rQ   r›   r|   r‰   rŽ   rv   r'   r5   r5   r5   r6   rô   Ö  s    



rô   c                   @  rÊ   )ÚCRLDistributionPointsÚdistribution_pointsúIterable[DistributionPoint]r#   rM   c                 C  rÎ   )Nc                 s  r¤   r%   ©r&   ÚDistributionPointr¦   r5   r5   r6   r©   ú  rª   z1CRLDistributionPoints.__init__.<locals>.<genexpr>ú?distribution_points must be a list of DistributionPoint objects©rf   r¬   rq   Ú_distribution_points©r?   r÷   r5   r5   r6   rQ   ö  ó   ÿÿ
zCRLDistributionPoints.__init__rý   r9   c                 C  rt   )Nz<CRLDistributionPoints(ru   ©rý   r>   r5   r5   r6   rv     rB   zCRLDistributionPoints.__repr__rƒ   r„   r…   c                 C  r†   r%   )r&   rö   r‡   rý   rˆ   r5   r5   r6   r‰     rŠ   zCRLDistributionPoints.__eq__r:   c                 C  rØ   r%   ©r�   r»   rý   r>   r5   r5   r6   rŽ     rB   zCRLDistributionPoints.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'     r�   z"CRLDistributionPoints.public_bytesN©r÷   rø   r#   rM   rw   r™   rG   r_   )rX   rY   rZ   r   ÚCRL_DISTRIBUTION_POINTSrL   rQ   rH   rx   ry   rz   rv   r‰   rŽ   r'   r5   r5   r5   r6   rö   ó  ó    

ÿ


rö   c                   @  rÊ   )ÚFreshestCRLr÷   rø   r#   rM   c                 C  rÎ   )Nc                 s  r¤   r%   rù   r¦   r5   r5   r6   r©     rª   z'FreshestCRL.__init__.<locals>.<genexpr>rû   rü   rþ   r5   r5   r6   rQ     rÿ   zFreshestCRL.__init__rý   r9   c                 C  rt   )Nz<FreshestCRL(ru   r   r>   r5   r5   r6   rv   -  rB   zFreshestCRL.__repr__rƒ   r„   r…   c                 C  r†   r%   )r&   r  r‡   rý   rˆ   r5   r5   r6   r‰   0  rŠ   zFreshestCRL.__eq__r:   c                 C  rØ   r%   r  r>   r5   r5   r6   rŽ   6  rB   zFreshestCRL.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   9  r�   zFreshestCRL.public_bytesNr  rw   r™   rG   r_   )rX   rY   rZ   r   ÚFRESHEST_CRLrL   rQ   rH   rx   ry   rz   rv   r‰   rŽ   r'   r5   r5   r5   r6   r    r  r  c                   @  sl   e Zd Zd!d
d„Zd"dd„Zd#dd„Zd$dd„Zed%dd„ƒZed&dd„ƒZ	ed'dd„ƒZ
ed%dd„ƒZd S )(rú   Ú	full_namer¡   Úrelative_nameú RelativeDistinguishedName | NoneÚreasonsúfrozenset[ReasonFlags] | NoneÚ
crl_issuerr#   rM   c                 C  sò   |r|rt dƒ‚|s|s|st dƒ‚|d ur't|ƒ}tdd„ |D ƒƒs'tdƒ‚|r2t|tƒs2tdƒ‚|d urGt|ƒ}tdd„ |D ƒƒsGtdƒ‚|r[t|tƒrWtd	d„ |D ƒƒs[td
ƒ‚|rktj|v sgtj	|v rkt dƒ‚|| _
|| _|| _|| _d S )NzOYou cannot provide both full_name and relative_name, at least one must be None.z?Either full_name, relative_name or crl_issuer must be provided.c                 s  r¤   r%   r¥   r¦   r5   r5   r6   r©   R  rÑ   z-DistributionPoint.__init__.<locals>.<genexpr>z/full_name must be a list of GeneralName objectsz1relative_name must be a RelativeDistinguishedNamec                 s  r¤   r%   r¥   r¦   r5   r5   r6   r©   _  rÑ   z2crl_issuer must be None or a list of general namesc                 s  r¤   r%   ©r&   ÚReasonFlagsr¦   r5   r5   r6   r©   f  rÑ   z0reasons must be None or frozenset of ReasonFlagszLunspecified and remove_from_crl are not valid reasons in a DistributionPoint)r«   rf   r¬   rq   r&   r   Ú	frozensetr  ÚunspecifiedÚremove_from_crlÚ
_full_nameÚ_relative_nameÚ_reasonsÚ_crl_issuer)r?   r  r  r
  r  r5   r5   r6   rQ   >  sR   ÿÿÿ
ÿÿÿþ

ÿ
zDistributionPoint.__init__r9   c                 C  ó
   d  | ¡S )Nz}<DistributionPoint(full_name={0.full_name}, relative_name={0.relative_name}, reasons={0.reasons}, crl_issuer={0.crl_issuer})>©Úformatr>   r5   r5   r6   rv   x  ó   ýzDistributionPoint.__repr__rƒ   r„   r…   c                 C  s>   t |tƒstS | j|jko| j|jko| j|jko| j|jkS r%   )r&   rú   r‡   r  r  r
  r  rˆ   r5   r5   r6   r‰     s   

ÿ
þ
üzDistributionPoint.__eq__r:   c                 C  sH   | j d urt| j ƒ}nd }| jd urt| jƒ}nd }t|| j| j|fƒS r%   )r  r»   r  r�   r  r
  )r?   Úfnr  r5   r5   r6   rŽ   Š  s   

zDistributionPoint.__hash__r½   c                 C  r‘   r%   ©r  r>   r5   r5   r6   r  —  r“   zDistributionPoint.full_namec                 C  r‘   r%   ©r  r>   r5   r5   r6   r  ›  r“   zDistributionPoint.relative_namec                 C  r‘   r%   )r  r>   r5   r5   r6   r
  Ÿ  r“   zDistributionPoint.reasonsc                 C  r‘   r%   )r  r>   r5   r5   r6   r  £  r“   zDistributionPoint.crl_issuerN)
r  r¡   r  r	  r
  r  r  r¡   r#   rM   rw   r™   rG   rÀ   ©r#   r	  ©r#   r  )rX   rY   rZ   rQ   rv   r‰   rŽ   r›   r  r  r
  r  r5   r5   r5   r6   rú   =  s    

:

rú   c                   @  s4   e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdS )r  r  ÚkeyCompromiseÚcACompromiseÚaffiliationChangedÚ
supersededÚcessationOfOperationÚcertificateHoldÚprivilegeWithdrawnÚaACompromiseÚremoveFromCRLN)rX   rY   rZ   r  Úkey_compromiseÚca_compromiseÚaffiliation_changedr"  Úcessation_of_operationÚcertificate_holdÚprivilege_withdrawnÚaa_compromiser  r5   r5   r5   r6   r  ¨  s    r  )é   é   é   é   é   é   é   é   r/  r0  r1  r2  r3  r4  r5  r6  é	   é
   c                   @  s`   e Zd ZejZddd„Zdd	d
„Zddd„Zddd„Z	e
ddd„ƒZe
ddd„ƒZd dd„ZdS )!ÚPolicyConstraintsÚrequire_explicit_policyr£   Úinhibit_policy_mappingr#   rM   c                 C  s\   |d urt |tƒstdƒ‚|d urt |tƒstdƒ‚|d u r&|d u r&tdƒ‚|| _|| _d S )Nz>require_explicit_policy must be a non-negative integer or Nonez=inhibit_policy_mapping must be a non-negative integer or NonezSAt least one of require_explicit_policy and inhibit_policy_mapping must not be None)r&   r:   rq   r«   Ú_require_explicit_policyÚ_inhibit_policy_mapping)r?   r:  r;  r5   r5   r6   rQ   ô  s$   
ÿÿ
ÿÿÿ
zPolicyConstraints.__init__r9   c                 C  r  )Nz{<PolicyConstraints(require_explicit_policy={0.require_explicit_policy}, inhibit_policy_mapping={0.inhibit_policy_mapping})>r  r>   r5   r5   r6   rv     r  zPolicyConstraints.__repr__rƒ   r„   r…   c                 C  ræ   r%   )r&   r9  r‡   r:  r;  rˆ   r5   r5   r6   r‰     rç   zPolicyConstraints.__eq__r:   c                 C  rè   r%   )r�   r:  r;  r>   r5   r5   r6   rŽ   !  s   
ÿzPolicyConstraints.__hash__c                 C  r‘   r%   )r<  r>   r5   r5   r6   r:  &  r“   z)PolicyConstraints.require_explicit_policyc                 C  r‘   r%   )r=  r>   r5   r5   r6   r;  *  r“   z(PolicyConstraints.inhibit_policy_mappingr$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   .  r�   zPolicyConstraints.public_bytesN)r:  r£   r;  r£   r#   rM   rw   r™   rG   rÁ   r_   )rX   rY   rZ   r   ÚPOLICY_CONSTRAINTSrL   rQ   rv   r‰   rŽ   r›   r:  r;  r'   r5   r5   r5   r6   r9  ñ  s    



	r9  c                   @  rÊ   )ÚCertificatePoliciesÚpoliciesúIterable[PolicyInformation]r#   rM   c                 C  rÎ   )Nc                 s  r¤   r%   )r&   ÚPolicyInformationr¦   r5   r5   r6   r©   7  rÑ   z/CertificatePolicies.__init__.<locals>.<genexpr>z;Every item in the policies list must be a PolicyInformation)rf   r¬   rq   Ú	_policies)r?   r@  r5   r5   r6   rQ   5  ó   ÿ
zCertificatePolicies.__init__rC  r9   c                 C  rt   )Nz<CertificatePolicies(ru   )rC  r>   r5   r5   r6   rv   @  rB   zCertificatePolicies.__repr__rƒ   r„   r…   c                 C  r†   r%   )r&   r?  r‡   rC  rˆ   r5   r5   r6   r‰   C  rŠ   zCertificatePolicies.__eq__r:   c                 C  rØ   r%   )r�   r»   rC  r>   r5   r5   r6   rŽ   I  rB   zCertificatePolicies.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   L  r�   z CertificatePolicies.public_bytesN)r@  rA  r#   rM   rw   r™   rG   r_   )rX   rY   rZ   r   ÚCERTIFICATE_POLICIESrL   rQ   rH   rx   ry   rz   rv   r‰   rŽ   r'   r5   r5   r5   r6   r?  2  ó    
	


r?  c                   @  óP   e Zd Zddd„Zdd
d„Zddd„Zddd„Zeddd„ƒZeddd„ƒZ	dS ) rB  Úpolicy_identifierr   Úpolicy_qualifiersú!Iterable[str | UserNotice] | Noner#   rM   c                 C  sL   t |tƒs	tdƒ‚|| _|d ur!t|ƒ}tdd„ |D ƒƒs!tdƒ‚|| _d S )Nz-policy_identifier must be an ObjectIdentifierc                 s  s   � | ]
}t |ttfƒV  qd S r%   )r&   r9   Ú
UserNoticer¦   r5   r5   r6   r©   ]  s   € 
ÿz-PolicyInformation.__init__.<locals>.<genexpr>zMpolicy_qualifiers must be a list of strings and/or UserNotice objects or None)r&   r   rq   Ú_policy_identifierrf   r¬   Ú_policy_qualifiers)r?   rH  rI  r5   r5   r6   rQ   Q  s   
ÿÿ
zPolicyInformation.__init__r9   c                 C  rä   )Nz%<PolicyInformation(policy_identifier=z, policy_qualifiers=ru   )rH  rI  r>   r5   r5   r6   rv   g  rå   zPolicyInformation.__repr__rƒ   r„   r…   c                 C  ræ   r%   )r&   rB  r‡   rH  rI  rˆ   r5   r5   r6   r‰   m  rç   zPolicyInformation.__eq__r:   c                 C  s(   | j d urt| j ƒ}nd }t| j|fƒS r%   )rI  r»   r�   rH  )r?   Úpqr5   r5   r6   rŽ   v  s   
zPolicyInformation.__hash__c                 C  r‘   r%   )rL  r>   r5   r5   r6   rH  ~  r“   z#PolicyInformation.policy_identifierúlist[str | UserNotice] | Nonec                 C  r‘   r%   )rM  r>   r5   r5   r6   rI  ‚  r¾   z#PolicyInformation.policy_qualifiersN)rH  r   rI  rJ  r#   rM   rw   r™   rG   rê   )r#   rO  )
rX   rY   rZ   rQ   rv   r‰   rŽ   r›   rH  rI  r5   r5   r5   r6   rB  P  s    



	rB  c                   @  rß   )rK  Únotice_referenceúNoticeReference | NoneÚexplicit_textú
str | Noner#   rM   c                 C  s&   |rt |tƒstdƒ‚|| _|| _d S )Nz2notice_reference must be None or a NoticeReference)r&   ÚNoticeReferencerq   Ú_notice_referenceÚ_explicit_text)r?   rP  rR  r5   r5   r6   rQ   Š  s   ÿÿ
zUserNotice.__init__r9   c                 C  ó   d| j › d| j›d�S )Nz<UserNotice(notice_reference=z, explicit_text=ru   )rP  rR  r>   r5   r5   r6   rv   ™  rå   zUserNotice.__repr__rƒ   r„   r…   c                 C  ræ   r%   )r&   rK  r‡   rP  rR  rˆ   r5   r5   r6   r‰   Ÿ  rç   zUserNotice.__eq__r:   c                 C  rè   r%   )r�   rP  rR  r>   r5   r5   r6   rŽ   ¨  ré   zUserNotice.__hash__c                 C  r‘   r%   )rU  r>   r5   r5   r6   rP  «  r“   zUserNotice.notice_referencec                 C  r‘   r%   )rV  r>   r5   r5   r6   rR  ¯  r“   zUserNotice.explicit_textN)rP  rQ  rR  rS  r#   rM   rw   r™   rG   )r#   rQ  ©r#   rS  )
rX   rY   rZ   rQ   rv   r‰   rŽ   r›   rP  rR  r5   r5   r5   r6   rK  ‰  s    



	rK  c                   @  rG  ) rT  ÚorganizationrS  Únotice_numbersúIterable[int]r#   rM   c                 C  s2   || _ t|ƒ}tdd„ |D ƒƒstdƒ‚|| _d S )Nc                 s  r¤   r%   )r&   r:   r¦   r5   r5   r6   r©   ¼  rÑ   z+NoticeReference.__init__.<locals>.<genexpr>z)notice_numbers must be a list of integers)Ú_organizationrf   r¬   rq   Ú_notice_numbers)r?   rY  rZ  r5   r5   r6   rQ   µ  s
   
zNoticeReference.__init__r9   c                 C  s   d| j ›d| j› d�S )Nz<NoticeReference(organization=z, notice_numbers=ru   )rY  rZ  r>   r5   r5   r6   rv   Á  rå   zNoticeReference.__repr__rƒ   r„   r…   c                 C  ræ   r%   )r&   rT  r‡   rY  rZ  rˆ   r5   r5   r6   r‰   Ç  rç   zNoticeReference.__eq__r:   c                 C  ó   t | jt| jƒfƒS r%   )r�   rY  r»   rZ  r>   r5   r5   r6   rŽ   Ð  ó   zNoticeReference.__hash__c                 C  r‘   r%   )r\  r>   r5   r5   r6   rY  Ó  r“   zNoticeReference.organizationú	list[int]c                 C  r‘   r%   )r]  r>   r5   r5   r6   rZ  ×  r“   zNoticeReference.notice_numbersN)rY  rS  rZ  r[  r#   rM   rw   r™   rG   rX  )r#   r`  )
rX   rY   rZ   rQ   rv   r‰   rŽ   r›   rY  rZ  r5   r5   r5   r6   rT  ´  rë   rT  c                   @  rÊ   )ÚExtendedKeyUsageÚusagesúIterable[ObjectIdentifier]r#   rM   c                 C  rÎ   )Nc                 s  r¤   r%   ©r&   r   r¦   r5   r5   r6   r©   á  rÑ   z,ExtendedKeyUsage.__init__.<locals>.<genexpr>z9Every item in the usages list must be an ObjectIdentifier)rf   r¬   rq   Ú_usages)r?   rb  r5   r5   r6   rQ   ß  rD  zExtendedKeyUsage.__init__re  r9   c                 C  rt   )Nz<ExtendedKeyUsage(ru   )re  r>   r5   r5   r6   rv   ê  rB   zExtendedKeyUsage.__repr__rƒ   r„   r…   c                 C  r†   r%   )r&   ra  r‡   re  rˆ   r5   r5   r6   r‰   í  rŠ   zExtendedKeyUsage.__eq__r:   c                 C  rØ   r%   )r�   r»   re  r>   r5   r5   r6   rŽ   ó  rB   zExtendedKeyUsage.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   ö  r�   zExtendedKeyUsage.public_bytesN)rb  rc  r#   rM   rw   r™   rG   r_   )rX   rY   rZ   r   ÚEXTENDED_KEY_USAGErL   rQ   rH   rx   ry   rz   rv   r‰   rŽ   r'   r5   r5   r5   r6   ra  Ü  rF  ra  c                   @  ó:   e Zd ZejZddd„Zddd	„Zddd„Zddd„Z	dS )ÚOCSPNoCheckrƒ   r„   r#   r…   c                 C  ó   t |tƒstS dS ©NT)r&   rh  r‡   rˆ   r5   r5   r6   r‰   ý  ó   
zOCSPNoCheck.__eq__r:   c                 C  ó   t tƒS r%   )r�   rh  r>   r5   r5   r6   rŽ     ó   zOCSPNoCheck.__hash__r9   c                 C  ó   dS )Nz<OCSPNoCheck()>r5   r>   r5   r5   r6   rv     ó   zOCSPNoCheck.__repr__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   	  r�   zOCSPNoCheck.public_bytesNr™   rG   rw   r_   )
rX   rY   rZ   r   ÚOCSP_NO_CHECKrL   r‰   rŽ   rv   r'   r5   r5   r5   r6   rh  ú  ó    


rh  c                   @  rg  )ÚPrecertPoisonrƒ   r„   r#   r…   c                 C  ri  rj  )r&   rr  r‡   rˆ   r5   r5   r6   r‰     rk  zPrecertPoison.__eq__r:   c                 C  rl  r%   )r�   rr  r>   r5   r5   r6   rŽ     rm  zPrecertPoison.__hash__r9   c                 C  rn  )Nz<PrecertPoison()>r5   r>   r5   r5   r6   rv     ro  zPrecertPoison.__repr__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'     r�   zPrecertPoison.public_bytesNr™   rG   rw   r_   )
rX   rY   rZ   r   ÚPRECERT_POISONrL   r‰   rŽ   rv   r'   r5   r5   r5   r6   rr    rq  rr  c                   @  rÊ   )Ú
TLSFeatureÚfeaturesúIterable[TLSFeatureType]r#   rM   c                 C  s8   t |ƒ}tdd„ |D ƒƒrt|ƒdkrtdƒ‚|| _d S )Nc                 s  r¤   r%   )r&   ÚTLSFeatureTyper¦   r5   r5   r6   r©   &  rÑ   z&TLSFeature.__init__.<locals>.<genexpr>r   z@features must be a list of elements from the TLSFeatureType enum)rf   r¬   r<   rq   Ú	_features)r?   ru  r5   r5   r6   rQ   #  s   ÿÿ
zTLSFeature.__init__rx  r9   c                 C  rt   )Nz<TLSFeature(features=ru   )rx  r>   r5   r5   r6   rv   2  rB   zTLSFeature.__repr__rƒ   r„   r…   c                 C  r†   r%   )r&   rt  r‡   rx  rˆ   r5   r5   r6   r‰   5  rŠ   zTLSFeature.__eq__r:   c                 C  rØ   r%   )r�   r»   rx  r>   r5   r5   r6   rŽ   ;  rB   zTLSFeature.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   >  r�   zTLSFeature.public_bytesN)ru  rv  r#   rM   rw   r™   rG   r_   )rX   rY   rZ   r   ÚTLS_FEATURErL   rQ   rH   rx   ry   rz   rv   r‰   rŽ   r'   r5   r5   r5   r6   rt     s    



rt  c                   @  s   e Zd ZdZdZdS )rw  r3  é   N)rX   rY   rZ   Ústatus_requestÚstatus_request_v2r5   r5   r5   r6   rw  B  s    rw  c                 C  s   i | ]}|j |“qS r5   ©rr   r¦   r5   r5   r6   Ú
<dictcomp>M  ó    r~  c                   @  sR   e Zd ZejZddd„Zddd	„Zddd„Zddd„Z	e
ddd„ƒZddd„ZdS )ÚInhibitAnyPolicyÚ
skip_certsr:   r#   rM   c                 C  s,   t |tƒs	tdƒ‚|dk rtdƒ‚|| _d S )Nzskip_certs must be an integerr   z)skip_certs must be a non-negative integer)r&   r:   rq   r«   Ú_skip_certs)r?   r�  r5   r5   r6   rQ   S  s
   

zInhibitAnyPolicy.__init__r9   c                 C  rt   )Nz<InhibitAnyPolicy(skip_certs=ru   )r�  r>   r5   r5   r6   rv   \  rB   zInhibitAnyPolicy.__repr__rƒ   r„   r…   c                 C  r†   r%   )r&   r€  r‡   r�  rˆ   r5   r5   r6   r‰   _  rŠ   zInhibitAnyPolicy.__eq__c                 C  r‹   r%   )r�   r�  r>   r5   r5   r6   rŽ   e  r�   zInhibitAnyPolicy.__hash__c                 C  r‘   r%   )r‚  r>   r5   r5   r6   r�  h  r“   zInhibitAnyPolicy.skip_certsr$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   l  r�   zInhibitAnyPolicy.public_bytesN)r�  r:   r#   rM   rw   r™   rG   r_   )rX   rY   rZ   r   ÚINHIBIT_ANY_POLICYrL   rQ   rv   r‰   rŽ   r›   r�  r'   r5   r5   r5   r6   r€  P  s    

	

r€  c                   @  sÂ   e Zd ZejZd/dd„Zed0dd„ƒZed0dd„ƒZ	ed0dd„ƒZ
ed0dd„ƒZed0dd„ƒZed0dd„ƒZed0dd„ƒZed0dd„ƒZed0dd „ƒZd1d"d#„Zd2d&d'„Zd3d)d*„Zd4d,d-„Zd.S )5ÚKeyUsageÚdigital_signaturer…   Úcontent_commitmentÚkey_enciphermentÚdata_enciphermentÚkey_agreementÚkey_cert_signÚcrl_signÚencipher_onlyÚdecipher_onlyr#   rM   c
           
      C  sN   |s
|s|	r
t dƒ‚|| _|| _|| _|| _|| _|| _|| _|| _|	| _	d S )NzKencipher_only and decipher_only can only be true when key_agreement is true)
r«   Ú_digital_signatureÚ_content_commitmentÚ_key_enciphermentÚ_data_enciphermentÚ_key_agreementÚ_key_cert_signÚ	_crl_signÚ_encipher_onlyÚ_decipher_only)
r?   r…  r†  r‡  rˆ  r‰  rŠ  r‹  rŒ  r�  r5   r5   r6   rQ   s  s   ÿ
zKeyUsage.__init__c                 C  r‘   r%   )rŽ  r>   r5   r5   r6   r…  �  r“   zKeyUsage.digital_signaturec                 C  r‘   r%   )r�  r>   r5   r5   r6   r†  “  r“   zKeyUsage.content_commitmentc                 C  r‘   r%   )r�  r>   r5   r5   r6   r‡  —  r“   zKeyUsage.key_enciphermentc                 C  r‘   r%   )r‘  r>   r5   r5   r6   rˆ  ›  r“   zKeyUsage.data_enciphermentc                 C  r‘   r%   )r’  r>   r5   r5   r6   r‰  Ÿ  r“   zKeyUsage.key_agreementc                 C  r‘   r%   )r“  r>   r5   r5   r6   rŠ  £  r“   zKeyUsage.key_cert_signc                 C  r‘   r%   )r”  r>   r5   r5   r6   r‹  §  r“   zKeyUsage.crl_signc                 C  ó   | j stdƒ‚| jS )Nz7encipher_only is undefined unless key_agreement is true)r‰  r«   r•  r>   r5   r5   r6   rŒ  «  ó
   ÿzKeyUsage.encipher_onlyc                 C  r—  )Nz7decipher_only is undefined unless key_agreement is true)r‰  r«   r–  r>   r5   r5   r6   r�  ´  r˜  zKeyUsage.decipher_onlyr9   c                 C  sv   z| j }| j}W n ty   d}d}Y nw d| j› d| j› d| j› d| j› d| j› d| j› d| j	› d	|› d
|› d�S )NFz<KeyUsage(digital_signature=z, content_commitment=z, key_encipherment=z, data_encipherment=z, key_agreement=z, key_cert_sign=z, crl_sign=z, encipher_only=z, decipher_only=ru   )
rŒ  r�  r«   r…  r†  r‡  rˆ  r‰  rŠ  r‹  )r?   rŒ  r�  r5   r5   r6   rv   ½  s2   
û
ÿþýüûûúúÿzKeyUsage.__repr__rƒ   r„   c                 C  sz   t |tƒstS | j|jko<| j|jko<| j|jko<| j|jko<| j|jko<| j|jko<| j	|j	ko<| j
|j
ko<| j|jkS r%   )r&   r„  r‡   r…  r†  r‡  rˆ  r‰  rŠ  r‹  r•  r–  rˆ   r5   r5   r6   r‰   Ò  s&   

ÿ
þ
ý
ü
û
ú
ù
÷zKeyUsage.__eq__r:   c              
   C  s,   t | j| j| j| j| j| j| j| j| j	f	ƒS r%   )
r�   r…  r†  r‡  rˆ  r‰  rŠ  r‹  r•  r–  r>   r5   r5   r6   rŽ   â  s   ÷ÿzKeyUsage.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   ñ  r�   zKeyUsage.public_bytesN)r…  r…   r†  r…   r‡  r…   rˆ  r…   r‰  r…   rŠ  r…   r‹  r…   rŒ  r…   r�  r…   r#   rM   rò   rw   r™   rG   r_   )rX   rY   rZ   r   Ú	KEY_USAGErL   rQ   r›   r…  r†  r‡  rˆ  r‰  rŠ  r‹  rŒ  r�  rv   r‰   rŽ   r'   r5   r5   r5   r6   r„  p  s2    



r„  c                   @  s`   e Zd ZejZddd„Zeddd	„ƒZedd
d„ƒZ	ddd„Z
ddd„Zddd„Zd dd„ZdS )!ÚPrivateKeyUsagePeriodÚ
not_beforeúdatetime.datetime | NoneÚ	not_afterr#   rM   c                 C  s€   t |tjƒs|d urtdƒ‚t |tjƒs|d urtdƒ‚|d u r(|d u r(tdƒ‚|d ur8|d ur8||kr8tdƒ‚|| _|| _d S )Nz.not_before must be a datetime.datetime or Nonez-not_after must be a datetime.datetime or Nonez9At least one of not_before and not_after must not be Nonez#not_before must be before not_after)r&   Údatetimerq   r«   Ú_not_beforeÚ
_not_after)r?   r›  r�  r5   r5   r6   rQ   ø  s$   
ÿ
ÿÿ
zPrivateKeyUsagePeriod.__init__c                 C  r‘   r%   )rŸ  r>   r5   r5   r6   r›    r“   z PrivateKeyUsagePeriod.not_beforec                 C  r‘   r%   )r   r>   r5   r5   r6   r�    r“   zPrivateKeyUsagePeriod.not_afterr9   c                 C  rä   )Nz"<PrivateKeyUsagePeriod(not_before=z, not_after=ru   )r›  r�  r>   r5   r5   r6   rv      rå   zPrivateKeyUsagePeriod.__repr__rƒ   r„   r…   c                 C  ræ   r%   )r&   rš  r‡   r›  r�  rˆ   r5   r5   r6   r‰   &  rç   zPrivateKeyUsagePeriod.__eq__r:   c                 C  rè   r%   )r�   r›  r�  r>   r5   r5   r6   rŽ   /  ré   zPrivateKeyUsagePeriod.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   2  r�   z"PrivateKeyUsagePeriod.public_bytesN)r›  rœ  r�  rœ  r#   rM   )r#   rœ  rw   r™   rG   r_   )rX   rY   rZ   r   ÚPRIVATE_KEY_USAGE_PERIODrL   rQ   r›   r›  r�  rv   r‰   rŽ   r'   r5   r5   r5   r6   rš  õ  s    
 


	rš  c                   @  s~   e Zd ZejZd$dd„Zd%dd„Zd&dd„Zd&dd„Z	d&dd„Z
d'dd„Zd(dd„Zed)dd„ƒZed)dd„ƒZd*d!d"„Zd#S )+ÚNameConstraintsÚpermitted_subtreesr¡   Úexcluded_subtreesr#   rM   c                 C  s¨   |d ur t |ƒ}|stdƒ‚tdd„ |D ƒƒstdƒ‚|  |¡ |d ur@t |ƒ}|s.tdƒ‚tdd„ |D ƒƒs;tdƒ‚|  |¡ |d u rL|d u rLtdƒ‚|| _|| _d S )	Nz3permitted_subtrees must be a non-empty list or Nonec                 s  r¤   r%   r¥   r¦   r5   r5   r6   r©   D  rÑ   z+NameConstraints.__init__.<locals>.<genexpr>z@permitted_subtrees must be a list of GeneralName objects or Nonez2excluded_subtrees must be a non-empty list or Nonec                 s  r¤   r%   r¥   r¦   r5   r5   r6   r©   R  rÑ   z?excluded_subtrees must be a list of GeneralName objects or NonezIAt least one of permitted_subtrees and excluded_subtrees must not be None)rf   r«   r¬   rq   Ú_validate_treeÚ_permitted_subtreesÚ_excluded_subtrees)r?   r£  r¤  r5   r5   r6   rQ   9  s8   ÿÿ
ÿÿ
ÿ
zNameConstraints.__init__rƒ   r„   r…   c                 C  ræ   r%   )r&   r¢  r‡   r¤  r£  rˆ   r5   r5   r6   r‰   c  rç   zNameConstraints.__eq__ÚtreeúIterable[GeneralName]c                 C  s   |   |¡ |  |¡ d S r%   )Ú_validate_ip_nameÚ_validate_dns_name©r?   r¨  r5   r5   r6   r¥  l  s   
zNameConstraints._validate_treec                 C  ó   t dd„ |D ƒƒrtdƒ‚d S )Nc                 s  s0   � | ]}t |tƒot |jtjtjfƒ V  qd S r%   )r&   r   rr   Ú	ipaddressÚIPv4NetworkÚIPv6Network©r§   Únamer5   r5   r6   r©   q  s   € 
üÿ
þz4NameConstraints._validate_ip_name.<locals>.<genexpr>zGIPAddress name constraints must be an IPv4Network or IPv6Network object)Úanyrq   r¬  r5   r5   r6   rª  p  s   ûÿùz!NameConstraints._validate_ip_namec                 C  r­  )Nc                 s  s$   � | ]}t |tƒod |jv V  qdS )Ú*N)r&   r   rr   r±  r5   r5   r6   r©   ~  s   € 
ÿz5NameConstraints._validate_dns_name.<locals>.<genexpr>zDDNSName name constraints must not contain the '*' wildcard character)r³  r«   r¬  r5   r5   r6   r«  }  s   ÿÿýz"NameConstraints._validate_dns_namer9   c                 C  rä   )Nz$<NameConstraints(permitted_subtrees=z, excluded_subtrees=ru   )r£  r¤  r>   r5   r5   r6   rv   †  rå   zNameConstraints.__repr__r:   c                 C  s@   | j d urt| j ƒ}nd }| jd urt| jƒ}nd }t||fƒS r%   )r£  r»   r¤  r�   )r?   ÚpsÚesr5   r5   r6   rŽ   Œ  s   

zNameConstraints.__hash__r½   c                 C  r‘   r%   )r¦  r>   r5   r5   r6   r£  ™  r¾   z"NameConstraints.permitted_subtreesc                 C  r‘   r%   )r§  r>   r5   r5   r6   r¤  Ÿ  r¾   z!NameConstraints.excluded_subtreesr$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   ¥  r�   zNameConstraints.public_bytesN)r£  r¡   r¤  r¡   r#   rM   r™   )r¨  r©  r#   rM   rw   rG   rÀ   r_   )rX   rY   rZ   r   ÚNAME_CONSTRAINTSrL   rQ   r‰   r¥  rª  r«  rv   rŽ   r›   r£  r¤  r'   r5   r5   r5   r6   r¢  6  s    

*
	


	
r¢  c                   @  s^   e Zd Zdd	d
„Zeddd„ƒZeddd„ƒZeddd„ƒZd dd„Zd!dd„Z	d"dd„Z
dS )#Ú	ExtensionrL   r   Úcriticalr…   rr   r   r#   rM   c                 C  s:   t |tƒs	tdƒ‚t |tƒstdƒ‚|| _|| _|| _d S )Nz2oid argument must be an ObjectIdentifier instance.z critical must be a boolean value)r&   r   rq   r…   Ú_oidÚ	_criticalÚ_value)r?   rL   r¹  rr   r5   r5   r6   rQ   ª  s   
ÿ

zExtension.__init__c                 C  r‘   r%   ©rº  r>   r5   r5   r6   rL   ¹  r“   zExtension.oidc                 C  r‘   r%   )r»  r>   r5   r5   r6   r¹  ½  r“   zExtension.criticalc                 C  r‘   r%   ©r¼  r>   r5   r5   r6   rr   Á  r“   zExtension.valuer9   c                 C  ó   d| j › d| j› d| j› d�S )Nz<Extension(oid=z, critical=ú, value=ru   )rL   r¹  rr   r>   r5   r5   r6   rv   Å  s   ÿÿzExtension.__repr__rƒ   r„   c                 C  rº   r%   )r&   r¸  r‡   rL   r¹  rr   rˆ   r5   r5   r6   r‰   Ë  ó   

ÿ
ýzExtension.__eq__r:   c                 C  ó   t | j| j| jfƒS r%   )r�   rL   r¹  rr   r>   r5   r5   r6   rŽ   Õ  r_  zExtension.__hash__N)rL   r   r¹  r…   rr   r   r#   rM   rê   rò   )r#   r   rw   r™   rG   )rX   rY   rZ   rQ   r›   rL   r¹  rr   rv   r‰   rŽ   r5   r5   r5   r6   r¸  ©  s    



r¸  c                   @  sœ   e Zd Zd(dd„Zedƒ\ZZZej	d)dd„ƒZ
ej	d*dd„ƒZ
ej	d+dd„ƒZ
ej	d,dd„ƒZ
ej	d-dd„ƒZ
d.dd„Z
d/dd„Zd0d"d#„Zd1d%d&„Zd'S )2ÚGeneralNamesÚgeneral_namesr©  r#   rM   c                 C  rÎ   )Nc                 s  r¤   r%   r¥   r¦   r5   r5   r6   r©   Ü  rÑ   z(GeneralNames.__init__.<locals>.<genexpr>z^Every item in the general_names list must be an object conforming to the GeneralName interface)rf   r¬   rq   Ú_general_names©r?   rÄ  r5   r5   r6   rQ   Ú  rÖ   zGeneralNames.__init__rÅ  ÚtypeúBtype[DNSName] | type[UniformResourceIdentifier] | type[RFC822Name]ú	list[str]c                 C  ó   d S r%   r5   ©r?   rÇ  r5   r5   r6   Úget_values_for_typeæ  ó   z GeneralNames.get_values_for_typeútype[DirectoryName]ú
list[Name]c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  î  ó   útype[RegisteredID]úlist[ObjectIdentifier]c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  ô  rÐ  útype[IPAddress]úlist[_IPAddressTypes]c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  ú  ó   útype[OtherName]úlist[OtherName]c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  ÿ  rÕ  ú‘type[DNSName] | type[DirectoryName] | type[IPAddress] | type[OtherName] | type[RFC822Name] | type[RegisteredID] | type[UniformResourceIdentifier]úYlist[_IPAddressTypes] | list[str] | list[OtherName] | list[Name] | list[ObjectIdentifier]c                   s0   ‡ fdd„| D ƒ}ˆ t krdd„ |D ƒS t|ƒS )Nc                 3  s   � | ]
}t |ˆ ƒr|V  qd S r%   )r&   ©r§   Úi©rÇ  r5   r6   r©     s   € z3GeneralNames.get_values_for_type.<locals>.<genexpr>c                 S  s   g | ]}|j ‘qS r5   r}  rÚ  r5   r5   r6   Ú
<listcomp>  s    z4GeneralNames.get_values_for_type.<locals>.<listcomp>)r   rf   )r?   rÇ  Úobjsr5   rÜ  r6   rÌ    s   r9   c                 C  rt   )Nz<GeneralNames(ru   ©rÅ  r>   r5   r5   r6   rv     rB   zGeneralNames.__repr__rƒ   r„   r…   c                 C  r†   r%   )r&   rÃ  r‡   rÅ  rˆ   r5   r5   r6   r‰     rŠ   zGeneralNames.__eq__r:   c                 C  rØ   r%   )r�   r»   rÅ  r>   r5   r5   r6   rŽ   %  rB   zGeneralNames.__hash__N©rÄ  r©  r#   rM   ©rÇ  rÈ  r#   rÉ  ©rÇ  rÎ  r#   rÏ  ©rÇ  rÑ  r#   rÒ  ©rÇ  rÓ  r#   rÔ  ©rÇ  rÖ  r#   r×  ©rÇ  rØ  r#   rÙ  rw   r™   rG   )rX   rY   rZ   rQ   rH   rx   ry   rz   ÚtypingÚoverloadrÌ  rv   r‰   rŽ   r5   r5   r5   r6   rÃ  Ù  s"    




rÃ  c                   @  ó¬   e Zd ZejZd+dd„Zedƒ\ZZ	Z
ejd,dd„ƒZejd-dd„ƒZejd.dd„ƒZejd/dd„ƒZejd0dd„ƒZd1dd„Zd2dd„Zd3d"d#„Zd4d%d&„Zd5d(d)„Zd*S )6ÚSubjectAlternativeNamerÄ  r©  r#   rM   c                 C  re   r%   ©rÃ  rÅ  rÆ  r5   r5   r6   rQ   ,  rB   zSubjectAlternativeName.__init__rÅ  rÇ  rÈ  rÉ  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  1  rÍ  z*SubjectAlternativeName.get_values_for_typerÎ  rÏ  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  9  rÐ  rÑ  rÒ  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  ?  rÐ  rÓ  rÔ  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  E  rÕ  rÖ  r×  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  J  rÕ  rØ  rÙ  c                 C  ó   | j  |¡S r%   ©rÅ  rÌ  rË  r5   r5   r6   rÌ  O  ó   r9   c                 C  rt   )Nz<SubjectAlternativeName(ru   rß  r>   r5   r5   r6   rv   a  rB   zSubjectAlternativeName.__repr__rƒ   r„   r…   c                 C  r†   r%   )r&   rê  r‡   rÅ  rˆ   r5   r5   r6   r‰   d  rŠ   zSubjectAlternativeName.__eq__r:   c                 C  r‹   r%   ©r�   rÅ  r>   r5   r5   r6   rŽ   j  r�   zSubjectAlternativeName.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   m  r�   z#SubjectAlternativeName.public_bytesNrà  rá  râ  rã  rä  rå  ræ  rw   r™   rG   r_   )rX   rY   rZ   r   ÚSUBJECT_ALTERNATIVE_NAMErL   rQ   rH   rx   ry   rz   rç  rè  rÌ  rv   r‰   rŽ   r'   r5   r5   r5   r6   rê  )  ó&    




rê  c                   @  ré  )6ÚIssuerAlternativeNamerÄ  r©  r#   rM   c                 C  re   r%   rë  rÆ  r5   r5   r6   rQ   t  rB   zIssuerAlternativeName.__init__rÅ  rÇ  rÈ  rÉ  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  y  rÍ  z)IssuerAlternativeName.get_values_for_typerÎ  rÏ  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  �  rÐ  rÑ  rÒ  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  ‡  rÐ  rÓ  rÔ  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  �  rÕ  rÖ  r×  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  ’  rÕ  rØ  rÙ  c                 C  rì  r%   rí  rË  r5   r5   r6   rÌ  —  rî  r9   c                 C  rt   )Nz<IssuerAlternativeName(ru   rß  r>   r5   r5   r6   rv   ©  rB   zIssuerAlternativeName.__repr__rƒ   r„   r…   c                 C  r†   r%   )r&   rò  r‡   rÅ  rˆ   r5   r5   r6   r‰   ¬  rŠ   zIssuerAlternativeName.__eq__r:   c                 C  r‹   r%   rï  r>   r5   r5   r6   rŽ   ²  r�   zIssuerAlternativeName.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   µ  r�   z"IssuerAlternativeName.public_bytesNrà  rá  râ  rã  rä  rå  ræ  rw   r™   rG   r_   )rX   rY   rZ   r   ÚISSUER_ALTERNATIVE_NAMErL   rQ   rH   rx   ry   rz   rç  rè  rÌ  rv   r‰   rŽ   r'   r5   r5   r5   r6   rò  q  rñ  rò  c                   @  ré  )6ÚCertificateIssuerrÄ  r©  r#   rM   c                 C  re   r%   rë  rÆ  r5   r5   r6   rQ   ¼  rB   zCertificateIssuer.__init__rÅ  rÇ  rÈ  rÉ  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  Á  rÍ  z%CertificateIssuer.get_values_for_typerÎ  rÏ  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  É  rÐ  rÑ  rÒ  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  Ï  rÐ  rÓ  rÔ  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  Õ  rÕ  rÖ  r×  c                 C  rÊ  r%   r5   rË  r5   r5   r6   rÌ  Ú  rÕ  rØ  rÙ  c                 C  rì  r%   rí  rË  r5   r5   r6   rÌ  ß  rî  r9   c                 C  rt   )Nz<CertificateIssuer(ru   rß  r>   r5   r5   r6   rv   ñ  rB   zCertificateIssuer.__repr__rƒ   r„   r…   c                 C  r†   r%   )r&   rô  r‡   rÅ  rˆ   r5   r5   r6   r‰   ô  rŠ   zCertificateIssuer.__eq__r:   c                 C  r‹   r%   rï  r>   r5   r5   r6   rŽ   ú  r�   zCertificateIssuer.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   ý  r�   zCertificateIssuer.public_bytesNrà  rá  râ  rã  rä  rå  ræ  rw   r™   rG   r_   )rX   rY   rZ   r   ÚCERTIFICATE_ISSUERrL   rQ   rH   rx   ry   rz   rç  rè  rÌ  rv   r‰   rŽ   r'   r5   r5   r5   r6   rô  ¹  rñ  rô  c                   @  sR   e Zd ZejZddd„Zddd	„Zddd„Zddd„Z	e
ddd„ƒZddd„ZdS )Ú	CRLReasonÚreasonr  r#   rM   c                 C  r}   )Nz*reason must be an element from ReasonFlags)r&   r  rq   Ú_reason)r?   r÷  r5   r5   r6   rQ     r‚   zCRLReason.__init__r9   c                 C  rt   )Nz<CRLReason(reason=ru   ©rø  r>   r5   r5   r6   rv   
  rB   zCRLReason.__repr__rƒ   r„   r…   c                 C  r†   r%   )r&   rö  r‡   r÷  rˆ   r5   r5   r6   r‰     rŠ   zCRLReason.__eq__r:   c                 C  r‹   r%   )r�   r÷  r>   r5   r5   r6   rŽ     r�   zCRLReason.__hash__c                 C  r‘   r%   rù  r>   r5   r5   r6   r÷    r“   zCRLReason.reasonr$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'     r�   zCRLReason.public_bytesN)r÷  r  r#   rM   rw   r™   rG   )r#   r  r_   )rX   rY   rZ   r   Ú
CRL_REASONrL   rQ   rv   r‰   rŽ   r›   r÷  r'   r5   r5   r5   r6   rö    s    



rö  c                   @  s`   e Zd ZejZddd„Zddd	„Zddd„Zddd„Z	e
ddd„ƒZe
ddd„ƒZddd„ZdS ) ÚInvalidityDateÚinvalidity_dateúdatetime.datetimer#   rM   c                 C  s   t |tjƒs
tdƒ‚|| _d S )Nz+invalidity_date must be a datetime.datetime)r&   rž  rq   Ú_invalidity_date)r?   rü  r5   r5   r6   rQ   !  s   
zInvalidityDate.__init__r9   c                 C  rt   )Nz <InvalidityDate(invalidity_date=ru   ©rþ  r>   r5   r5   r6   rv   '  rB   zInvalidityDate.__repr__rƒ   r„   r…   c                 C  r†   r%   )r&   rû  r‡   rü  rˆ   r5   r5   r6   r‰   *  rŠ   zInvalidityDate.__eq__r:   c                 C  r‹   r%   )r�   rü  r>   r5   r5   r6   rŽ   0  r�   zInvalidityDate.__hash__c                 C  r‘   r%   rÿ  r>   r5   r5   r6   rü  3  r“   zInvalidityDate.invalidity_datec                 C  s0   | j jd u r| j jtjjd�S | j jtjjd�S )N)Útzinfo)Útz)rþ  r   Úreplacerž  ÚtimezoneÚutcÚ
astimezoner>   r5   r5   r6   Úinvalidity_date_utc7  s   z"InvalidityDate.invalidity_date_utcr$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   >  r�   zInvalidityDate.public_bytesN)rü  rý  r#   rM   rw   r™   rG   )r#   rý  r_   )rX   rY   rZ   r   ÚINVALIDITY_DATErL   rQ   rv   r‰   rŽ   r›   rü  r  r'   r5   r5   r5   r6   rû    s    



rû  c                   @  óR   e Zd ZejZddd„Zedƒ\ZZ	Z
dd	d
„Zddd„Zddd„Zddd„ZdS )Ú)PrecertificateSignedCertificateTimestampsÚsigned_certificate_timestampsú$Iterable[SignedCertificateTimestamp]r#   rM   c                 C  rÎ   )Nc                 s  r¤   r%   ©r&   r   ©r§   Úsctr5   r5   r6   r©   J  ó
   € ÿ
ÿzEPrecertificateSignedCertificateTimestamps.__init__.<locals>.<genexpr>úYEvery item in the signed_certificate_timestamps list must be a SignedCertificateTimestamp©rf   r¬   rq   Ú_signed_certificate_timestamps©r?   r
  r5   r5   r6   rQ   E  ó   þÿ
z2PrecertificateSignedCertificateTimestamps.__init__r  r9   c                 C  ó   dt | ƒ› d�S )Nz+<PrecertificateSignedCertificateTimestamps(ru   ©rf   r>   r5   r5   r6   rv   X  ré   z2PrecertificateSignedCertificateTimestamps.__repr__r:   c                 C  rØ   r%   ©r�   r»   r  r>   r5   r5   r6   rŽ   [  rB   z2PrecertificateSignedCertificateTimestamps.__hash__rƒ   r„   r…   c                 C  r†   r%   )r&   r	  r‡   r  rˆ   r5   r5   r6   r‰   ^  ó   
ÿÿz0PrecertificateSignedCertificateTimestamps.__eq__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   g  r�   z6PrecertificateSignedCertificateTimestamps.public_bytesN©r
  r  r#   rM   rw   rG   r™   r_   )rX   rY   rZ   r   Ú%PRECERT_SIGNED_CERTIFICATE_TIMESTAMPSrL   rQ   rH   rx   ry   rz   rv   rŽ   r‰   r'   r5   r5   r5   r6   r	  B  ó    

ÿ


	r	  c                   @  r  )ÚSignedCertificateTimestampsr
  r  r#   rM   c                 C  rÎ   )Nc                 s  r¤   r%   r  r  r5   r5   r6   r©   s  r  z7SignedCertificateTimestamps.__init__.<locals>.<genexpr>r  r  r  r5   r5   r6   rQ   n  r  z$SignedCertificateTimestamps.__init__r  r9   c                 C  r  )Nz<SignedCertificateTimestamps(ru   r  r>   r5   r5   r6   rv   �  ré   z$SignedCertificateTimestamps.__repr__r:   c                 C  rØ   r%   r  r>   r5   r5   r6   rŽ   „  rB   z$SignedCertificateTimestamps.__hash__rƒ   r„   r…   c                 C  r†   r%   )r&   r  r‡   r  rˆ   r5   r5   r6   r‰   ‡  r  z"SignedCertificateTimestamps.__eq__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   �  r�   z(SignedCertificateTimestamps.public_bytesNr  rw   rG   r™   r_   )rX   rY   rZ   r   ÚSIGNED_CERTIFICATE_TIMESTAMPSrL   rQ   rH   rx   ry   rz   rv   rŽ   r‰   r'   r5   r5   r5   r6   r  k  r  r  c                   @  sR   e Zd ZejZddd„Zdd
d„Zddd„Zddd„Z	e
ddd„ƒZddd„ZdS )Ú	OCSPNonceÚnoncer$   r#   rM   c                 C  r}   )Nznonce must be bytes)r&   r$   rq   Ú_nonce)r?   r  r5   r5   r6   rQ   —  r‚   zOCSPNonce.__init__rƒ   r„   r…   c                 C  r†   r%   )r&   r  r‡   r  rˆ   r5   r5   r6   r‰   �  rŠ   zOCSPNonce.__eq__r:   c                 C  r‹   r%   )r�   r  r>   r5   r5   r6   rŽ   £  r�   zOCSPNonce.__hash__r9   c                 C  rÇ   )Nz<OCSPNonce(nonce=ru   )r  r>   r5   r5   r6   rv   ¦  rB   zOCSPNonce.__repr__c                 C  r‘   r%   )r   r>   r5   r5   r6   r  ©  r“   zOCSPNonce.noncec                 C  r”   r%   r•   r>   r5   r5   r6   r'   ­  r�   zOCSPNonce.public_bytesN)r  r$   r#   rM   r™   rG   rw   r_   )rX   rY   rZ   r   ÚNONCErL   rQ   r‰   rŽ   rv   r›   r  r'   r5   r5   r5   r6   r  ”  rœ   r  c                   @  sN   e Zd ZejZddd„Zdd
d„Zddd„Zddd„Z	ddd„Z
ddd„ZdS )ÚOCSPAcceptableResponsesÚ	responsesrc  r#   rM   c                 C  s,   t |ƒ}tdd„ |D ƒƒrtdƒ‚|| _d S )Nc                 s  s   � | ]	}t |tƒ V  qd S r%   rd  )r§   Úrr5   r5   r6   r©   ¶  s   € z3OCSPAcceptableResponses.__init__.<locals>.<genexpr>z'All responses must be ObjectIdentifiers)rf   r³  rq   Ú
_responses)r?   r#  r5   r5   r6   rQ   ´  s   
z OCSPAcceptableResponses.__init__rƒ   r„   r…   c                 C  r†   r%   )r&   r"  r‡   r%  rˆ   r5   r5   r6   r‰   »  rŠ   zOCSPAcceptableResponses.__eq__r:   c                 C  rØ   r%   )r�   r»   r%  r>   r5   r5   r6   rŽ   Á  rB   z OCSPAcceptableResponses.__hash__r9   c                 C  rt   )Nz#<OCSPAcceptableResponses(responses=ru   )r%  r>   r5   r5   r6   rv   Ä  rB   z OCSPAcceptableResponses.__repr__úIterator[ObjectIdentifier]c                 C  r‹   r%   )rC   r%  r>   r5   r5   r6   ry   Ç  r�   z OCSPAcceptableResponses.__iter__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   Ê  r�   z$OCSPAcceptableResponses.public_bytesN)r#  rc  r#   rM   r™   rG   rw   )r#   r&  r_   )rX   rY   rZ   r   ÚACCEPTABLE_RESPONSESrL   rQ   r‰   rŽ   rv   ry   r'   r5   r5   r5   r6   r"  ±  s    




r"  c                   @  s¦   e Zd ZejZd-dd„Zd.dd„Zd/dd„Zd0dd„Z	e
d1dd„ƒZe
d2dd„ƒZe
d3dd „ƒZe
d3d!d"„ƒZe
d4d#d$„ƒZe
d3d%d&„ƒZe
d3d'd(„ƒZd5d*d+„Zd,S )6ÚIssuingDistributionPointr  r¡   r  r	  Úonly_contains_user_certsr…   Úonly_contains_ca_certsÚonly_some_reasonsr  Úindirect_crlÚonly_contains_attribute_certsr#   rM   c           	      C  sü   |d urt |ƒ}|rt|tƒrtdd„ |D ƒƒstdƒ‚|r,tj|v s(tj|v r,tdƒ‚t|t	ƒr@t|t	ƒr@t|t	ƒr@t|t	ƒsDtdƒ‚|||g}t
dd„ |D ƒƒdkrXtd	ƒ‚t|||||||gƒsgtd
ƒ‚|| _|| _|| _|| _|| _|| _|| _d S )Nc                 s  r¤   r%   r  r¦   r5   r5   r6   r©   à  rÑ   z4IssuingDistributionPoint.__init__.<locals>.<genexpr>z:only_some_reasons must be None or frozenset of ReasonFlagszTunspecified and remove_from_crl are not valid reasons in an IssuingDistributionPointzuonly_contains_user_certs, only_contains_ca_certs, indirect_crl and only_contains_attribute_certs must all be boolean.c                 S  s   g | ]}|r|‘qS r5   r5   r¦   r5   r5   r6   rÝ    r  z5IssuingDistributionPoint.__init__.<locals>.<listcomp>r/  z}Only one of the following can be set to True: only_contains_user_certs, only_contains_ca_certs, only_contains_attribute_certszàCannot create empty extension: if only_contains_user_certs, only_contains_ca_certs, indirect_crl, and only_contains_attribute_certs are all False, then either full_name, relative_name, or only_some_reasons must have a value.)rf   r&   r  r¬   rq   r  r  r  r«   r…   r<   r³  Ú_only_contains_user_certsÚ_only_contains_ca_certsÚ_indirect_crlÚ_only_contains_attribute_certsÚ_only_some_reasonsr  r  )	r?   r  r  r)  r*  r+  r,  r-  Úcrl_constraintsr5   r5   r6   rQ   Ñ  sn   
ÿþÿ

ÿÿþýüÿ
ýÿùÿÿ
z!IssuingDistributionPoint.__init__r9   c                 C  s>   d| j › d| j› d| j› d| j› d| j› d| j› d| j› d�S )	Nz$<IssuingDistributionPoint(full_name=z, relative_name=z, only_contains_user_certs=z, only_contains_ca_certs=z, only_some_reasons=z, indirect_crl=z , only_contains_attribute_certs=ru   )r  r  r)  r*  r+  r,  r-  r>   r5   r5   r6   rv   &  s   
ÿþýüûùÿz!IssuingDistributionPoint.__repr__rƒ   r„   c                 C  sb   t |tƒstS | j|jko0| j|jko0| j|jko0| j|jko0| j|jko0| j|jko0| j	|j	kS r%   )
r&   r(  r‡   r  r  r)  r*  r+  r,  r-  rˆ   r5   r5   r6   r‰   2  s"   

ÿ
þ
ý
ü
ûÿùzIssuingDistributionPoint.__eq__r:   c                 C  s<   | j d urt| j ƒ}nd }t|| j| j| j| j| j| jfƒS r%   )	r  r»   r�   r  r)  r*  r+  r,  r-  )r?   r  r5   r5   r6   rŽ   A  s   
ùÿz!IssuingDistributionPoint.__hash__r½   c                 C  r‘   r%   r  r>   r5   r5   r6   r  S  r“   z"IssuingDistributionPoint.full_namec                 C  r‘   r%   r  r>   r5   r5   r6   r  W  r“   z&IssuingDistributionPoint.relative_namec                 C  r‘   r%   )r.  r>   r5   r5   r6   r)  [  r“   z1IssuingDistributionPoint.only_contains_user_certsc                 C  r‘   r%   )r/  r>   r5   r5   r6   r*  _  r“   z/IssuingDistributionPoint.only_contains_ca_certsc                 C  r‘   r%   )r2  r>   r5   r5   r6   r+  c  r¾   z*IssuingDistributionPoint.only_some_reasonsc                 C  r‘   r%   )r0  r>   r5   r5   r6   r,  i  r“   z%IssuingDistributionPoint.indirect_crlc                 C  r‘   r%   )r1  r>   r5   r5   r6   r-  m  r“   z6IssuingDistributionPoint.only_contains_attribute_certsr$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   q  r�   z%IssuingDistributionPoint.public_bytesN)r  r¡   r  r	  r)  r…   r*  r…   r+  r  r,  r…   r-  r…   r#   rM   rw   r™   rG   rÀ   r  rò   r  r_   )rX   rY   rZ   r   ÚISSUING_DISTRIBUTION_POINTrL   rQ   rv   r‰   rŽ   r›   r  r  r)  r*  r+  r,  r-  r'   r5   r5   r5   r6   r(  Î  s*    

U

r(  c                   @  sn   e Zd ZejZddd	„Zed d
d„ƒZed!dd„ƒZ	ed!dd„ƒZ
d"dd„Zd#dd„Zd$dd„Zd%dd„ZdS )&ÚMSCertificateTemplateÚtemplate_idr   Úmajor_versionr£   Úminor_versionr#   rM   c                 C  sT   t |tƒs	tdƒ‚|| _|d urt |tƒr|d ur"t |tƒs"tdƒ‚|| _|| _d S )Núoid must be an ObjectIdentifierz8major_version and minor_version must be integers or None)r&   r   rq   Ú_template_idr:   Ú_major_versionÚ_minor_version)r?   r6  r7  r8  r5   r5   r6   rQ   x  s   
ÿ
zMSCertificateTemplate.__init__c                 C  r‘   r%   )r:  r>   r5   r5   r6   r6  Œ  r“   z!MSCertificateTemplate.template_idc                 C  r‘   r%   )r;  r>   r5   r5   r6   r7  �  r“   z#MSCertificateTemplate.major_versionc                 C  r‘   r%   )r<  r>   r5   r5   r6   r8  ”  r“   z#MSCertificateTemplate.minor_versionr9   c                 C  r¿  )Nz#<MSCertificateTemplate(template_id=z, major_version=z, minor_version=ru   )r6  r7  r8  r>   r5   r5   r6   rv   ˜  r¹   zMSCertificateTemplate.__repr__rƒ   r„   r…   c                 C  rº   r%   )r&   r5  r‡   r6  r7  r8  rˆ   r5   r5   r6   r‰   Ÿ  rÁ  zMSCertificateTemplate.__eq__r:   c                 C  rÂ  r%   )r�   r6  r7  r8  r>   r5   r5   r6   rŽ   ©  r_  zMSCertificateTemplate.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   ¬  r�   z"MSCertificateTemplate.public_bytesN)r6  r   r7  r£   r8  r£   r#   rM   rê   rÁ   rw   r™   rG   r_   )rX   rY   rZ   r   ÚMS_CERTIFICATE_TEMPLATErL   rQ   r›   r6  r7  r8  rv   r‰   rŽ   r'   r5   r5   r5   r6   r5  u  s    




r5  c                   @  s^   e Zd Zddd	„Zedd
d„ƒZeddd„ƒZeddd„ƒZddd„Zd dd„Z	d!dd„Z
dS )"ÚNamingAuthorityÚidúObjectIdentifier | NoneÚurlrS  Útextr#   rM   c                 C  sd   |d urt |tƒstdƒ‚|d urt |tƒstdƒ‚|d ur't |tƒs'tdƒ‚|| _|| _|| _d S )Nzid must be an ObjectIdentifierzurl must be a strztext must be a str)r&   r   rq   r9   Ú_idÚ_urlÚ_text)r?   r?  rA  rB  r5   r5   r6   rQ   ±  s   
zNamingAuthority.__init__c                 C  r‘   r%   )rC  r>   r5   r5   r6   r?  Ä  r“   zNamingAuthority.idc                 C  r‘   r%   )rD  r>   r5   r5   r6   rA  È  r“   zNamingAuthority.urlc                 C  r‘   r%   )rE  r>   r5   r5   r6   rB  Ì  r“   zNamingAuthority.textr9   c                 C  r¿  )Nz<NamingAuthority(id=z, url=z, text=ru   )r?  rA  rB  r>   r5   r5   r6   rv   Ð  s   ÿÿÿÿzNamingAuthority.__repr__rƒ   r„   r…   c                 C  rº   r%   )r&   r>  r‡   r?  rA  rB  rˆ   r5   r5   r6   r‰   Ö  rÁ  zNamingAuthority.__eq__r:   c                 C  rÂ  r%   )r�   r?  rA  rB  r>   r5   r5   r6   rŽ   à  s   ýÿzNamingAuthority.__hash__N)r?  r@  rA  rS  rB  rS  r#   rM   )r#   r@  rX  rw   r™   rG   )rX   rY   rZ   rQ   r›   r?  rA  rB  rv   r‰   rŽ   r5   r5   r5   r6   r>  °  s    



r>  c                   @  sz   e Zd Zd'dd„Zed(dd„ƒZed)dd„ƒZed*dd„ƒZed+dd„ƒZed,dd„ƒZ	d-dd„Z
d.d!d"„Zd/d$d%„Zd&S )0ÚProfessionInfoÚnaming_authorityúNamingAuthority | NoneÚprofession_itemsúIterable[str]Úprofession_oidsú!Iterable[ObjectIdentifier] | NoneÚregistration_numberrS  Úadd_profession_inforŸ   r#   rM   c                 C  s¼   |d urt |tƒstdƒ‚t|ƒ}tdd„ |D ƒƒstdƒ‚|d ur3t|ƒ}tdd„ |D ƒƒs3tdƒ‚|d ur@t |tƒs@tdƒ‚|d urMt |tƒsMtdƒ‚|| _|| _|| _	|| _
|| _d S )	Nú*naming_authority must be a NamingAuthorityc                 s  r¤   r%   )r&   r9   )r§   Úitemr5   r5   r6   r©   ù  rÑ   z*ProfessionInfo.__init__.<locals>.<genexpr>z5Every item in the profession_items list must be a strc                 s  r¤   r%   rd  )r§   rL   r5   r5   r6   r©    	  rª   zBEvery item in the profession_oids list must be an ObjectIdentifierz!registration_number must be a strz!add_profession_info must be bytes)r&   r>  rq   rf   r¬   r9   r$   Ú_naming_authorityÚ_profession_itemsÚ_profession_oidsÚ_registration_numberÚ_add_profession_info)r?   rG  rI  rK  rM  rN  r5   r5   r6   rQ   ë  s<   
ÿÿÿÿ
ÿ
ÿ
zProfessionInfo.__init__c                 C  r‘   r%   ©rQ  r>   r5   r5   r6   rG  	  r“   zProfessionInfo.naming_authorityrÉ  c                 C  r‘   r%   )rR  r>   r5   r5   r6   rI  	  r“   zProfessionInfo.profession_itemsúlist[ObjectIdentifier] | Nonec                 C  r‘   r%   )rS  r>   r5   r5   r6   rK   	  r“   zProfessionInfo.profession_oidsc                 C  r‘   r%   )rT  r>   r5   r5   r6   rM  $	  r“   z"ProfessionInfo.registration_numberc                 C  r‘   r%   )rU  r>   r5   r5   r6   rN  (	  r“   z"ProfessionInfo.add_profession_infor9   c                 C  s.   d| j › d| j› d| j› d| j› d| j›d�S )Nz!<ProfessionInfo(naming_authority=z, profession_items=z, profession_oids=z, registration_number=z, add_profession_info=ru   )rG  rI  rK  rM  rN  r>   r5   r5   r6   rv   ,	  s   
ÿþýüÿzProfessionInfo.__repr__rƒ   r„   r…   c                 C  sJ   t |tƒstS | j|jko$| j|jko$| j|jko$| j|jko$| j|jkS r%   )r&   rF  r‡   rG  rI  rK  rM  rN  rˆ   r5   r5   r6   r‰   5	  s   

ÿ
þ
ý
ûzProfessionInfo.__eq__r:   c                 C  s8   | j d urt| j ƒ}nd }t| jt| jƒ|| j| jfƒS r%   )rK  r»   r�   rG  rI  rM  rN  )r?   rK  r5   r5   r6   rŽ   A	  s   
ûÿzProfessionInfo.__hash__N)rG  rH  rI  rJ  rK  rL  rM  rS  rN  rŸ   r#   rM   ©r#   rH  )r#   rÉ  )r#   rW  rX  r¿   rw   r™   rG   )rX   rY   rZ   rQ   r›   rG  rI  rK  rM  rN  rv   r‰   rŽ   r5   r5   r5   r6   rF  ê  s    
-

	rF  c                   @  s^   e Zd Zdd	d
„Zeddd„ƒZed dd„ƒZed!dd„ƒZd"dd„Zd#dd„Z	d$dd„Z
dS )%Ú	AdmissionÚadmission_authorityúGeneralName | NonerG  rH  Úprofession_infosúIterable[ProfessionInfo]r#   rM   c                 C  sl   |d urt |tƒstdƒ‚|d urt |tƒstdƒ‚t|ƒ}tdd„ |D ƒƒs+tdƒ‚|| _|| _|| _d S )Nz)admission_authority must be a GeneralNamerO  c                 s  r¤   r%   )r&   rF  )r§   Úinfor5   r5   r6   r©   c	  rª   z%Admission.__init__.<locals>.<genexpr>z@Every item in the profession_infos list must be a ProfessionInfo)	r&   r   rq   r>  rf   r¬   Ú_admission_authorityrQ  Ú_profession_infos)r?   rZ  rG  r\  r5   r5   r6   rQ   R	  s$   
ÿ
ÿÿÿ
zAdmission.__init__c                 C  r‘   r%   )r_  r>   r5   r5   r6   rZ  o	  r“   zAdmission.admission_authorityc                 C  r‘   r%   rV  r>   r5   r5   r6   rG  s	  r“   zAdmission.naming_authorityúlist[ProfessionInfo]c                 C  r‘   r%   )r`  r>   r5   r5   r6   r\  w	  r“   zAdmission.profession_infosr9   c                 C  r¿  )Nz<Admission(admission_authority=z, naming_authority=z, profession_infos=ru   )rZ  rG  r\  r>   r5   r5   r6   rv   {	  r¹   zAdmission.__repr__rƒ   r„   r…   c                 C  rº   r%   )r&   rY  r‡   rZ  rG  r\  rˆ   r5   r5   r6   r‰   ‚	  rÁ  zAdmission.__eq__r:   c                 C  s   t | j| jt| jƒfƒS r%   )r�   rZ  rG  r»   r\  r>   r5   r5   r6   rŽ   Œ	  s   ýÿzAdmission.__hash__N)rZ  r[  rG  rH  r\  r]  r#   rM   ©r#   r[  rX  )r#   ra  rw   r™   rG   )rX   rY   rZ   rQ   r›   rZ  rG  r\  rv   r‰   rŽ   r5   r5   r5   r6   rY  Q	  s    



rY  c                   @  s`   e Zd ZejZddd„Zed	ƒ\ZZ	Z
edd
d„ƒZddd„Zddd„Zddd„Zd dd„ZdS )!Ú
AdmissionsÚ	authorityr[  Ú
admissionsúIterable[Admission]r#   rM   c                 C  sL   |d urt |tƒstdƒ‚t|ƒ}tdd„ |D ƒƒstdƒ‚|| _|| _d S )Nzauthority must be a GeneralNamec                 s  r¤   r%   )r&   rY  )r§   Ú	admissionr5   r5   r6   r©   ¢	  rª   z&Admissions.__init__.<locals>.<genexpr>zBEvery item in the contents_of_admissions list must be an Admission)r&   r   rq   rf   r¬   Ú
_authorityÚ_admissions)r?   rd  re  r5   r5   r6   rQ   ™	  s   ÿÿ
zAdmissions.__init__ri  c                 C  r‘   r%   )rh  r>   r5   r5   r6   rd  ¯	  r“   zAdmissions.authorityr9   c                 C  rä   )Nz<Admissions(authority=z, admissions=ru   )rh  ri  r>   r5   r5   r6   rv   ³	  rå   zAdmissions.__repr__rƒ   r„   r…   c                 C  ræ   r%   )r&   rc  r‡   rd  ri  rˆ   r5   r5   r6   r‰   ¹	  rç   zAdmissions.__eq__r:   c                 C  r^  r%   )r�   rd  r»   ri  r>   r5   r5   r6   rŽ   Â	  r_  zAdmissions.__hash__r$   c                 C  r”   r%   r•   r>   r5   r5   r6   r'   Å	  r�   zAdmissions.public_bytesN)rd  r[  re  rf  r#   rM   rb  rw   r™   rG   r_   )rX   rY   rZ   r   Ú
ADMISSIONSrL   rQ   rH   rx   ry   rz   r›   rd  rv   r‰   rŽ   r'   r5   r5   r5   r6   rc  –	  s    



	rc  c                   @  sZ   e Zd Zddd„Zedd	d
„ƒZeddd„ƒZddd„Zddd„Zd dd„Z	ddd„Z
dS )!rp   rL   r   rr   r$   r#   rM   c                 C  s"   t |tƒs	tdƒ‚|| _|| _d S )Nr9  )r&   r   rq   rº  r¼  )r?   rL   rr   r5   r5   r6   rQ   Ê	  s   

zUnrecognizedExtension.__init__c                 C  r‘   r%   r½  r>   r5   r5   r6   rL   Ð	  r“   zUnrecognizedExtension.oidc                 C  r‘   r%   r¾  r>   r5   r5   r6   rr   Ô	  r“   zUnrecognizedExtension.valuer9   c                 C  rW  )Nz<UnrecognizedExtension(oid=rÀ  ru   )rL   rr   r>   r5   r5   r6   rv   Ø	  s   zUnrecognizedExtension.__repr__rƒ   r„   r…   c                 C  ræ   r%   )r&   rp   r‡   rL   rr   rˆ   r5   r5   r6   r‰   Û	  rñ   zUnrecognizedExtension.__eq__r:   c                 C  rè   r%   )r�   rL   rr   r>   r5   r5   r6   rŽ   á	  ré   zUnrecognizedExtension.__hash__c                 C  r‘   r%   r}  r>   r5   r5   r6   r'   ä	  s   z"UnrecognizedExtension.public_bytesN)rL   r   rr   r$   r#   rM   rê   r_   rw   r™   rG   )rX   rY   rZ   rQ   r›   rL   rr   rv   r‰   rŽ   r'   r5   r5   r5   r6   rp   É	  s    



rp   )r"   r   r#   r$   )r8   r9   )tÚ
__future__r   Úabcrž  r0   r®  rç  Úcollections.abcr   r   Úcryptographyr   Ú"cryptography.hazmat.bindings._rustr   r   r–   Úcryptography.hazmat.primitivesr   r	   Ú,cryptography.hazmat.primitives.asymmetric.ecr
   Ú-cryptography.hazmat.primitives.asymmetric.rsar   Ú/cryptography.hazmat.primitives.asymmetric.typesr   r   Ú*cryptography.x509.certificate_transparencyr   Úcryptography.x509.general_namer   r   r   r   r   r   r   r   r   Úcryptography.x509.namer   r   Úcryptography.x509.oidr   r   r   r   ÚTypeVarr   r7   rH   Ú	ExceptionrJ   r]   ÚABCMetar   rb   r{   r�   r¶   rË   rÝ   rÐ   rì   rô   rö   r  rú   ÚEnumr  r(  r)  r*  r"  r+  r,  r-  r.  Ú_REASON_BIT_MAPPINGÚ_CRLREASONFLAGSr  r  Ú_CRL_ENTRY_REASON_ENUM_TO_CODEr9  r?  rB  rK  rT  ra  rh  rr  rt  rw  Ú_TLS_FEATURE_TYPE_TO_ENUMr€  r„  rš  r¢  ÚGenericr¸  rÃ  rê  rò  rô  rö  rû  r	  r  r  r"  r(  r5  r>  rF  rY  rc  rp   r5   r5   r5   r6   Ú<module>   sÎ   ,ÿ

%l$(.%%køøöA9+("  As0PHHH$)) (;:gE3