§
    ¡”jè>  ã                   óö  — d Z ddlmZmZmZmZ ddl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mZmZmZmZmZmZ  G d„ d	e¦  «        Z G d
„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z  G d„ de¦  «        Z! G d„ de¦  «        Z" G d„ de¦  «        Z# G d„ de¦  «        Z$ G d„ de¦  «        Z% G d„ de¦  «        Z& G d„ de¦  «        Z' G d „ d!e¦  «        Z(dS )"z¹
ASN.1 type classes for certificate revocation lists (CRL). Exports the
following items:

 - CertificateList()

Other type classes are defined that help compose the types listed above.
é    )Úunicode_literalsÚdivisionÚabsolute_importÚprint_functionNé   )ÚSignedDigestAlgorithm)	ÚBooleanÚ
EnumeratedÚGeneralizedTimeÚIntegerÚObjectIdentifierÚOctetBitStringÚParsableOctetStringÚSequenceÚ
SequenceOf)ÚAuthorityInfoAccessSyntaxÚAuthorityKeyIdentifierÚCRLDistributionPointsÚDistributionPointNameÚGeneralNamesÚNameÚReasonFlagsÚTimec                   ó   — e Zd ZddddœZdS )ÚVersionÚv1Úv2Úv3)r   r   é   N©Ú__name__Ú
__module__Ú__qualname__Ú_map© ó    ú]/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/asn1crypto/crl.pyr   r   +   s#   € € € € € àØØðð €D€D€Dr&   r   c            
       óf   — e Zd Zdedddœfdedddœfd	ed
ddœfdedddœfdedddœfdedddœfgZdS )ÚIssuingDistributionPointÚdistribution_pointr   T©ÚexplicitÚoptionalÚonly_contains_user_certsr   F)ÚimplicitÚdefaultÚonly_contains_ca_certsr   Úonly_some_reasonsé   )r/   r-   Úindirect_crlé   Úonly_contains_attribute_certsé   N)r!   r"   r#   r   r	   r   Ú_fieldsr%   r&   r'   r)   r)   3   sƒ   € € € € € à	Ð4À1ÐRVÐ6WÐ6WÐXØ	# W¸1ÈÐ.OÐ.OÐPØ	! 7¸ÀuÐ,MÐ,MÐNØ	˜k¸ÀtÐ+LÐ+LÐMØ	˜¨q¸UÐ"CÐ"CÐDØ	(¨'ÀÈeÐ3TÐ3TÐUð€G€G€Gr&   r)   c                   ó"   — e Zd ZddddddddœZd	S )
ÚTBSCertListExtensionIdÚissuer_alt_nameÚ
crl_numberÚdelta_crl_indicatorÚissuing_distribution_pointÚauthority_key_identifierÚfreshest_crlÚauthority_information_access)z	2.5.29.18z	2.5.29.20z	2.5.29.27z	2.5.29.28z	2.5.29.35z	2.5.29.46z1.3.6.1.5.5.7.1.1Nr    r%   r&   r'   r:   r:   >   s/   € € € € € à&Ø!Ø*Ø1Ø/Ø#Ø;ðð €D€D€Dr&   r:   c                   óB   — e Zd ZdefdeddifdefgZdZee	e	e
eeedœZdS )	ÚTBSCertListExtensionÚextn_idÚcriticalr0   FÚ
extn_value©rD   rF   )r;   r<   r=   r>   r?   r@   rA   N)r!   r"   r#   r:   r	   r   r8   Ú	_oid_pairr   r   r)   r   r   r   Ú
_oid_specsr%   r&   r'   rC   rC   J   s^   € € € € € à	Ð*Ð+Ø	�W˜y¨%Ð0Ð1Ø	Ð*Ð+ð€Gð *€Ià'ØØ&Ø&>Ø$:Ø-Ø(Aðð €J€J€Jr&   rC   c                   ó   — e Zd ZeZdS )ÚTBSCertListExtensionsN)r!   r"   r#   rC   Ú_child_specr%   r&   r'   rK   rK   ]   s   € € € € € Ø&€K€K€Kr&   rK   c                   ó>   — e Zd Zddddddddd	d
dœ
Zed„ ¦   «         ZdS )Ú	CRLReasonÚunspecifiedÚkey_compromiseÚca_compromiseÚaffiliation_changedÚ
supersededÚcessation_of_operationÚcertificate_holdÚremove_from_crlÚprivilege_withdrawnÚaa_compromise)
r   r   r   r3   r5   r7   é   é   é	   é
   c                 ó2   — ddddddddd	d
