o
    Œõ±j€l  ã                   @   s¤  d Z ddlmZmZmZmZ zddlZW n ey   dZY nw ddl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mZmZmZmZmZ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)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ƒ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d„ deƒZ6G dd„ deƒZ7G dd „ d eƒZ8G d!d"„ d"eƒZ9G 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/d0„ d0eƒZ@G d1d2„ d2eƒZAG d3d4„ d4eƒZBG d5d6„ d6eƒZCG d7d8„ d8eƒZDG d9d:„ d:eƒZEG d;d<„ d<eƒZFG d=d>„ d>eƒZGG d?d@„ d@eƒZHG dAdB„ dBeƒZIG dCdD„ dDeƒZJG dEdF„ dFeƒZKG dGdH„ dHeƒZLG dIdJ„ dJeƒZMG dKdL„ dLeƒZNG dMdN„ dNeƒZOG dOdP„ dPeƒZPG dQdR„ dReƒZQG dSdT„ dTeƒZRG dUdV„ dVeƒZSG dWdX„ dXeƒZTG dYdZ„ dZeƒZUG d[d\„ d\eƒZVG d]d^„ d^eƒZWG d_d`„ d`eƒZXG dadb„ dbeƒZYG dcdd„ ddeƒZZG dedf„ dfeƒZ[G dgdh„ dheƒZ\G didj„ djeƒZ]G dkdl„ dleƒZ^G dmdn„ dneƒZ_G dodp„ dpeƒZ`G dqdr„ dreƒZaG dsdt„ dteƒZbG dudv„ dveƒZcG dwdx„ dxeƒZdG dydz„ dzeƒZeG d{d|„ d|eƒZfG d}d~„ d~eƒZgG dd€„ d€eƒZhG d�d‚„ d‚eƒZiG dƒd„„ d„eƒZjG d…d†„ d†eƒZkG d‡dˆ„ dˆeƒZlG d‰dŠ„ dŠeƒZmG d‹dŒ„ dŒeƒZnG d�dŽ„ dŽeƒZoG d�d�„ d�eƒZpG d‘d’„ d’eƒZqG d“d”„ d”eƒZrG d•d–„ d–eƒZsG d—d˜„ d˜eƒZtG d™dš„ dše	eƒZuG d›dœ„ dœeƒZvG d�dž„ džeƒZwG dŸd „ d eƒZxG d¡d¢„ d¢eƒZyG d£d¤„ d¤eƒZzG 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ƒ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ƒZyG 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’eeqe…e†e‡eˆe‰e�eŠdÖœ	ec_“eqe…e†e‡eˆe‰e�eŠd×œee_“e5e6e7epede9edede�e’dØœ
e:_“dS )Ùaë  
ASN.1 type classes for cryptographic message syntax (CMS). Structures are also
compatible with PKCS#7. Exports the following items:

 - AuthenticatedData()
 - AuthEnvelopedData()
 - CompressedData()
 - ContentInfo()
 - DigestedData()
 - EncryptedData()
 - EnvelopedData()
 - SignedAndEnvelopedData()
 - SignedData()

Other type classes are defined that help compose the types listed above.

Most CMS structures in the wild are formatted as ContentInfo encapsulating one of the other types.
é    )Úunicode_literalsÚdivisionÚabsolute_importÚprint_functionNé   )Ú_ForceNullParametersÚDigestAlgorithmÚEncryptionAlgorithmÚEncryptionAlgorithmIdÚHmacAlgorithmÚKdfAlgorithmÚRSAESOAEPParamsÚSignedDigestAlgorithm)ÚAnyÚ	BitStringÚChoiceÚ
EnumeratedÚGeneralizedTimeÚIntegerÚObjectIdentifierÚOctetBitStringÚOctetStringÚParsableOctetStringÚSequenceÚ
SequenceOfÚSetOfÚUTCTimeÚ
UTF8String)ÚCertificateList)ÚPublicKeyInfo)ÚOCSPResponse)Ú
AttributesÚCertificateÚ
ExtensionsÚGeneralNameÚGeneralNamesÚNamec                   @   ó"   e Zd ZdefdefdefgZdS )ÚExtendedCertificateInfoÚversionÚcertificateÚ
attributesN)Ú__name__Ú
__module__Ú__qualname__r   r"   r!   Ú_fields© r0   r0   ú�/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/asn1crypto/cms.pyr(   A   ó
    ýr(   c                   @   r'   )ÚExtendedCertificateÚextended_certificate_infoÚsignature_algorithmÚ	signatureN)r,   r-   r.   r(   r   r   r/   r0   r0   r0   r1   r3   I   r2   r3   c                   @   ó   e Zd ZdddddddœZdS )	Ú
CMSVersionÚv0Úv1Úv2Úv3Úv4Úv5©r   r   é   é   é   é   N©r,   r-   r.   Ú_mapr0   r0   r0   r1   r8   W   ó    
úr8   c                   @   s&   e Zd Zddddddddd	d
dœ
ZdS )ÚCMSAttributeTypeÚcontent_typeÚmessage_digestÚsigning_timeÚcounter_signatureÚsmime_capabilitiesÚencrypt_key_prefÚsignature_time_stamp_tokenÚcms_algorithm_protectionÚmicrosoft_nested_signatureÚmicrosoft_time_stamp_token)
z1.2.840.113549.1.9.3z1.2.840.113549.1.9.4z1.2.840.113549.1.9.5z1.2.840.113549.1.9.6z1.2.840.113549.1.9.15z1.2.840.113549.1.9.16.2.11z1.2.840.113549.1.9.16.2.14z1.2.840.113549.1.9.52z1.3.6.1.4.1.311.2.4.1z1.3.6.1.4.1.311.3.3.1NrD   r0   r0   r0   r1   rG   b   s    
ìrG   c                   @   ó   e Zd ZdefdefgZdS )ÚTimeÚutc_timeÚgeneralized_timeN)r,   r-   r.   r   r   Ú_alternativesr0   r0   r0   r1   rS   {   ó    þrS   c                
   @   s$   e Zd Zddddddddd	d
œ	ZdS )ÚContentTypeÚdataÚsigned_dataÚenveloped_dataÚsigned_and_enveloped_dataÚdigested_dataÚencrypted_dataÚauthenticated_dataÚcompressed_dataÚauthenticated_enveloped_data)	z1.2.840.113549.1.7.1z1.2.840.113549.1.7.2z1.2.840.113549.1.7.3z1.2.840.113549.1.7.4z1.2.840.113549.1.7.5z1.2.840.113549.1.7.6z1.2.840.113549.1.9.16.1.2z1.2.840.113549.1.9.16.1.9z1.2.840.113549.1.9.16.1.23NrD   r0   r0   r0   r1   rX   ‚   s    
÷rX   c                   @   s2   e Zd ZdefdedddœfdedddœfgZdS )	ÚCMSAlgorithmProtectionÚdigest_algorithmr5   r   T©ÚimplicitÚoptionalÚmac_algorithmr@   N)r,   r-   r.   r   r   r   r/   r0   r0   r0   r1   rb   �   s
    ýrb   c                   @   ó   e Zd ZeZdS )ÚSetOfContentTypeN)r,   r-   r.   rX   Ú_child_specr0   r0   r0   r1   ri   ˜   ó    ri   c                   @   rh   )ÚSetOfOctetStringN)r,   r-   r.   r   rj   r0   r0   r0   r1   rl   œ   rk   rl   c                   @   rh   )Ú	SetOfTimeN)r,   r-   r.   rS   rj   r0   r0   r0   r1   rm       rk   rm   c                   @   rh   )ÚSetOfAnyN)r,   r-   r.   r   rj   r0   r0   r0   r1   rn   ¤   rk   rn   c                   @   rh   )ÚSetOfCMSAlgorithmProtectionN)r,   r-   r.   rb   rj   r0   r0   r0   r1   ro   ¨   rk   ro   c                   @   s,   e Zd ZdefdgZi Zdd„ ZdeiZdS )ÚCMSAttributeÚtype©ÚvaluesNc                 C   ó   | j  | d jt¡S ©Nrq   ©Ú
_oid_specsÚgetÚnativern   ©Úselfr0   r0   r1   Ú_values_spec´   ó   zCMSAttribute._values_specrs   N)r,   r-   r.   rG   r/   rw   r|   Ú_spec_callbacksr0   r0   r0   r1   rp   ¬   s    þÿrp   c                   @   rh   )ÚCMSAttributesN)r,   r-   r.   rp   rj   r0   r0   r0   r1   r   ¼   rk   r   c                   @   s(   e Zd ZdefdefdeddifgZdS )ÚIssuerSerialÚissuerÚserialÚ
issuer_uidrf   TN)r,   r-   r.   r%   r   r   r/   r0   r0   r0   r1   r€   À   ó
    ýr€   c                   @   ó   e Zd ZdddœZdS )ÚAttCertVersionr:   r;   )r   r   NrD   r0   r0   r0   r1   r†   È   ó    
þr†   c                   @   s(   e Zd ZdeddifdeddifgZdS )ÚAttCertSubjectÚbase_certificate_idÚexplicitr   Úsubject_namer   N)r,   r-   r.   r€   r%   rV   r0   r0   r0   r1   rˆ   Ï   ó    þrˆ   c                   @   s   e Zd ZdefdefgZdS )ÚAttCertValidityPeriodÚnot_before_timeÚnot_after_timeN)r,   r-   r.   r   r/   r0   r0   r0   r1   r�   Ö   rW   r�   c                   @   sX   e Zd Zdeddifdef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g	ZdS )ÚAttributeCertificateInfoV1r)   Údefaultr:   Úsubjectr�   r6   Úserial_numberÚatt_cert_validity_periodr+   Úissuer_unique_idrf   TÚ
extensionsN)r,   r-   r.   r†   rˆ   r%   r   r   r�   r!   r   r#   r/   r0   r0   r0   r1   r�   Ý   s    ÷r�   c                   @   r'   )ÚAttributeCertificateV1Úac_infor5   r6   N)r,   r-   r.   r�   r   r   r/   r0   r0   r0   r1   r—   ë   r2   r—   c                   @   s   e Zd ZddddœZdS )ÚDigestedObjectTypeÚ
public_keyÚpublic_key_certÚother_objy_types)r   r   r@   NrD   r0   r0   r0   r1   r™   ó   s
    
ýr™   c                   @   s.   e Zd ZdefdeddifdefdefgZdS )ÚObjectDigestInfoÚdigested_object_typeÚother_object_type_idrf   Trc   Úobject_digestN)r,   r-   r.   r™   r   r   r   r/   r0   r0   r0   r1   r�   û   s    ü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gZd	S )
ÚHolderr‰   r   Trd   Úentity_namer   Úobject_digest_infor@   N)r,   r-   r.   r€   r%   r�   r/   r0   r0   r0   r1   r¡     s
    ýr¡   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 )
ÚV2FormÚissuer_namerf   Tr‰   r   ©rŠ   rf   r£   r   N)r,   r-   r.   r%   r€   r�   r/   r0   r0   r0   r1   r¤     ó
    ýr¤   c                   @   ó"   e Zd ZdefdeddifgZdS )ÚAttCertIssuerÚv1_formÚv2_formre   r   N)r,   r-   r.   r%   r¤   rV   r0   r0   r0   r1   r©     ó    þr©   c                   @   r'   )ÚIetfAttrValueÚoctetsÚoidÚstringN)r,   r-   r.   r   r   r   rV   r0   r0   r0   r1   r­     r2   r­   c                   @   rh   )ÚIetfAttrValuesN)r,   r-   r.   r­   rj   r0   r0   r0   r1   r±   #  rk   r±   c                   @   s$   e Zd ZdedddœfdefgZdS )ÚIetfAttrSyntaxÚpolicy_authorityr   Trd   rs   N)r,   r-   r.   r%   r±   r/   r0   r0   r0   r1   r²   '  ó    þr²   c                   @   rh   )ÚSetOfIetfAttrSyntaxN)r,   r-   r.   r²   rj   r0   r0   r0   r1   rµ   .  rk   rµ   c                   @   s(   e Zd ZdefdefdeddifgZdS )ÚSvceAuthInfoÚserviceÚidentÚ	auth_inforf   TN)r,   r-   r.   r$   r   r/   r0   r0   r0   r1   r¶   2  r„   r¶   c                   @   rh   )ÚSetOfSvceAuthInfoN)r,   r-   r.   r¶   rj   r0   r0   r0   r1   rº   :  rk   rº   c                   @   s*   e Zd ZdedddœfdeddifgZdS )	Ú
RoleSyntaxÚrole_authorityr   Trd   Ú	role_namerŠ   r   N)r,   r-   r.   r%   r$   r/   r0   r0   r0   r1   r»   >  s    þr»   c                   @   rh   )ÚSetOfRoleSyntaxN)r,   r-   r.   r»   rj   r0   r0   r0   r1   r¾   E  rk   r¾   c                   @   r7   )	Ú	ClassListÚunmarkedÚunclassifiedÚ
restrictedÚconfidentialÚsecretÚ
top_secretr?   NrD   r0   r0   r0   r1   r¿   I  rF   r¿   c                   @   s(   e Zd ZdeddifdeddifgZdS )ÚSecurityCategoryrq   re   r   ÚvaluerŠ   r   N©r,   r-   r.   r   r   r/   r0   r0   r0   r1   rÆ   T  rŒ   rÆ   c                   @   rh   )ÚSetOfSecurityCategoryN)r,   r-   r.   rÆ   rj   r0   r0   r0   r1   rÉ   [  rk   rÉ   c                   @   s4   e Zd ZdefdededgƒifdeddifgZdS )	Ú	ClearanceÚ	policy_idÚ
class_listr‘   rÁ   Úsecurity_categoriesrf   TN)r,   r-   r.   r   r¿   ÚsetrÉ   r/   r0   r0   r0   r1   rÊ   _  s
    ýrÊ   c                   @   rh   )ÚSetOfClearanceN)r,   r-   r.   rÊ   rj   r0   r0   r0   r1   rÏ   g  rk   rÏ   c                   @   s(   e Zd ZdefdefdeddifgZdS )ÚBigTimeÚmajorÚfractional_secondsÚsignrf   TN)r,   r-   r.   r   r/   r0   r0   r0   r1   rÐ   k  r„   rÐ   c                   @   rR   )ÚLeapDataÚ	leap_timeÚactionN)r,   r-   r.   rÐ   r   r/   r0   r0   r0   r1   rÔ   s  rW   rÔ   c                   @   rh   )ÚSetOfLeapDataN)r,   r-   r.   rÔ   rj   r0   r0   r0   r1   r×   z  rk   r×   c                   @   s4   e Zd ZdefdefdefdefdeddifgZdS )	ÚTimingMetricsÚntp_timeÚoffsetÚdelayÚ
expirationÚ
leap_eventrf   TN)r,   r-   r.   rÐ   r×   r/   r0   r0   r0   r1   rØ   ~  s    ûrØ   c                   @   rh   )ÚSetOfTimingMetricsN)r,   r-   r.   rØ   rj   r0   r0   r0   r1   rÞ   ˆ  rk   rÞ   c                   @   s8   e Zd ZdedeifdedddœfdedddœfgZd	S )
ÚTimingPolicyrË   ÚspecÚ
max_offsetr   Tr¦   Ú	max_delayr   N)r,   r-   r.   r   r   rÐ   r/   r0   r0   r0   r1   rß   Œ  r§   rß   c                   @   rh   )ÚSetOfTimingPolicyN)r,   r-   r.   rß   rj   r0   r0   r0   r1   rã   ”  rk   rã   c                	   @   s"   e Zd Zddddddddd	œZd
S )ÚAttCertAttributeTypeÚauthentication_infoÚaccess_identityÚcharging_identityÚgroupÚroleÚ	clearanceÚtiming_metricsÚtiming_policy)z1.3.6.1.5.5.7.10.1z1.3.6.1.5.5.7.10.2z1.3.6.1.5.5.7.10.3z1.3.6.1.5.5.7.10.4z2.5.4.72z2.5.4.55z1.3.6.1.4.1.601.10.4.1z1.3.6.1.4.1.601.10.4.2NrD   r0   r0   r0   r1   rä   ˜  s    
ørä   c                	   @   s>   e Zd ZdefdgZeeeeeee	e
dœZdd„ ZdeiZdS )ÚAttCertAttributerq   rr   )rå   ræ   rç   rè   ré   rê   rë   rì   c                 C   rt   ru   rv   rz   r0   r0   r1   r|   ¶  r}   zAttCertAttribute._values_specrs   N)r,   r-   r.   rä   r/   rº   rµ   r¾   rÏ   rÞ   rã   rw   r|   r~   r0   r0   r0   r1   rí   ¥  s     þøÿrí   c                   @   rh   )ÚAttCertAttributesN)r,   r-   r.   rí   rj   r0   r0   r0   r1   rî   ¾  rk   rî   c                   @   sR   e Zd Zdefdef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g	ZdS )ÚAttributeCertificateInfoV2r)   Úholderr�   r6   r“   r”   r+   r•   rf   Tr–   N)r,   r-   r.   r†   r¡   r©   r   r   r�   rî   r   r#   r/   r0   r0   r0   r1   rï   Â  s    ÷rï   c                   @   s&   e Zd ZdZdefdefdefgZdS )ÚAttributeCertificateV2r   r˜   r5   r6   N)r,   r-   r.   Ú_bad_tagrï   r   r   r/   r0   r0   r0   r1   rñ   Ð  s    ýrñ   c                   @   rR   )ÚOtherCertificateFormatÚother_cert_formatÚ
other_certNrÈ   r0   r0   r0   r1   ró   Û  rW   ró   c                       sV   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dd
ifgZ‡ fdd„Z	‡  Z
S )ÚCertificateChoicesr*   Úextended_certificatere   r   Úv1_attr_certr   Úv2_attr_certr@   ÚotherrA   c                    sN   t t| ƒ |||¡ | jdkr#t t |¡d  ¡ ¡jdkr%d| _dS dS dS )aJ  
        Ensures that the class and tag specified exist as an alternative. This
        custom version fixes parsing broken encodings there a V2 attribute
        # certificate is encoded as a V1

        :param class_:
            The integer class_ from the encoded value header

        :param tag:
            The integer tag from the encoded value header

        :param contents:
            A byte string of the contents of the value - used when the object
            is explicitly tagged

        :raises:
            ValueError - when value is not a valid alternative
        r@   r   r;   rA   N)	Úsuperrö   ÚvalidateÚ_choicer†   Úloadr   Údumpry   )r{   Úclass_ÚtagÚcontents©Ú	__class__r0   r1   rü   ë  s   

þzCertificateChoices.validate)r,   r-   r.   r"   r3   r—   rñ   ró   rV   rü   Ú__classcell__r0   r0   r  r1   rö   â  s    ûrö   c                   @   rh   )ÚCertificateSetN)r,   r-   r.   rö   rj   r0   r0   r0   r1   r    rk   r  c                   @   ó,   e Zd ZdefdedddœfgZdZi ZdS )ÚContentInforH   Úcontentr   Tr¦   ©rH   r	  N)r,   r-   r.   rX   r   r/   Ú	_oid_pairrw   r0   r0   r0   r1   r  	  ó    þr  c                   @   rh   )ÚSetOfContentInfoN)r,   r-   r.   r  rj   r0   r0   r0   r1   r    rk   r  c                   @   r  )ÚEncapsulatedContentInforH   r	  r   Tr¦   r
  N)r,   r-   r.   rX   r   r/   r  rw   r0   r0   r0   r1   r    r  r  c                   @   rR   )ÚIssuerAndSerialNumberr�   r“   N)r,   r-   r.   r&   r   r/   r0   r0   r0   r1   r  !  rW   r  c                   @   r¨   )ÚSignerIdentifierÚissuer_and_serial_numberÚsubject_key_identifierre   r   N©r,   r-   r.   r  r   rV   r0   r0   r0   r1   r  (  r¬   r  c                   @   rh   )ÚDigestAlgorithmsN)r,   r-   r.   r   rj   r0   r0   r0   r1   r  /  rk   r  c                   @   rh   )ÚCertificateRevocationListsN)r,   r-   r.   r   rj   r0   r0   r0   r1   r  3  rk   r  c                   @   s$   e Zd ZdedddœfdefgZdS )Ú
SCVPReqResÚrequestr   Tr¦   ÚresponseN)r,   r-   r.   r  r/   r0   r0   r0   r1   r  7  r´   r  c                   @   r…   )ÚOtherRevInfoFormatIdÚocsp_responseÚscvp)z1.3.6.1.5.5.7.16.2z1.3.6.1.5.5.7.16.4NrD   r0   r0   r0   r1   r  >  r‡   r  c                   @   s*   e Zd ZdefdefgZdZeedœZ	dS )ÚOtherRevocationInfoFormatÚother_rev_info_formatÚother_rev_info)r  r  )r  r  N)
r,   r-   r.   r  r   r/   r  r    r  rw   r0   r0   r0   r1   r  E  s    þ
þr  c                   @   r¨   )ÚRevocationInfoChoiceÚcrlrú   re   r   N)r,   r-   r.   r   r  rV   r0   r0   r0   r1   r  R  r¬   r  c                   @   rh   )ÚRevocationInfoChoicesN)r,   r-   r.   r  rj   r0   r0   r0   r1   r!  Y  rk   r!  c                   @   sJ   e Zd Zdefdefdefdedddœfdefd	efd
edddœfgZ	dS )Ú
SignerInfor)   Úsidrc   Úsigned_attrsr   Trd   r5   r6   Úunsigned_attrsr   N)
r,   r-   r.   r8   r  r   r   r   r   r/   r0   r0   r0   r1   r"  ]  s    ùr"  c                   @   rh   )ÚSignerInfosN)r,   r-   r.   r"  rj   r0   r0   r0   r1   r&  i  rk   r&  c                	   @   sP   e Zd Zdefdefddedddœfded	ddœfd
efgZdd„ Z	de	iZ
dS )Ú
SignedDatar)   Údigest_algorithms©Úencap_content_infoNÚcertificatesr   Trd   Úcrlsr   Úsigner_infosc                 C   ó   | d j dkr	tS tS ©Nr)   r:   ©ry   r  r  rz   r0   r0   r1   Ú_encap_content_info_specw  ó   z#SignedData._encap_content_info_specr*  N)r,   r-   r.   r8   r  r  r!  r&  r/   r1  r~   r0   r0   r0   r1   r'  m  s    ú	ÿr'  c                   @   s,   e Zd ZdedddœfdedddœfgZdS )ÚOriginatorInfoÚcertsr   Trd   r,  r   N)r,   r-   r.   r  r!  r/   r0   r0   r0   r1   r3  Š  s    þr3  c                   @   r¨   )ÚRecipientIdentifierr  r  re   r   Nr  r0   r0   r0   r1   r5  ‘  r¬   r5  c                
   @   s:   e Zd Zddddddddd	œZd
d
ddddddddœ	ZdS )ÚKeyEncryptionAlgorithmIdÚrsaes_pkcs1v15Ú
rsaes_oaepÚaes128_wrapÚaes128_wrap_padÚaes192_wrapÚaes192_wrap_padÚaes256_wrapÚaes256_wrap_pad)ú1.2.840.113549.1.1.1ú1.2.840.113549.1.1.7ú2.16.840.1.101.3.4.1.5ú2.16.840.1.101.3.4.1.8ú2.16.840.1.101.3.4.1.25ú2.16.840.1.101.3.4.1.28ú2.16.840.1.101.3.4.1.45ú2.16.840.1.101.3.4.1.48r?  r@  rA  rB  rC  rD  rE  rF  )	Úrsar7  r8  r9  r:  r;  r<  r=  r>  N)r,   r-   r.   rE   Ú_reverse_mapr0   r0   r0   r1   r6  ˜  s(    ø
÷r6  c                   @   s.   e Zd ZdefdeddifgZdZdeiZdS )ÚKeyEncryptionAlgorithmÚ	algorithmÚ
parametersrf   T)rJ  rK  r8  N)	r,   r-   r.   r6  r   r/   r  r   rw   r0   r0   r0   r1   rI  ±  s    þÿrI  c                   @   ó(   e Zd ZdefdefdefdefgZdS )ÚKeyTransRecipientInfor)   ÚridÚkey_encryption_algorithmÚencrypted_keyN)r,   r-   r.   r8   r5  rI  r   r/   r0   r0   r0   r1   rM  ½  ó    ürM  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 )ÚOriginatorIdentifierOrKeyr  r  re   r   Úoriginator_keyr   N)r,   r-   r.   r  r   r   rV   r0   r0   r0   r1   rR  Æ  ó
    ýrR  c                   @   rR   )ÚOtherKeyAttributeÚkey_attr_idÚkey_attrNrÈ   r0   r0   r0   r1   rU  Î  rW   rU  c                   @   ó.   e Zd ZdefdeddifdeddifgZdS )ÚRecipientKeyIdentifierr  Údaterf   Trú   N©r,   r-   r.   r   r   rU  r/   r0   r0   r0   r1   rY  Õ  rT  rY  c                   @   r¨   )ÚKeyAgreementRecipientIdentifierr  Úr_key_idre   r   N)r,   r-   r.   r  rY  rV   r0   r0   r0   r1   r\  Ý  r¬   r\  c                   @   rR   )ÚRecipientEncryptedKeyrN  rP  N)r,   r-   r.   r\  r   r/   r0   r0   r0   r1   r^  ä  rW   r^  c                   @   rh   )ÚRecipientEncryptedKeysN)r,   r-   r.   r^  rj   r0   r0   r0   r1   r_  ë  rk   r_  c                   @   s<   e Zd Zdefdeddifdedddœfd	efd
efgZdS )ÚKeyAgreeRecipientInfor)   Ú
originatorrŠ   r   Úukmr   Tr¦   rO  Úrecipient_encrypted_keysN)	r,   r-   r.   r8   rR  r   rI  r_  r/   r0   r0   r0   r1   r`  ï  s    ûr`  c                   @   rX  )ÚKEKIdentifierÚkey_identifierrZ  rf   Trú   Nr[  r0   r0   r0   r1   rd  ù  rT  rd  c                   @   rL  )ÚKEKRecipientInfor)   ÚkekidrO  rP  N)r,   r-   r.   r8   rd  rI  r   r/   r0   r0   r0   r1   rf    rQ  rf  c                   @   s0   e Zd ZdefdedddœfdefdefgZdS )	ÚPasswordRecipientInfor)   Úkey_derivation_algorithmr   Trd   rO  rP  N)r,   r-   r.   r8   r   rI  r   r/   r0   r0   r0   r1   rh  
  s    ürh  c                   @   rR   )ÚOtherRecipientInfoÚori_typeÚ	ori_valueNrÈ   r0   r0   r0   r1   rj    rW   rj  c                   @   sF   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dd
ifgZdS )ÚRecipientInfoÚktriÚkarire   r   Úkekrir@   ÚpwrirA   ÚorirB   N)	r,   r-   r.   rM  r`  rf  rh  rj  rV   r0   r0   r0   r1   rm    s    ûrm  c                   @   rh   )ÚRecipientInfosN)r,   r-   r.   rm  rj   r0   r0   r0   r1   rs  $  rk   rs  c                   @   ó*   e Zd ZdefdefdedddœfgZdS )ÚEncryptedContentInforH   Úcontent_encryption_algorithmÚencrypted_contentr   Trd   N)r,   r-   r.   rX   r	   r   r/   r0   r0   r0   r1   ru  (  ó
    ýru  c                	   @   s>   e Zd Zdefdedddœfdefdefded	ddœfgZd
S )ÚEnvelopedDatar)   Úoriginator_infor   Trd   Úrecipient_infosÚencrypted_content_infoÚunprotected_attrsr   N)	r,   r-   r.   r8   r3  rs  ru  r   r/   r0   r0   r0   r1   ry  0  s    ûry  c                
   @   sJ   e Zd Zdefdef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 )ÚSignedAndEnvelopedDatar)   r{  r(  r|  r+  r   Trd   r,  r   r-  N)r,   r-   r.   r8   rs  r  ru  r  r  r&  r/   r0   r0   r0   r1   r~  :  s    ùr~  c                   @   s4   e Zd ZdefdefddefgZdd„ ZdeiZdS )	ÚDigestedDatar)   rc   r)  Údigestc                 C   r.  r/  r0  rz   r0   r0   r1   r1  N  r2  z%DigestedData._encap_content_info_specr*  N)	r,   r-   r.   r8   r   r   r/   r1  r~   r0   r0   r0   r1   r  F  s    üÿr  c                   @   rt  )ÚEncryptedDatar)   r|  r}  r   Trd   N)r,   r-   r.   r8   ru  r   r/   r0   r0   r0   r1   r�  a  rx  r�  c                   @   sf   e Zd Zdefdedddœfdefdefded	ddœfd
