U
    ÈZj€l  ã                   @   s¦  d Z ddlmZmZmZmZ zddlZW n ek
r@   dZY nX 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                   @   s"   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© r/   r/   úQ/var/www/html/TRUCKING_PROJECT/venv/lib/python3.8/site-packages/asn1crypto/cms.pyr'   A   s   ýr'   c                   @   s"   e Zd ZdefdefdefgZdS )ÚExtendedCertificateZextended_certificate_infoÚsignature_algorithmÚ	signatureN)r+   r,   r-   r'   r   r   r.   r/   r/   r/   r0   r1   I   s   ýr1   c                   @   s   e Zd ZdddddddœZdS )	Ú
CMSVersionZv0Úv1Úv2Zv3Zv4Zv5©r   r   é   é   é   é   N©r+   r,   r-   Ú_mapr/   r/   r/   r0   r4   W   s   úr4   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.1Nr<   r/   r/   r/   r0   r>   b   s   ìr>   c                   @   s   e Zd ZdefdefgZdS )ÚTimeZutc_timeZgeneralized_timeN)r+   r,   r-   r   r   Ú_alternativesr/   r/   r/   r0   rI   {   s   þrI   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.23Nr<   r/   r/   r/   r0   rK   ‚   s   ÷rK   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_algorithmr2   r   T©ÚimplicitÚoptionalÚmac_algorithmr8   N)r+   r,   r-   r   r   r   r.   r/   r/   r/   r0   rU   �   s   ýrU   c                   @   s   e Zd ZeZdS )ÚSetOfContentTypeN)r+   r,   r-   rK   Ú_child_specr/   r/   r/   r0   r[   ˜   s   r[   c                   @   s   e Zd ZeZdS )ÚSetOfOctetStringN)r+   r,   r-   r   r\   r/   r/   r/   r0   r]   œ   s   r]   c                   @   s   e Zd ZeZdS )Ú	SetOfTimeN)r+   r,   r-   rI   r\   r/   r/   r/   r0   r^       s   r^   c                   @   s   e Zd ZeZdS )ÚSetOfAnyN)r+   r,   r-   r   r\   r/   r/   r/   r0   r_   ¤   s   r_   c                   @   s   e Zd ZeZdS )ÚSetOfCMSAlgorithmProtectionN)r+   r,   r-   rU   r\   r/   r/   r/   r0   r`   ¨   s   r`   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   s   | j  | d jt¡S ©Nrb   ©Ú
_oid_specsÚgetÚnativer_   ©Úselfr/   r/   r0   Ú_values_spec´   s    zCMSAttribute._values_specrd   N)r+   r,   r-   r>   r.   rg   rl   Ú_spec_callbacksr/   r/   r/   r0   ra   ¬   s   þ ÿra   c                   @   s   e Zd ZeZdS )ÚCMSAttributesN)r+   r,   r-   ra   r\   r/   r/   r/   r0   rn   ¼   s   rn   c                   @   s(   e Zd ZdefdefdeddifgZdS )ÚIssuerSerialÚissuerÚserialZ
issuer_uidrY   TN)r+   r,   r-   r%   r   r   r.   r/   r/   r/   r0   ro   À   s   ýro   c                   @   s   e Zd ZdddœZdS )ÚAttCertVersionr5   r6   )r   r   Nr<   r/   r/   r/   r0   rr   È   s   þrr   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   Zsubject_namer   N)r+   r,   r-   ro   r%   rJ   r/   r/   r/   r0   rs   Ï   s   þrs   c                   @   s   e Zd ZdefdefgZdS )ÚAttCertValidityPeriodZnot_before_timeZnot_after_timeN)r+   r,   r-   r   r.   r/   r/   r/   r0   rv   Ö   s   þrv   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(   Údefaultr5   Úsubjectrp   r3   Úserial_numberÚatt_cert_validity_periodr*   Úissuer_unique_idrY   TÚ
extensionsN)r+   r,   r-   rr   rs   r%   r   r   rv   r!   r   r#   r.   r/   r/   r/   r0   rw   Ý   s   ÷rw   c                   @   s"   e Zd ZdefdefdefgZdS )ÚAttributeCertificateV1Úac_infor2   r3   N)r+   r,   r-   rw   r   r   r.   r/   r/   r/   r0   r~   ë   s   ýr~   c                   @   s   e Zd ZddddœZdS )ÚDigestedObjectTypeZ
public_keyZpublic_key_certZother_objy_types)r   r   r8   Nr<   r/   r/   r/   r0   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 )ÚObjectDigestInfoZdigested_object_typeZother_object_type_idrY   TrV   Zobject_digestN)r+   r,   r-   r€   r   r   r   r.   r/   r/   r/   r0   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 )
ÚHolderrt   r   TrW   Úentity_namer   Úobject_digest_infor8   N)r+   r,   r-   ro   r%   r�   r.   r/   r/   r/   r0   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 )
ÚV2FormZissuer_namerY   Trt   r   ©ru   rY   r„   r   N)r+   r,   r-   r%   ro   r�   r.   r/   r/   r/   r0   r…     s   ýr…   c                   @   s"   e Zd ZdefdeddifgZdS )ÚAttCertIssuerZv1_formZv2_formrX   r   N)r+   r,   r-   r%   r…   rJ   r/   r/   r/   r0   r‡     s   þr‡   c                   @   s"   e Zd ZdefdefdefgZdS )ÚIetfAttrValueÚoctetsÚoidÚstringN)r+   r,   r-   r   r   r   rJ   r/   r/   r/   r0   rˆ     s   ýrˆ   c                   @   s   e Zd ZeZdS )ÚIetfAttrValuesN)r+   r,   r-   rˆ   r\   r/   r/   r/   r0   rŒ   #  s   rŒ   c                   @   s$   e Zd ZdedddœfdefgZdS )ÚIetfAttrSyntaxZpolicy_authorityr   TrW   rd   N)r+   r,   r-   r%   rŒ   r.   r/   r/   r/   r0   r�   '  s   þr�   c                   @   s   e Zd ZeZdS )ÚSetOfIetfAttrSyntaxN)r+   r,   r-   r�   r\   r/   r/   r/   r0   rŽ   .  s   rŽ   c                   @   s(   e Zd ZdefdefdeddifgZdS )ÚSvceAuthInfoZserviceÚidentZ	auth_inforY   TN)r+   r,   r-   r$   r   r.   r/   r/   r/   r0   r�   2  s   ýr�   c                   @   s   e Zd ZeZdS )ÚSetOfSvceAuthInfoN)r+   r,   r-   r�   r\   r/   r/   r/   r0   r‘   :  s   r‘   c                   @   s*   e Zd ZdedddœfdeddifgZdS )	Ú
RoleSyntaxZrole_authorityr   TrW   Z	role_nameru   r   N)r+   r,   r-   r%   r$   r.   r/   r/   r/   r0   r’   >  s   þr’   c                   @   s   e Zd ZeZdS )ÚSetOfRoleSyntaxN)r+   r,   r-   r’   r\   r/   r/   r/   r0   r“   E  s   r“   c                   @   s   e Zd ZdddddddœZdS )	Ú	ClassListZunmarkedÚunclassifiedZ
restrictedZconfidentialÚsecretZ
top_secretr7   Nr<   r/   r/   r/   r0   r”   I  s   úr”   c                   @   s(   e Zd ZdeddifdeddifgZdS )ÚSecurityCategoryrb   rX   r   Úvalueru   r   N©r+   r,   r-   r   r   r.   r/   r/   r/   r0   r—   T  s   þr—   c                   @   s   e Zd ZeZdS )ÚSetOfSecurityCategoryN)r+   r,   r-   r—   r\   r/   r/   r/   r0   rš   [  s   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_idZ
class_listrx   r•   Zsecurity_categoriesrY   TN)r+   r,   r-   r   r”   Úsetrš   r.   r/   r/   r/   r0   r›   _  s   ýr›   c                   @   s   e Zd ZeZdS )ÚSetOfClearanceN)r+   r,   r-   r›   r\   r/   r/   r/   r0   rž   g  s   rž   c                   @   s(   e Zd ZdefdefdeddifgZdS )ÚBigTimeÚmajorZfractional_secondsÚsignrY   TN)r+   r,   r-   r   r.   r/   r/   r/   r0   rŸ   k  s   ýrŸ   c                   @   s   e Zd ZdefdefgZdS )ÚLeapDataZ	leap_timeÚactionN)r+   r,   r-   rŸ   r   r.   r/   r/   r/   r0   r¢   s  s   þr¢   c                   @   s   e Zd ZeZdS )ÚSetOfLeapDataN)r+   r,   r-   r¢   r\   r/   r/   r/   r0   r¤   z  s   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 )	ÚTimingMetricsZntp_timeÚoffsetÚdelayZ
expirationZ
leap_eventrY   TN)r+   r,   r-   rŸ   r¤   r.   r/   r/   r/   r0   r¥   ~  s   ûr¥   c                   @   s   e Zd ZeZdS )ÚSetOfTimingMetricsN)r+   r,   r-   r¥   r\   r/   r/   r/   r0   r¨   ˆ  s   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†   Z	max_delayr   N)r+   r,   r-   r   r   rŸ   r.   r/   r/   r/   r0   r©   Œ  s   ýr©   c                   @   s   e Zd ZeZdS )ÚSetOfTimingPolicyN)r+   r,   r-   r©   r\   r/   r/   r/   r0   r¬   ”  s   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.2Nr<   r/   r/   r/   r0   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 )ÚAttCertAttributerb   rc   )r®   r¯   r°   r±   r²   r³   r´   rµ   c                 C   s   | j  | d jt¡S re   rf   rj   r/   r/   r0   rl   ¶  s    zAttCertAttribute._values_specrd   N)r+   r,   r-   r­   r.   r‘   rŽ   r“   rž   r¨   r¬   rg   rl   rm   r/   r/   r/   r0   r¶   ¥  s    þø ÿr¶   c                   @   s   e Zd ZeZdS )ÚAttCertAttributesN)r+   r,   r-   r¶   r\   r/   r/   r/   r0   r·   ¾  s   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(   Zholderrp   r3   rz   r{   r*   r|   rY   Tr}   N)r+   r,   r-   rr   r‚   r‡   r   r   rv   r·   r   r#   r.   r/   r/   r/   r0   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   r2   r3   N)r+   r,   r-   Z_bad_tagr¸   r   r   r.   r/   r/   r/   r0   r¹   Ð  s
   ýr¹   c                   @   s   e Zd ZdefdefgZdS )ÚOtherCertificateFormatZother_cert_formatZ
