
    Ii>                        S r SSKJrJrJrJr  SSKrSSKJr  SSK	J
r
JrJrJrJrJrJrJrJr  SSKJrJrJrJrJrJrJrJr   " S S	\5      r " S
 S\5      r " S S\5      r " S S\5      r " S S\5      r  " S S\5      r! " S S\5      r" " S S\5      r# " S S\5      r$ " S S\5      r% " S S\5      r& " S S\5      r' " S  S!\5      r(g)"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                        \ rS rSrSSSS.rSrg)Version+   v1v2v3)r   r       N__name__
__module____qualname____firstlineno___map__static_attributes__r!       4/venv/lib/python3.13/site-packages/asn1crypto/crl.pyr   r   +   s    Dr)   r   c            
       l    \ rS rSrS\SSS.4S\SSS	.4S
\SSS	.4S\SSS.4S\SSS	.4S\SSS	.4/rSrg)IssuingDistributionPoint3   distribution_pointr   Texplicitoptionalonly_contains_user_certsr   F)implicitdefaultonly_contains_ca_certsr    only_some_reasons   )r3   r1   indirect_crl   only_contains_attribute_certs   r!   N)	r#   r$   r%   r&   r   r	   r   _fieldsr(   r!   r)   r*   r,   r,   3   se    	41RV6WX	#W1.OP	!7u,MN	kt+LM	qU"CD	('e3TUGr)   r,   c                   (    \ rS rSrSSSSSSSS	.rS
rg)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.1r!   Nr"   r!   r)   r*   r>   r>   >   s    &!*1/#;Dr)   r>   c                   H    \ rS rSrS\4S\SS04S\4/rSr\	\
\
\\\\S.rS	rg
)TBSCertListExtensionJ   extn_idcriticalr4   F
extn_valuerJ   rL   )r@   rA   rB   rC   rD   rE   rF   r!   N)r#   r$   r%   r&   r>   r	   r   r<   	_oid_pairr   r   r,   r   r   r   
_oid_specsr(   r!   r)   r*   rH   rH   J   sM    	*+	Wy%01	*+G *I'&&>$:-(AJr)   rH   c                       \ rS rSr\rSrg)TBSCertListExtensions]   r!   N)r#   r$   r%   r&   rH   _child_specr(   r!   r)   r*   rQ   rQ   ]   s    &Kr)   rQ   c                   >    \ rS rSrSSSSSSSS	S
SS.
r\S 5       rSrg)	CRLReasona   unspecifiedkey_compromiseca_compromiseaffiliation_changed
supersededcessation_of_operationcertificate_holdremove_from_crlprivilege_withdrawnaa_compromise)
r   r   r    r7   r9   r;         	   
   c                 6    SSSSSSSSS	S
S.
U R                      $ )z
: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)
rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   nativeselfs    r*   human_friendlyCRLReason.human_friendlyo   s:     317#:4&@ 45#87
 ++ 	r)   r!   N)r#   r$   r%   r&   r'   propertyrj   r(   r!   r)   r*   rU   rU   a   s;     # D  r)   rU   c                   "    \ rS rSrSSSSS.rSrg)	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.29r!   Nr"   r!   r)   r*   rn   rn      s    !,&)	Dr)   rn   c                   B    \ rS rSrS\4S\SS04S\4/rSr\	\