efde	dddœfde
fde	dddœfg	ZdS )ÚAuthenticatedDatar)   rz  r   Trd   r{  rg   rc   r   r*  Ú
auth_attrsr@   ÚmacÚunauth_attrsrA   N)r,   r-   r.   r8   r3  rs  r   r   r  r   r   r/   r0   r0   r0   r1   r‚  i  s    õr‚  c                   @   sR   e Zd Zdefdedddœfdefdefded	ddœfd
efdedddœfgZ	dS )ÚAuthEnvelopedDatar)   rz  r   Trd   r{  Úauth_encrypted_content_inforƒ  r   r„  r…  r@   N)
r,   r-   r.   r8   r3  rs  ru  r   r   r/   r0   r0   r0   r1   r†  y  s    ùr†  c                   @   s   e Zd ZddiZdS )ÚCompressionAlgorithmIdz1.2.840.113549.1.9.16.3.8ÚzlibNrD   r0   r0   r0   r1   rˆ  …  s    ÿrˆ  c                   @   r¨   )ÚCompressionAlgorithmrJ  rK  rf   TN)r,   r-   r.   rˆ  r   r/   r0   r0   r0   r1   rŠ  ‹  r¬   rŠ  c                   @   s2   e Zd ZdefdefdefgZdZedd„ ƒZ	dS )ÚCompressedDatar)   Úcompression_algorithmr*  Nc                 C   s6   | j d u rtd u rtdƒ‚t | d d j¡| _ | j S )Nz The zlib module is not availabler*  r	  )Ú_decompressedr‰  ÚSystemErrorÚ
decompressry   rz   r0   r0   r1   Údecompressed›  s
   
