o
    vh                     @   s"  d Z ddlmZmZmZmZ ddlmZ ddl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mZmZmZmZmZ ddlmZ ddlmZm Z m!Z!m"Z" G d	d
 d
eZ#G dd deZ$G dd deZ%G dd deZ&G dd deZ'G dd deZ(G dd deZ)G dd deZ*G dd deZ+G dd deZ,G dd deZ-G dd  d eZ.G d!d" d"eZ/G d#d$ d$eZ0G d%d& d&eZ1G d'd( d(eZ2G d)d* d*eZ3G d+d, d,eZ4G d-d. d.eZ5G d/d0 d0eZ6G d1d2 d2eZ7G d3d4 d4eZ8G d5d6 d6eZ9G d7d8 d8eZ:G d9d: d:eZ;G d;d< d<eZ<G d=d> d>eZ=G d?d@ d@eZ>G dAdB dBeZ?G dCdD dDeZ@G dEdF dFeZAG dGdH dHeZBG dIdJ dJeZCG dKdL dLeZDe(ejEdM< e;ejEdN< e;ejEdN< dMejFdO< dNejFdP< dQe
jFdR< e@e	jEdQ< dSe
jFdT< eDe	jEdS< dUS )Va  
ASN.1 type classes for the time stamp protocol (TSP). Exports the following
items:

 - TimeStampReq()
 - TimeStampResp()

Also adds TimeStampedData() support to asn1crypto.cms.ContentInfo(),
TimeStampedData() and TSTInfo() support to
asn1crypto.cms.EncapsulatedContentInfo() and some oids and value parsers to
asn1crypto.cms.CMSAttribute().

Other type classes are defined that help compose the types listed above.
    )unicode_literalsdivisionabsolute_importprint_function   )DigestAlgorithm)CMSAttributeCMSAttributeTypeContentInfoContentTypeEncapsulatedContentInfo)Any	BitStringBooleanChoiceGeneralizedTime	IA5StringIntegerObjectIdentifierOctetStringSequence
SequenceOfSetOf
UTF8String)CertificateList)
AttributesCertificatePoliciesGeneralNameGeneralNamesc                   @      e Zd ZdddddddZdS )	Versionv0v1v2v3v4v5r   r               N__name__
__module____qualname___map r1   r1   L/var/www/html/hyperkenya/venv/lib/python3.10/site-packages/asn1crypto/tsp.pyr    8       
r    c                   @      e Zd ZdefdefgZdS )MessageImprinthash_algorithmhashed_messageN)r-   r.   r/   r   r   _fieldsr1   r1   r1   r2   r5   C       r5   c                   @   s8   e Zd ZdeddifdedddfdedddfgZd	S )
AccuracysecondsoptionalTmillisr   implicitr<   microsr   N)r-   r.   r/   r   r8   r1   r1   r1   r2   r:   J   s
    r:   c                   @   s(   e Zd ZdefdeddifdefgZdS )	Extensionextn_idcriticaldefaultF
extn_valueN)r-   r.   r/   r   r   r   r8   r1   r1   r1   r2   rA   R   s
    rA   c                   @      e Zd ZeZdS )
ExtensionsN)r-   r.   r/   rA   _child_specr1   r1   r1   r2   rG   Z       rG   c                   @   sn   e Zd Zdefde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ifde
dddfdedddfg
ZdS )TSTInfoversionpolicymessage_imprintserial_numbergen_timeaccuracyr<   TorderingrD   Fnoncetsar   )explicitr<   
extensionsr   r>   N)r-   r.   r/   r    r   r5   r   r   r:   r   r   rG   r8   r1   r1   r1   r2   rJ   ^   s    rJ   c                
   @   sN   e Zd Zdefdefdeddifdeddifdedd	ifd