\\S.rS	rg
)CRLEntryExtension   rJ   rK   r4   FrL   rM   )rp   rq   rr   rs   r!   N)r#   r$   r%   r&   rn   r	   r   r<   rN   rU   r   r   r   rO   r(   r!   r)   r*   ru   ru      sD    	'(	Wy%01	*+G *I!1**	Jr)   ru   c                       \ rS rSr\rSrg)CRLEntryExtensions   r!   N)r#   r$   r%   r&   ru   rS   r(   r!   r)   r*   rx   rx      s    #Kr)   rx   c                       \ rS rSrS\4S\4S\SS04/rSrSr	Sr
SrSrSrS	 r\S
 5       r\S 5       r\S 5       r\S 5       r\S 5       rSrg)RevokedCertificate   user_certificaterevocation_datecrl_entry_extensionsr1   TFNc                 $   [        5       U l        U S    Hq  nUS   R                  nSU-  n[        X5      (       a  [	        XUS   R
                  5        US   R                  (       d  MV  U R                  R                  U5        Ms     SU l        g)^
Sets common named extensions to private attributes and creates a list
of critical extensions
r   rJ   	_%s_valuerL   rK   TNset_critical_extensionsrg   hasattrsetattrparsedadd_processed_extensionsri   	extensionnameattribute_names       r*   _set_extensions"RevokedCertificate._set_extensions   s     %(E!45IY'..D(4/Nt,,i.E.L.LM$+++))--d3 6 &*"r)   c                 \    U R                   (       d  U R                  5         U R                  $ 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   r   rh   s    r*   critical_extensions&RevokedCertificate.critical_extensions   %     ))  "(((r)   c                 X    U R                   SL a  U R                  5         U R                  $ )zn
This extension indicates the reason that a certificate was revoked.

:return:
    None or a CRLReason object
F)r   r   _crl_reason_valuerh   s    r*   crl_reason_value#RevokedCertificate.crl_reason_value   s*     %%.  "%%%r)   c                 X    U R                   SL a  U R                  5         U R                  $ )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_valuerh   s    r*   invalidity_date_value(RevokedCertificate.invalidity_date_value   s*     %%.  "***r)   c                 X    U R                   SL a  U R                  5         U R                  $ )z
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_valuerh   s    r*   certificate_issuer_value+RevokedCertificate.certificate_issuer_value   s*     %%.  "---r)   c                     U R                   SL aY  SU l         U R                  (       aA  U R                   H1  nUR                  S:X  d  M  UR                  U l           U R                   $    U R                   $ )zQ
:return:
    None, or an asn1crypto.x509.Name object for the issuer of the cert
FNdirectory_name)_issuer_namer   r   chosen)ri   general_names     r*   issuer_nameRevokedCertificate.issuer_name   sn     % $D,,$($A$AL#((,<<,8,?,?)   	 %B    r)   )r   r   r   )r#   r$   r%   r&   r   r   rx   r<   r   r   r   r   r   r   r   rl   r   r   r   r   r   r(   r!   r)   r*   r{   r{      s    	W%	D!	!3j$5GHG "! $L*$ ) ) 
& 
& + + . . ! !r)   r{   c                       \ rS rSr\rSrg)RevokedCertificatesi  r!   N)r#   r$   r%   r&   r{   rS   r(   r!   r)   r*   r   r     s    $Kr)   r   c                   \    \ rS rSrS\SS04S\4S\4S\4S\SS04S	\SS04S
\	SSS.4/r
Srg)TbsCertListi  versionr1   T	signatureissuerthis_updatenext_updaterevoked_certificatescrl_extensionsr   r/   r!   N)r#   r$   r%   r&   r   r   r   r   r   rQ   r<   r(   r!   r)   r*   r   r     s`    	Gj$/0	+,	4		z401	!4z46HI	0qd2STGr)   r   c                   T   \ rS rSrS\4S\4S\4/rSrSr	Sr
SrSrSrSrSrSrSrSrSrSrS r\S 5       r\S	 5       r\S
 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r \S 5       r!\S 5       r"\S 5       r#\S 5       r$\S 5       r%Sr&g)CertificateListi  tbs_cert_listsignature_algorithmr   FNc                 *   [        5       U l        U S   S    Hq  nUS   R                  nSU-  n[        X5      (       a  [	        XUS   R
                  5        US   R                  (       d  MV  U R                  R                  U5        Ms     SU l        g)	r   r   r   rJ   r   rL   rK   TNr   r   s       r*   r   CertificateList._set_extensions4  s     %(E!o./?@IY'..D(4/Nt,,i.E.L.LM$+++))--d3 A &*"r)   c                 \    U R                   (       d  U R                  5         U R                  $ r   r   rh   s    r*   r   #CertificateList.critical_extensionsF  r   r)   c                 X    U R                   SL a  U R                  5         U R                  $ )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_valuerh   s    r*   issuer_alt_name_value%CertificateList.issuer_alt_name_valueT  s*     %%.  "***r)   c                 X    U R                   SL a  U R                  5         U R                  $ )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_valuerh   s    r*   crl_number_value CertificateList.crl_number_valueb  s*     %%.  "%%%r)   c                 X    U R                   SL a  U R                  5         U R                  $ )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_valuerh   s    r*   delta_crl_indicator_value)CertificateList.delta_crl_indicator_valuep  s*     %%.  "...r)   c                 X    U R                   SL a  U R                  5         U R                  $ )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_valuerh   s    r*    issuing_distribution_point_value0CertificateList.issuing_distribution_point_value~  s*     %%.  "555r)   c                 X    U R                   SL a  U R                  5         U R                  $ )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_valuerh   s    r*   authority_key_identifier_value.CertificateList.authority_key_identifier_value  s*     %%.  "333r)   c                 X    U R                   SL a  U R                  5         U R                  $ )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_valuerh   s    r*   freshest_crl_value"CertificateList.freshest_crl_value  s*     %%.  "'''r)   c                 X    U R                   SL a  U R                  5         U R                  $ )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_valuerh   s    r*   "authority_information_access_value2CertificateList.authority_information_access_value  s*     %%.  "777r)   c                     U S   S   $ )zG