other_certNr™   r/   r/   r/   r0   rº   Û  s   þ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)   Zextended_certificaterX   r   Zv1_attr_certr   Zv2_attr_certr8   Úotherr9   c                    sF   t t| ƒ |||¡ | jdkrBt t |¡d  ¡ ¡jdkrBd| _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
        r8   r   r6   r9   N)	Úsuperr»   ÚvalidateZ_choicerr   Úloadr   Údumpri   )rk   Úclass_ÚtagÚcontents©Ú	__class__r/   r0   r¾   ë  s    
zCertificateChoices.validate)r+   r,   r-   r"   r1   r~   r¹   rº   rJ   r¾   Ú__classcell__r/   r/   rÄ   r0   r»   â  s   ûr»   c                   @   s   e Zd ZeZdS )ÚCertificateSetN)r+   r,   r-   r»   r\   r/   r/   r/   r0   rÇ     s   rÇ   c                   @   s,   e Zd ZdefdedddœfgZdZi ZdS )ÚContentInfor?   Úcontentr   Tr†   ©r?   rÉ   N)r+   r,   r-   rK   r   r.   Ú	_oid_pairrg   r/   r/   r/   r0   rÈ   	  s
   þrÈ   c                   @   s   e Zd ZeZdS )ÚSetOfContentInfoN)r+   r,   r-   rÈ   r\   r/   r/   r/   r0   rÌ     s   rÌ   c                   @   s,   e Zd ZdefdedddœfgZdZi ZdS )ÚEncapsulatedContentInfor?   rÉ   r   Tr†   rÊ   N)r+   r,   r-   rK   r   r.   rË   rg   r/   r/   r/   r0   rÍ     s
   þrÍ   c                   @   s   e Zd ZdefdefgZdS )ÚIssuerAndSerialNumberrp   rz   N)r+   r,   r-   r&   r   r.   r/   r/   r/   r0   rÎ   !  s   þrÎ   c                   @   s"   e Zd ZdefdeddifgZdS )ÚSignerIdentifierÚissuer_and_serial_numberÚsubject_key_identifierrX   r   N©r+   r,   r-   rÎ   r   rJ   r/   r/   r/   r0   rÏ   (  s   þrÏ   c                   @   s   e Zd ZeZdS )ÚDigestAlgorithmsN)r+   r,   r-   r   r\   r/   r/   r/   r0   rÓ   /  s   rÓ   c                   @   s   e Zd ZeZdS )ÚCertificateRevocationListsN)r+   r,   r-   r   r\   r/   r/   r/   r0   rÔ   3  s   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.   r/   r/   r/   r0   rÕ   7  s   þrÕ   c                   @   s   e Zd ZdddœZdS )ÚOtherRevInfoFormatIdÚocsp_responseÚscvp)z1.3.6.1.5.5.7.16.2z1.3.6.1.5.5.7.16.4Nr<   r/   r/   r/   r0   rØ   >  s   þ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Õ   rg   r/   r/   r/   r0   rÛ   E  s   þþrÛ   c                   @   s"   e Zd ZdefdeddifgZdS )ÚRevocationInfoChoiceÚcrlr¼   rX   r   N)r+   r,   r-   r   rÛ   rJ   r/   r/   r/   r0   rÞ   R  s   þrÞ   c                   @   s   e Zd ZeZdS )ÚRevocationInfoChoicesN)r+   r,   r-   rÞ   r\   r/   r/   r/   r0   rà   Y  s   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(   ZsidrV   Zsigned_attrsr   TrW   r2   r3   Zunsigned_attrsr   N)