dœ
| j                  S )a  
        :return:
            A unicode string with revocation description that is suitable to
            show to end-users. Starts with a lower case letter and phrased in
            such a way that it makes sense after the phrase "because of" or
            "due to".
        zan unspecified reasonza compromised keyzthe CA being compromisedzan affiliation changezcertificate supersessionza cessation of operationza certificate holdzremoval from the CRLzprivilege withdrawlzthe AA being compromised)
rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   ©Únative©Úselfs    r'   Úhuman_friendlyzCRLReason.human_friendlyo   s=   € ð 3Ø1Ø7Ø#:Ø4Ø&@Ø 4Ø5Ø#8Ø7ð
ð 
ð Œ+ôð 	r&   N)r!   r"   r#   r$   Úpropertyrb   r%   r&   r'   rN   rN   a   sY   € € € € € àØØØ ØØ#ØØØ Øðð €Dð ðð ñ „Xðð ð r&   rN   c                   ó   — e Zd ZdddddœZdS )ÚCRLEntryExtensionIdÚ
crl_reasonÚhold_instruction_codeÚinvalidity_dateÚcertificate_issuer)z	2.5.29.21z	2.5.29.23z	2.5.29.24z	2.5.29.29Nr    r%   r&   r'   re   re   ‡   s&   € € € € € à!Ø,Ø&Ø)ð	ð €D€D€Dr&   re   c                   ó<   — e Zd ZdefdeddifdefgZdZee	e
edœZdS )	ÚCRLEntryExtensionrD   rE   r0   FrF   rG   )rf   rg   rh   ri   N)r!   r"   r#   re   r	   r   r8   rH   rN   r   r   r   rI   r%   r&   r'   rk   rk   �   sU   € € € € € à	Ð'Ð(Ø	�W˜y¨%Ð0Ð1Ø	Ð*Ð+ð€Gð *€IàØ!1Ø*Ø*ð	ð €J€J€Jr&   rk   c                   ó   — e Zd ZeZdS )ÚCRLEntryExtensionsN)r!   r"   r#   rk   rL   r%   r&   r'   rm   rm       s   € € € € € Ø#€K€K€Kr&   rm   c                   ó¶   — e Zd ZdefdefdeddifgZdZdZdZ	dZ
dZdZd„ Zed	„ ¦   «         Zed
„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         ZdS )ÚRevokedCertificateÚuser_certificateÚrevocation_dateÚcrl_entry_extensionsr-   TFNc                 ó  — t          ¦   «         | _        | d         D ]g}|d         j        }d|z  }t          | |¦  «        rt	          | ||d         j        ¦  «         |d         j        r| j                             |¦  «         Œhd| _        dS )úv
        Sets common named extensions to private attributes and creates a list
        of critical extensions
        rr   rD   ú	_%s_valuerF   rE   TN©ÚsetÚ_critical_extensionsr_   ÚhasattrÚsetattrÚparsedÚaddÚ_processed_extensions©ra   Ú	extensionÚnameÚattribute_names       r'   Ú_set_extensionsz"RevokedCertificate._set_extensions²   sŸ   € õ %(¡E¤EˆÔ!àÐ4Ô5ð 	4ð 	4ˆIØ˜YÔ'Ô.ˆDØ(¨4Ñ/ˆNÝ�t˜^Ñ,Ô,ð NÝ˜˜n¨i¸Ô.EÔ.LÑMÔMÐMØ˜Ô$Ô+ð 4ØÔ)×-Ò-¨dÑ3Ô3Ð3øà%)ˆÔ"Ð"Ð"r&   c                 óF   — | j         s|                      ¦   «          | j        S ©z²
        Returns a set of the names (or OID if not a known extension) of the
        extensions marked as critical

        :return:
            A set of unicode strings
        ©r}   r‚   rx   r`   s    r'   Úcritical_extensionsz&RevokedCertificate.critical_extensionsÄ   ó*   € ð Ô)ð 	#Ø× Ò Ñ"Ô"Ð"ØÔ(Ð(r&   c                 óJ   — | j         du r|                      ¦   «          | j        S )zŽ
        This extension indicates the reason that a certificate was revoked.

        :return:
            None or a CRLReason object
        F)r}   r‚   Ú_crl_reason_valuer`   s    r'   Úcrl_reason_valuez#RevokedCertificate.crl_reason_valueÒ   s-   € ð Ô%¨Ð.Ð.Ø× Ò Ñ"Ô"Ð"ØÔ%Ð%r&   c                 óJ   — | j         du r|                      ¦   «          | j        S )a=  
        This extension indicates the suspected date/time the private key was
        compromised or the certificate became invalid. This would usually be
        before the revocation date, which is when the CA processed the
        revocation.

        :return:
            None or a GeneralizedTime object
        F)r}   r‚   Ú_invalidity_date_valuer`   s    r'   Úinvalidity_date_valuez(RevokedCertificate.invalidity_date_valueß   s-   € ð Ô%¨Ð.Ð.Ø× Ò Ñ"Ô"Ð"ØÔ*Ð*r&   c                 óJ   — | j         du r|                      ¦   «          | j        S )a  
        This extension indicates the issuer of the certificate in question,
        and is used in indirect CRLs. CRL entries without this extension are
        for certificates issued from the last seen issuer.

        :return:
            None or an x509.GeneralNames object
        F)r}   r‚   Ú_certificate_issuer_valuer`   s    r'   Úcertificate_issuer_valuez+RevokedCertificate.certificate_issuer_valueï   s-   € ð Ô%¨Ð.Ð.Ø× Ò Ñ"Ô"Ð"ØÔ-Ð-r&   c                 ó„   — | j         du r1d| _         | j        r#| j        D ]}|j        dk    r|j        | _          nŒ| j         S )zi
        :return:
            None, or an asn1crypto.x509.Name object for the issuer of the cert
        FNÚdirectory_name)Ú_issuer_namer�   r€   Úchosen)ra   Úgeneral_names     r'   Úissuer_namezRevokedCertificate.issuer_nameþ   sf   € ð Ô Ð%Ð%Ø $ˆDÔØÔ,ð Ø$(Ô$Að ð �LØ#Ô(Ð,<Ò<Ð<Ø,8Ô,?˜Ô)Ø˜ð =ð Ô Ð r&   )r!   r"   r#   r   r   rm   r8   r}   rx   r‰   rŒ   r�   r“   r‚   rc   r†   rŠ   r�   r�   r–   r%   r&   r'   ro   ro   ¤   sö   € € € € € à	˜WÐ%Ø	˜DÐ!Ø	Ð!3°jÀ$Ð5GÐHð€Gð "ÐØÐØÐØ!ÐØ $ÐØ€Lð*ð *ð *ð$ ð)ð )ñ „Xð)ð ð