edddfgZ	dS )TimeStampReqrK   rM   
req_policyr<   TrR   cert_reqrD   FrU   r   r>   N)
r-   r.   r/   r    r5   r   r   r   rG   r8   r1   r1   r1   r2   rV   m   s    rV   c                   @   r   )		PKIStatusgrantedgranted_with_mods	rejectionwaitingrevocation_warningrevocation_notificationr'   Nr,   r1   r1   r1   r2   rY   x   r3   rY   c                   @   rF   )PKIFreeTextN)r-   r.   r/   r   rH   r1   r1   r1   r2   r`      rI   r`   c                	   @   s"   e Zd Zddddddddd	Zd
S )PKIFailureInfobad_algbad_requestbad_data_formattime_not_availableunaccepted_policyunaccepted_extensionsadd_info_not_availablesystem_failure)r   r(   r+                  Nr,   r1   r1   r1   r2   ra      s    
ra   c                   @   s.   e Zd ZdefdeddifdeddifgZdS )PKIStatusInfostatusstatus_stringr<   T	fail_infoN)r-   r.   r/   rY   r`   ra   r8   r1   r1   r1   r2   ro      s
    ro   c                   @   r4   )TimeStampResprp   time_stamp_tokenN)r-   r.   r/   ro   r
   r8   r1   r1   r1   r2   rs      r9   rs   c                   @   s:   e Zd ZdefdeddifdeddifdeddifgZdS )MetaDatahash_protected	file_namer<   T
media_typeother_meta_dataN)r-   r.   r/   r   r   r   r   r8   r1   r1   r1   r2   ru      s    ru   c                   @   "   e Zd ZdefdeddifgZdS )TimeStampAndCRL
time_stampcrlr<   TN)r-   r.   r/   r   r   r8   r1   r1   r1   r2   r{          r{   c                   @   rF   )TimeStampTokenEvidenceN)r-   r.   r/   r{   rH   r1   r1   r1   r2   r      rI   r   c                   @   rF   )DigestAlgorithmsN)r-   r.   r/   r   rH   r1   r1   r1   r2   r      rI   r   c                   @   r4   )EncryptionInfoencryption_info_typeencryption_info_valueNr-   r.   r/   r   r   r8   r1   r1   r1   r2   r      r9   r   c                   @   rF   )PartialHashtreeN)r-   r.   r/   r   rH   r1   r1   r1   r2   r      rI   r   c                   @   rF   )PartialHashtreesN)r-   r.   r/   r   rH   r1   r1   r1   r2   r      rI   r   c                   @   s@   e Zd Zdedddfdedddfdedddfd	efgZd
S )ArchiveTimeStampdigest_algorithmr   Tr>   
attributesr   reduced_hashtreer(   r|   N)r-   r.   r/   r   r   r   r
   r8   r1   r1   r1   r2   r      s    r   c                   @   rF   )ArchiveTimeStampSequenceN)r-   r.   r/   r   rH   r1   r1   r1   r2   r      rI   r   c                   @   s>   e Zd Zdefdefdedddfdedddfd	efgZd
S )EvidenceRecordrK   digest_algorithmscrypto_infosr   Tr>   encryption_infor   archive_time_stamp_sequenceN)	r-   r.   r/   r    r   r   r   r   r8   r1   r1   r1   r2   r      s    r   c                   @   r4   )OtherEvidenceoe_typeoe_valueNr   r1   r1   r1   r2   r      r9   r   c                   @   s4   e Zd ZdeddifdeddifdeddifgZdS )	Evidencetst_evidencer?   r   ers_evidencer   other_evidencer(   N)r-   r.   r/   r   r   r   _alternativesr1   r1   r1   r2   r      s
    r   c                   @   s@   e Zd ZdefdeddifdeddifdeddifdefgZdS )	TimeStampedDatarK   data_urir<   T	meta_datacontenttemporal_evidenceN)	r-   r.   r/   r    r   ru   r   r   r8   r1   r1   r1   r2   r      s    r   c                   @   r4   )IssuerSerialissuerrN   N)r-   r.   r/   r   r   r8   r1   r1   r1   r2   r      r9   r   c                   @   rz   )	ESSCertID	cert_hashissuer_serialr<   TN)r-   r.   r/   r   r   r8   r1   r1   r1   r2   r     r~   r   c                   @   rF   )
ESSCertIDsN)r-   r.   r/   r   rH   r1   r1   r1   r2   r     rI   r   c                   @   rz   )SigningCertificatecertspoliciesr<   TN)r-   r.   r/   r   r   r8   r1   r1   r1   r2   r     r~   r   c                   @   rF   )SetOfSigningCertificatesN)r-   r.   r/   r   rH   r1   r1   r1   r2   r     rI   r   c                   @   s2   e Zd ZdedddiifdefdeddifgZd	S )
ESSCertIDv2r6   rD   	algorithmsha256r   r   r<   TN)r-   r.   r/   r   r   r   r8   r1   r1   r1   r2   r     s
    r   c                   @   rF   )ESSCertIDv2sN)r-   r.   r/   r   rH   r1   r1   r1   r2   r     rI   r   c                   @   rz   )SigningCertificateV2r   r   r<   TN)r-   r.   r/   r   r   r8   r1   r1   r1   r2   r   #  r~   r   c                   @   rF   )SetOfSigningCertificatesV2N)r-   r.   r/   r   rH   r1   r1   r1   r2   r   *  rI   r   tst_infotimestamped_dataz1.2.840.113549.1.9.16.1.4z1.2.840.113549.1.9.16.1.31signing_certificatez1.2.840.113549.1.9.16.2.12signing_certificate_v2z1.2.840.113549.1.9.16.2.47N)G__doc__
__future__r   r   r   r   algosr   cmsr   r	   r
   r   r   corer   r   r   r   r   r   r   r   r   r   r   r   r   r}   r   x509r   r   r   r   r    r5   r:   rA   rG   rJ   rV   rY   r`   ra   ro   rs   ru   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   
_oid_specsr0   r1   r1   r1   r2   <module>   sd   <		