r+   r,   r-   r4   rÏ   r   rn   r   r   r.   r/   r/   r/   r0   rá   ]  s   ùrá   c                   @   s   e Zd ZeZdS )ÚSignerInfosN)r+   r,   r-   rá   r\   r/   r/   r/   r0   râ   i  s   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   TrW   Úcrlsr   Úsigner_infosc                 C   s   | d j dkrtS tS ©Nr(   r5   ©ri   rÍ   rÈ   rj   r/   r/   r0   Ú_encap_content_info_specw  s    z#SignedData._encap_content_info_specræ   N)r+   r,   r-   r4   rÓ   rÇ   rà   râ   r.   rì   rm   r/   r/   r/   r0   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   TrW   rè   r   N)r+   r,   r-   rÇ   rà   r.   r/   r/   r/   r0   rí   Š  s   þrí   c                   @   s"   e Zd ZdefdeddifgZdS )ÚRecipientIdentifierrÐ   rÑ   rX   r   NrÒ   r/   r/   r/   r0   rï   ‘  s   þrï   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ú   rû   rü   rý   rþ   rÿ   r   )	Úrsarñ   rò   ró   rô   rõ   rö   r÷   rø   N)r+   r,   r-   r=   Z_reverse_mapr/   r/   r/   r0   rð   ˜  s&   ø÷rð   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Ú
parametersrY   T)r  r  rò   N)	r+   r,   r-   rð   r   r.   rË   r   rg   r/   r/   r/   r0   r  ±  s   þ ÿr  c                   @   s(   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-   r4   rï   r  r   r.   r/   r/   r/   r0   r  ½  s
   ür  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Ñ   rX   r   Zoriginator_keyr   N)r+   r,   r-   rÎ   r   r   rJ   r/   r/   r/   r0   r	  Æ  s   ýr	  c                   @   s   e Zd ZdefdefgZdS )ÚOtherKeyAttributeZkey_attr_idZkey_attrNr™   r/   r/   r/   r0   r
  Î  s   þr
  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 )ÚRecipientKeyIdentifierrÑ   ÚdaterY   Tr¼   N©r+   r,   r-   r   r   r
  r.   r/   r/   r/   r0   r  Õ  s   ýr  c                   @   s"   e Zd ZdefdeddifgZdS )ÚKeyAgreementRecipientIdentifierrÐ   Zr_key_idrX   r   N)r+   r,   r-   rÎ   r  rJ   r/   r/   r/   r0   r  Ý  s   þr  c                   @   s   e Zd ZdefdefgZdS )ÚRecipientEncryptedKeyr  r  N)r+   r,   r-   r  r   r.   r/   r/   r/   r0   r  ä  s   þr  c                   @   s   e Zd ZeZdS )ÚRecipientEncryptedKeysN)r+   r,   r-   r  r\   r/   r/   r/   r0   r  ë  s   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(   Z