&ð 
&ñ „Xð
&ð ð+ð +ñ „Xð+ð ð.ð .ñ „Xð.ð ð!ð !ñ „Xð!ð !ð !r&   ro   c                   ó   — e Zd ZeZdS )ÚRevokedCertificatesN)r!   r"   r#   ro   rL   r%   r&   r'   r˜   r˜     s   € € € € € Ø$€K€K€Kr&   r˜   c                   óV   — e Zd Zdeddifdefdefdefdeddifdeddifd	ed
ddœfgZ	dS )ÚTbsCertListÚversionr-   TÚ	signatureÚissuerÚthis_updateÚnext_updateÚrevoked_certificatesÚcrl_extensionsr   r+   N)
r!   r"   r#   r   r   r   r   r˜   rK   r8   r%   r&   r'   rš   rš     so   € € € € € à	�G˜j¨$Ð/Ð0Ø	Ð+Ð,Ø	�4ÐØ	˜ÐØ	˜˜z¨4Ð0Ð1Ø	Ð!4°zÀ4Ð6HÐIØ	Ð0¸qÈdÐ2SÐ2SÐTð€G€G€Gr&   rš   c                   ó¨  — e Zd ZdefdefdefgZdZdZdZ	dZ
dZdZdZdZdZdZdZdZdZd„ Zed„ ¦   «         Zed„ ¦   «         Zed	„ ¦   «         Zed
„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Z ed„ ¦   «         Z!ed„ ¦   «         Z"ed„ ¦   «         Z#ed„ ¦   «         Z$dS )ÚCertificateListÚtbs_cert_listÚsignature_algorithmrœ   FNc                 ó&  — t          ¦   «         | _        | d         d         D ]g}|d         j        }d|z  }t          | |¦  «        rt	          | ||d         j        ¦  «         |d         j        r| j                             |¦  «         Œhd| _        dS )	rt   r¤   r¡   rD   ru   rF   rE   TNrv   r~   s       r'   r‚   zCertificateList._set_extensions4  s¤   € õ %(¡E¤EˆÔ!à˜oÔ.Ð/?Ô@ð 	4ð 	4ˆIØ˜YÔ'Ô.ˆDØ(¨4Ñ/ˆNÝ�t˜^Ñ,Ô,ð NÝ˜˜n¨i¸Ô.EÔ.LÑMÔMÐMØ˜Ô$Ô+ð 4ØÔ)×-Ò-¨dÑ3Ô3Ð3øà%)ˆÔ"Ð"Ð"r&   c                 óF   — | j         s|                      ¦   «          | j        S r„   r…   r`   s    r'   r†   z#CertificateList.critical_extensionsF  r‡   r&   c                 óJ   — | j         du r|                      ¦   «          | j        S )z·
        This extension allows associating one or more alternative names with
        the issuer of the CRL.

        :return:
            None or an x509.GeneralNames object
        F)r}   r‚   Ú_issuer_alt_name_valuer`   s    r'   Úissuer_alt_name_valuez%CertificateList.issuer_alt_name_valueT  s-   € ð Ô%¨Ð.Ð.Ø× Ò Ñ"Ô"Ð"ØÔ*Ð*r&   c                 óJ   — | j         du r|                      ¦   «          | j        S )zÌ
        This extension adds a monotonically increasing number to the CRL and is
        used to distinguish different versions of the CRL.

        :return:
            None or an Integer object
        F)r}   r‚   Ú_crl_number_valuer`   s    r'   Úcrl_number_valuez CertificateList.crl_number_valueb  s-   € ð Ô%¨Ð.Ð.Ø× Ò Ñ"Ô"Ð"ØÔ%Ð%r&   c                 óJ   — | j         du r|                      ¦   «          | j        S )zÅ
        This extension indicates a CRL is a delta CRL, and contains the CRL
        number of the base CRL that it is a delta from.

        :return:
            None or an Integer object
        F)r}   r‚   Ú_delta_crl_indicator_valuer`   s    r'   Údelta_crl_indicator_valuez)CertificateList.delta_crl_indicator_valuep  s-   € ð Ô%¨Ð.Ð.Ø× Ò Ñ"Ô"Ð"ØÔ.Ð.r&   c                 óJ   — | j         du r|                      ¦   «          | j        S )zÌ
        This extension includes information about what types of revocations
        and certificates are part of the CRL.

        :return:
            None or an IssuingDistributionPoint object
        F)r}   r‚   Ú!_issuing_distribution_point_valuer`   s    r'   Ú issuing_distribution_point_valuez0CertificateList.issuing_distribution_point_value~  s-   € ð Ô%¨Ð.Ð.Ø× Ò Ñ"Ô"Ð"ØÔ5Ð5r&   c                 óJ   — | j         du r|                      ¦   «          | j        S )zÇ
        This extension helps in identifying the public key with which to
        validate the authenticity of the CRL.

        :return:
            None or an AuthorityKeyIdentifier object
        F)r}   r‚   Ú_authority_key_identifier_valuer`   s    r'   Úauthority_key_identifier_valuez.CertificateList.authority_key_identifier_valueŒ  s-   € ð Ô%¨Ð.Ð.Ø× Ò Ñ"Ô"Ð"ØÔ3Ð3r&   c                 óJ   — | j         du r|                      ¦   «          | j        S )z´
        This extension is used in complete CRLs to indicate where a delta CRL
        may be located.

        :return:
            None or a CRLDistributionPoints object
        F)r}   r‚   Ú_freshest_crl_valuer`   s    r'   Úfreshest_crl_valuez"CertificateList.freshest_crl_valueš  s-   € ð Ô%¨Ð.Ð.Ø× Ò Ñ"Ô"Ð"ØÔ'Ð'r&   c                 óJ   — | j         du r|                      ¦   «          | j        S )zÉ
        This extension is used to provide a URL with which to download the
        certificate used to sign this CRL.

        :return:
            None or an AuthorityInfoAccessSyntax object
        F)r}   r‚   Ú#_authority_information_access_valuer`   s    r'   Ú"authority_information_access_valuez2CertificateList.authority_information_access_value¨  s-   € ð Ô%¨Ð.Ð.Ø× Ò Ñ"Ô"Ð"ØÔ7Ð7r&   c                 ó   — | d         d         S )z_
        :return:
            An asn1crypto.x509.Name object for the issuer of the CRL
        r¤   r�   r%   r`   s    r'   r�   zCertificateList.issuer¶  s   € ð �OÔ$ XÔ.Ð.r&   c                 ó8   — | j         sdS | j         d         j        S )zŠ
        :return:
            None or a byte string of the key_identifier from the authority key
            identifier extension
        NÚkey_identifier)r¶   r_   r`   s    r'   r?   z(CertificateList.authority_key_identifier¿  s&   € ð Ô2ð 	Ø�4àÔ2Ð3CÔDÔKÐKr&   c                 ó  — | j         €~g | _         | j        rp| j        D ]h}|d         j        dk    rU|d         }|j        dk    rŒ'|j        }|                     ¦   «         dd…         dk    r| j                              |¦  «         Œi| j         S )	zì
        :return:
            A list of unicode strings that are URLs that should contain either
            an individual DER-encoded X.509 certificate, or a DER-encoded CMS
            message containing multiple certificates
        NÚaccess_methodÚ