zCompressedData.decompressed)
r,   r-   r.   r8   rŠ  r  r/   r�  Úpropertyr�  r0   r0   r0   r1   r‹  ’  s    ýr‹  c                   @   rX  )rY  ÚsubjectKeyIdentifierrZ  rf   Trú   Nr[  r0   r0   r0   r1   rY  ¤  rT  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 )	ÚSMIMEEncryptionKeyPreferencer  re   r   ÚrecipientKeyIdr   ÚsubjectAltKeyIdentifierr@   N)r,   r-   r.   r  rY  r   rV   r0   r0   r0   r1   r“  ¬  s
    ýr“  c                   @   rh   )ÚSMIMEEncryptionKeyPreferencesN)r,   r-   r.   r“  rj   r0   r0   r0   r1   r–  ´  rk   r–  c                   @   r¨   )ÚSMIMECapabilityIdentifierÚcapability_idrK  rf   TN)r,   r-   r.   r
   r   r/   r0   r0   r0   r1   r—  ¸  r¬   r—  c                   @   rh   )ÚSMIMECapabilitesN)r,   r-   r.   r—  rj   r0   r0   r0   r1   r™  ¿  rk   r™  c                   @   rh   )ÚSetOfSMIMECapabilitesN)r,   r-   r.   r™  rj   r0   r0   r0   r1   rš  Ã  rk   rš  )	rY   rZ   r[   r\   r]   r^   r_   r`   ra   )rZ   r[   r\   r]   r^   r_   r`   ra   )
rH   rI   rJ   rK   rN   rO   rP   rQ   rM   rL   )”Ú__doc__Ú
__future__r   r   r   r   r‰  ÚImportErrorÚalgosr   r   r	   r
   r   r   r   r   Úcorer   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Úkeysr   Úocspr    Úx509r!   r"   r#   r$   r%   r&   r(   r3   r8   rG   rS   rX   rb   ri   rl   rm   rn   ro   rp   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Ø   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'  r3  r5  r6  rI  rM  rR  rU  rY  r\  r^  r_  r`  rd  rf  rh  rj  rm  rs  ru  ry  r~  r  r�  r‚  r†  rˆ  rŠ  r‹  r“  r–  r—  r™  rš  rw   r0   r0   r0   r1   Ú<module>   s"  ÿ(D
 	
#

	
		

÷øö