originatorru   r   Zukmr   Tr†   r  Zrecipient_encrypted_keysN)	r+   r,   r-   r4   r	  r   r  r  r.   r/   r/   r/   r0   r  ï  s   ûr  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 )ÚKEKIdentifierZkey_identifierr  rY   Tr¼   Nr  r/   r/   r/   r0   r  ù  s   ýr  c                   @   s(   e Zd ZdefdefdefdefgZdS )ÚKEKRecipientInfor(   Zkekidr  r  N)r+   r,   r-   r4   r  r  r   r.   r/   r/   r/   r0   r    s
   ür  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(   Zkey_derivation_algorithmr   TrW   r  r  N)r+   r,   r-   r4   r   r  r   r.   r/   r/   r/   r0   r  
  s
   ür  c                   @   s   e Zd ZdefdefgZdS )ÚOtherRecipientInfoZori_typeZ	ori_valueNr™   r/   r/   r/   r0   r    s   þr  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 )ÚRecipientInfoZktriZkarirX   r   Zkekrir8   Zpwrir9   Zorir:   N)	r+   r,   r-   r  r  r  r  r  rJ   r/   r/   r/   r0   r    s   ûr  c                   @   s   e Zd ZeZdS )ÚRecipientInfosN)r+   r,   r-   r  r\   r/   r/   r/   r0   r  $  s   r  c                   @   s*   e Zd ZdefdefdedddœfgZdS )ÚEncryptedContentInfor?   Zcontent_encryption_algorithmZencrypted_contentr   TrW   N)r+   r,   r-   rK   r	   r   r.   r/   r/   r/   r0   r  (  s   ýr  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   TrW   Úrecipient_infosÚencrypted_content_infoÚunprotected_attrsr   N)	r+   r,   r-   r4   rí   r  r  rn   r.   r/   r/   r/   r0   r  0  s   ûr  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   TrW   rè   r   ré   N)r+   r,   r-   r4   r  rÓ   r  rÇ   rÔ   râ   r.   r/   r/   r/   r0   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(   rV   rå   Údigestc                 C   s   | d j dkrtS tS rê   rë   rj   r/   r/   r0   rì   N  s    z%DigestedData._encap_content_info_specræ   N)	r+   r,   r-   r4   r   r   r.   rì   rm   r/   r/   r/   r0   r  F  s   ü ÿr  c                   @   s*   e Zd ZdefdefdedddœfgZdS )ÚEncryptedDatar(   r  r  r   TrW   N)r+   r,   r-   r4   r  rn   r.   r/   r/   r/   r0   r!  a  s   ý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(   r  r   TrW   r  rZ   rV   r   ræ   Ú
auth_attrsr8   ÚmacÚunauth_attrsr9   N)r+   r,   r-   r4   rí   r  r   r   rÍ   rn   r   r.   r/   r/   r/   r0   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(   r  r   TrW   r  Zauth_encrypted_content_infor#  r   r$  r%  r8   N)
r+   r,   r-   r4   rí   r  r  rn   r   r.   r/   r/   r/   r0   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ÚzlibNr<   r/   r/   r/   r0   r'  …  s    ÿr'  c                   @   s"   e Zd ZdefdeddifgZdS )ÚCompressionAlgorithmr  r  rY   TN)r+   r,   r-   r'  r   r.   r/   r/   r/   r0   r)  ‹  s   þ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(   Zcompression_algorithmræ   Nc                 C   s6   | j d kr0td krtdƒ‚t | d d j¡| _ | j S )Nz The zlib module is not availableræ   rÉ   )Ú_decompressedr(  ÚSystemErrorÚ
decompressri   rj   r/   r/   r0   Údecompressed›  s
    
zCompressedData.decompressed)
r+   r,   r-   r4   r)  rÍ   r.   r+  Úpropertyr.  r/   r/   r/   r0   r*  ’  s   ýr*  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 )r  ZsubjectKeyIdentifierr  rY   Tr¼   Nr  r/   r/   r/   r0   r  ¤  s   ý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Ð   rX   r   ZrecipientKeyIdr   ZsubjectAltKeyIdentifierr8   N)r+   r,   r-   rÎ   r  r   rJ   r/   r/   r/   r0   r0  ¬  s   ýr0  c                   @   s   e Zd ZeZdS )ÚSMIMEEncryptionKeyPreferencesN)r+   r,   r-   r0  r\   r/   r/   r/   r0   r1  ´  s   r1  c                   @   s"   e Zd ZdefdeddifgZdS )ÚSMIMECapabilityIdentifierZcapability_idr  rY   TN)r+   r,   r-   r
   r   r.   r/   r/   r/   r0   r2  ¸  s   þr2  c                   @   s   e Zd ZeZdS )ÚSMIMECapabilitesN)r+   r,   r-   r2  r\   r/   r/   r/   r0   r3  ¿  s   r3  c                   @   s   e Zd ZeZdS )ÚSetOfSMIMECapabilitesN)r+   r,   r-   r3  r\   r/   r/   r/   r0   r4  Ã  s   r4  )	rL   rM   rN   rO   rP   rQ   rR   rS   rT   )rM   rN   rO   rP   rQ   rR   rS   rT   )
r?   r@   rA   rB   rE   rF   rG   rH   rD   rC   )”Ú__doc__Ú
__future__r   r   r   r   r(  ÚImportErrorZ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   Zocspr    Úx509r!   r"   r#   r$   r%   r&   r'   r1   r4   r>   rI   rK   rU   r[   r]   r^   r_   r`   ra   rn   ro   rr   rs   rv   rw   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	  r
  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r!  r"  r&  r'  r)  r*  r0  r1  r2  r3  r4  rg   r/   r/   r/   r0   Ú<module>   s  
(
D 	
#

	
		

÷øö