:return:
    An asn1crypto.x509.Name object for the issuer of the CRL
r   r   r!   rh   s    r*   r   CertificateList.issuer  s     O$X..r)   c                 X    U R                   (       d  gU R                   S   R                  $ )zj
:return:
    None or a byte string of the key_identifier from the authority key
    identifier extension
Nkey_identifier)r   rg   rh   s    r*   rD   (CertificateList.authority_key_identifier  s(     22223CDKKKr)   c                 b   U R                   c  / U l         U R                  (       a  U R                   Ho  nUS   R                  S:X  d  M  US   nUR                  S:w  a  M/  UR                  nUR	                  5       SS S:X  d  MT  U R                   R                  U5        Mq     U R                   $ )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
access_method
ca_issuersaccess_locationuniform_resource_identifierr      zhttp://)_issuer_cert_urlsr   rg   r   lowerappend)ri   entrylocationurls       r*   issuer_cert_urls CertificateList.issuer_cert_urls  s     !!)%'D"66!DDE_-44D#():#;#==,II$&oo99;q+y8 2299#> E %%%r)   c                 0   U R                   c~  / U l         U R                  bj  U R                   HZ  nUS   nUR                  S:X  a  M  UR                   H0  nUR                  S:X  d  M  U R                   R	                  U5        M2     M\     U R                   $ )zw
Returns delta CRL URLs - only applies to complete CRLs

:return:
    A list of zero or more DistributionPoint objects
r.   name_relative_to_crl_issuerr   )_delta_crl_distribution_pointsr   r   r   r   )ri   r.   distribution_point_namer   s       r*   delta_crl_distribution_points-CertificateList.delta_crl_distribution_points  s     ..624D/&&2*.*A*A&.@AU.V+.337TT (?(F(F',,0MM ??FFGYZ )G +B 222r)   c                      U S   R                   $ )z-
:return:
    A byte string of the signature
r   rf   rh   s    r*   r   CertificateList.signature  s     K '''r)   c                     U R                   c7  [        R                  " U R                  5       5      R	                  5       U l         U R                   $ )zN
:return:
    The SHA1 hash of the DER-encoded bytes of this certificate list
)_sha1hashlibsha1dumpdigestrh   s    r*   r   CertificateList.sha1  s7     :: diik299;DJzzr)   c                     U R                   c7  [        R                  " U R                  5       5      R	                  5       U l         U R                   $ )zQ
:return:
    The SHA-256 hash of the DER-encoded bytes of this certificate list
)_sha256r   sha256r   r   rh   s    r*   r   CertificateList.sha256  s7     <<">>$))+6==?DL||r)   )r   r   r   r   r   r   )'r#   r$   r%   r&   r   r   r   r<   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rl   r   r   r   r   r   r   r   r   r   rD   r   r   r   r   r   r(   r!   r)   r*   r   r     s   	+&	 56	n%G "!!%(,%&*#*.'%)"EG*$ ) ) + + & & / / 6 6 4 4 ( ( 8 8 / / 
L 
L & &* 3 30 ( (    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>   rH   rQ   rU   rn   ru   rx   r{   r   r   r   r!   r)   r*   <module>r     s    S R  (
 
 
	 	 	g x 	- 	8 &'J '#
 #L*   $ $h! h!V%* %	( 	yh yr)   