ca_issuersÚaccess_locationÚuniform_resource_identifierr   é   zhttp://)Ú_issuer_cert_urlsr¼   r_   r€   ÚlowerÚappend)ra   ÚentryÚlocationÚurls       r'   Úissuer_cert_urlsz CertificateList.issuer_cert_urlsÌ  s¥   € ð Ô!Ð)Ø%'ˆDÔ"ØÔ6ð ?Ø!ÔDð ?ð ?�EØ˜_Ô-Ô4¸ÒDÐDØ#(Ð):Ô#;˜Ø#œ=Ð,IÒIÐIØ$Ø&œo˜ØŸ9š9™;œ; q¨ sÔ+¨yÒ8Ð8Ø Ô2×9Ò9¸#Ñ>Ô>Ð>øØÔ%Ð%r&   c                 óÔ   — | j         €[g | _         | j        �M| j        D ]E}|d         }|j        dk    rŒ|j        D ]'}|j        dk    r| j                              |¦  «         Œ(ŒF| j         S )z—
        Returns delta CRL URLs - only applies to complete CRLs

        :return:
            A list of zero or more DistributionPoint objects
        Nr*   Úname_relative_to_crl_issuerrÄ   )Ú_delta_crl_distribution_pointsr¹   r€   r”   rÈ   )ra   r*   Údistribution_point_namer•   s       r'   Údelta_crl_distribution_pointsz-CertificateList.delta_crl_distribution_pointsâ  sž   € ð Ô.Ð6Ø24ˆDÔ/àÔ&Ð2Ø*.Ô*Að [ð [Ð&Ø.@ÐAUÔ.VÐ+à.Ô3Ð7TÒTÐTØ à(?Ô(Fð [ð [˜Ø'Ô,Ð0MÒMÐMØ Ô?×FÒFÐGYÑZÔZÐZøð[ð Ô2Ð2r&   c                 ó   — | d         j         S )zE
        :return:
            A byte string of the signature
        rœ   r^   r`   s    r'   rœ   zCertificateList.signatureû  s   € ð �KÔ Ô'Ð'r&   c                 ó˜   — | j         €=t          j        |                      ¦   «         ¦  «                             ¦   «         | _         | j         S )zf
        :return:
            The SHA1 hash of the DER-encoded bytes of this certificate list
        )Ú_sha1ÚhashlibÚsha1ÚdumpÚdigestr`   s    r'   rÖ   zCertificateList.sha1  s9   € ð Œ:ÐÝ œ d§i¢i¡k¤kÑ2Ô2×9Ò9Ñ;Ô;ˆDŒJØŒzÐr&   c                 ó˜   — | j         €=t          j        |                      ¦   «         ¦  «                             ¦   «         | _         | j         S )zi
        :return:
            The SHA-256 hash of the DER-encoded bytes of this certificate list
        )Ú_sha256rÕ   Úsha256r×   rØ   r`   s    r'   rÛ   zCertificateList.sha256  s9   € ð Œ<ÐÝ"œ>¨$¯)ª)©+¬+Ñ6Ô6×=Ò=Ñ?Ô?ˆDŒLØŒ|Ðr&   )%r!   r"   r#   rš   r   r   r8   r}   rx   r©   r¬   r¯   r²   rµ   r¸   r»   rÆ   rÏ   rÔ   rÚ   r‚   rc   r†   rª   r­   r°   r³   r¶   r¹   r¼   r�   r?   rÌ   rÑ   rœ   rÖ   rÛ   r%   r&   r'   r£   r£     s)  € € € € € à	˜+Ð&Ø	Ð 5Ð6Ø	�nÐ%ð€Gð "ÐØÐØ!ÐØÐØ!%ÐØ(,Ð%Ø&*Ð#ØÐØ*.Ð'ØÐØ%)Ð"Ø€EØ€Gð*ð *ð *ð$ ð)ð )ñ „Xð)ð ð+ð +ñ „Xð+ð ð&ð &ñ „Xð&ð ð/ð /ñ „Xð/ð ð6ð 6ñ „Xð6ð ð4ð 4ñ „Xð4ð ð(ð (ñ „Xð(ð ð8ð 8ñ „Xð8ð ð/ð /ñ „Xð/ð ð
Lð 
Lñ „Xð
Lð ð&ð &ñ „Xð&ð* ð3ð 3ñ „Xð3ð0 ð(ð (ñ „Xð(ð ðð ñ „Xðð ðð ñ „Xðð ð r&   r£   ))Ú__doc__Ú
__future__r   r   r   r   rÕ   Úalgosr   Úcorer	   r
   r   r   r   r   r   r   r   Úx509r   r   r   r   r   r   r   r   r   r)   r:   rC   rK   rN   re   rk   rm   ro   r˜   rš   r£   r%   r&   r'   ú<module>rá      se  ððð ð SÐ RÐ RÐ RÐ RÐ RÐ RÐ RÐ RÐ RÐ RÐ Rà €€€à (Ð (Ð (Ð (Ð (Ð (ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ðð ð ð ð ˆgñ ô ð ðð ð ð ð ˜xñ ô ð ð	ð 	ð 	ð 	ð 	Ð-ñ 	ô 	ð 	ðð ð ð ð ˜8ñ ô ð ð&'ð 'ð 'ð 'ð '˜Jñ 'ô 'ð 'ð#ð #ð #ð #ð #�
ñ #ô #ð #ðLð ð ð ð Ð*ñ ô ð ðð ð ð ð ˜ñ ô ð ð $ð $ð $ð $ð $˜ñ $ô $ð $ðh!ð h!ð h!ð h!ð h!˜ñ h!ô h!ð h!ðV%ð %ð %ð %ð %˜*ñ %ô %ð %ð	ð 	ð 	ð 	ð 	�(ñ 	ô 	ð 	ðyð yð yð yð y�hñ yô yð yð yð yr&   