o
    q¨Êhb  ã                
   @   s4  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 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ƒ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/d0„ d0eƒZ>G d1d2„ d2eƒZ?G d3d4„ d4eƒZ@G d5d6„ d6eƒZAG d7d8„ d8eƒZBG d9d:„ d:eƒZCG d;d<„ d<eƒZDG d=d>„ d>eƒZEG d?d@„ d@eƒZFG dAdB„ dBeƒZGG dCdD„ dDeƒZHG dEdF„ dFeƒZIG dGdH„ dHeƒZJG dIdJ„ dJeƒZKG dKdL„ dLeƒZLG dMdN„ dNeƒZMG dOdP„ dPeƒZNG dQdR„ dReƒZOG dSdT„ dTeƒZPG dUdV„ dVeƒZQG dWdX„ dXeƒZRG dYdZ„ dZeƒZSG d[d\„ d\eƒZTG d]d^„ d^eƒZUG d_d`„ d`eƒZVG dadb„ dbeƒZWG dcdd„ ddeƒZXG dedf„ dfeƒZYG dgdh„ dheƒZZG didj„ djeƒZ[G dkdl„ dleƒZ\G dmdn„ dneƒZ]G dodp„ dpeƒZ^G dqdr„ dreƒZ_G dsdt„ dteƒZ`G dudv„ dveƒZaG dwdx„ dxeƒZbG dydz„ dzeƒZcG d{d|„ d|eƒZdG d}d~„ d~eƒ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	eƒZsG d›dœ„ dœeƒZtG d�dž„ dž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‹eeoeƒe„e…e†e‡e‹eˆdËœ	ea_Œeoeƒe„e…e†e‡e‹eˆdÌœec_Œe3e4e5enebe7dÍœe8_Œ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ÚHmacAlgorithmÚKdfAlgorithmÚ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© r.   r.   ú@/var/www/html/env/lib/python3.10/site-packages/asn1crypto/cms.pyr&   ?   ó
    ýr&   c                   @   r%   )ÚExtendedCertificateÚextended_certificate_infoÚsignature_algorithmÚ	signatureN)r*   r+   r,   r&   r   r   r-   r.   r.   r.   r/   r1   G   r0   r1   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,   Ú_mapr.   r.   r.   r/   r6   U   ó    
úr6   c                   @   r5   )	ÚCMSAttributeTypeÚcontent_typeÚmessage_digestÚsigning_timeÚcounter_signatureÚsignature_time_stamp_tokenÚcms_algorithm_protection)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.16.2.14z1.2.840.113549.1.9.52NrB   r.   r.   r.   r/   rE   `   s    
ørE   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   Ú_alternativesr.   r.   r.   r/   rM   m   ó    þrM   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.23NrB   r.   r.   r.   r/   rR   t   s    
÷rR   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_algorithmr3   r   T©ÚimplicitÚoptionalÚmac_algorithmr>   N)r*   r+   r,   r   r   r
   r-   r.   r.   r.   r/   r\   ‚   s
    ýr\   c                   @   ó   e Zd ZeZdS )ÚSetOfContentTypeN)r*   r+   r,   rR   Ú_child_specr.   r.   r.   r/   rc   Š   ó    rc   c                   @   rb   )ÚSetOfOctetStringN)r*   r+   r,   r   rd   r.   r.   r.   r/   rf   Ž   re   rf   c                   @   rb   )Ú	SetOfTimeN)r*   r+   r,   rM   rd   r.   r.   r.   r/   rg   ’   re   rg   c                   @   rb   )ÚSetOfAnyN)r*   r+   r,   r   rd   r.   r.   r.   r/   rh   –   re   rh   c                   @   rb   )ÚSetOfCMSAlgorithmProtectionN)r*   r+   r,   r\   rd   r.   r.   r.   r/   ri   š   re   ri   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 ©Nrk   ©Ú
_oid_specsÚgetÚnativerh   ©Úselfr.   r.   r/   Ú_values_spec¦   ó   zCMSAttribute._values_specrm   N)r*   r+   r,   rE   r-   rq   rv   Ú_spec_callbacksr.   r.   r.   r/   rj   ž   s    þÿrj   c                   @   rb   )ÚCMSAttributesN)r*   r+   r,   rj   rd   r.   r.   r.   r/   ry   ®   re   ry   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_uidr`   TN)r*   r+   r,   r#   r   r   r-   r.   r.   r.   r/   rz   ²   ó
    ýrz   c                   @   ó   e Zd ZdddœZdS )ÚAttCertVersionr8   r9   )r   r   NrB   r.   r.   r.   r/   r€   º   ó    
þr€   c                   @   ó(   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,   rz   r#   rP   r.   r.   r.   r/   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-   r.   r.   r.   r/   rˆ   È   rQ   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'   Údefaultr8   Úsubjectr{   r4   Úserial_numberÚatt_cert_validity_periodr)   Úissuer_unique_idr`   TÚ
extensionsN)r*   r+   r,   r€   rƒ   r#   r   r   rˆ   r   r   r!   r-   r.   r.   r.   r/   r‹   Ï   s    ÷r‹   c                   @   r%   )ÚAttributeCertificateV1Úac_infor3   r4   N)r*   r+   r,   r‹   r   r   r-   r.   r.   r.   r/   r’   Ý   r0   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>   NrB   r.   r.   r.   r/   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_idr`   Tr]   Úobject_digestN)r*   r+   r,   r”   r   r   r   r-   r.   r.   r.   r/   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   Tr^   Úentity_namer   Úobject_digest_infor>   N)r*   r+   r,   rz   r#   r˜   r-   r.   r.   r.   r/   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_namer`   Tr„   r   ©r…   r`   rž   r   N)r*   r+   r,   r#   rz   r˜   r-   r.   r.   r.   r/   rŸ   þ   ó
    ýrŸ   c                   @   ó"   e Zd ZdefdeddifgZdS )ÚAttCertIssuerÚv1_formÚv2_formr…   r   N)r*   r+   r,   r#   rŸ   rP   r.   r.   r.   r/   r¤     ó    þr¤   c                   @   r%   )ÚIetfAttrValueÚoctetsÚoidÚstringN)r*   r+   r,   r   r   r   rP   r.   r.   r.   r/   r¨     r0   r¨   c                   @   rb   )ÚIetfAttrValuesN)r*   r+   r,   r¨   rd   r.   r.   r.   r/   r¬     re   r¬   c                   @   s$   e Zd ZdedddœfdefgZdS )ÚIetfAttrSyntaxÚpolicy_authorityr   Tr^   rm   N)r*   r+   r,   r#   r¬   r-   r.   r.   r.   r/   r­     ó    þr­   c                   @   rb   )ÚSetOfIetfAttrSyntaxN)r*   r+   r,   r­   rd   r.   r.   r.   r/   r°      re   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_infor`   TN)r*   r+   r,   r"   r   r-   r.   r.   r.   r/   r±   $  r~   r±   c                   @   rb   )ÚSetOfSvceAuthInfoN)r*   r+   r,   r±   rd   r.   r.   r.   r/   rµ   ,  re   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   Tr^   Ú	role_namer_   r   N)r*   r+   r,   r#   r"   r-   r.   r.   r.   r/   r¶   0  s    þr¶   c                   @   rb   )ÚSetOfRoleSyntaxN)r*   r+   r,   r¶   rd   r.   r.   r.   r/   r¹   7  re   r¹   c                   @   r5   )	Ú	ClassListÚunmarkedÚunclassifiedÚ
restrictedÚconfidentialÚsecretÚ
top_secretr=   NrB   r.   r.   r.   r/   rº   ;  rD   rº   c                   @   r‚   )ÚSecurityCategoryrk   r_   r   Úvaluer   N©r*   r+   r,   r   r   r-   r.   r.   r.   r/   rÁ   F  r‡   rÁ   c                   @   rb   )ÚSetOfSecurityCategoryN)r*   r+   r,   rÁ   rd   r.   r.   r.   r/   rÄ   M  re   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 )Ú	ClearanceÚ	policy_idr_   r   Ú
class_listr   r¼   )r_   rŒ   Úsecurity_categoriesr>   Tr^   N)r*   r+   r,   r   rº   rÄ   r-   r.   r.   r.   r/   rÅ   Q  r¢   rÅ   c                   @   rb   )ÚSetOfClearanceN)r*   r+   r,   rÅ   rd   r.   r.   r.   r/   rÉ   Y  re   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Úsignr`   TN)r*   r+   r,   r   r-   r.   r.   r.   r/   rÊ   ]  r~   rÊ   c                   @   rL   )ÚLeapDataÚ	leap_timeÚactionN)r*   r+   r,   rÊ   r   r-   r.   r.   r.   r/   rÎ   e  rQ   rÎ   c                   @   rb   )ÚSetOfLeapDataN)r*   r+   r,   rÎ   rd   r.   r.   r.   r/   rÑ   l  re   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_eventr`   TN)r*   r+   r,   rÊ   rÑ   r-   r.   r.   r.   r/   rÒ   p  s    ûrÒ   c                   @   rb   )ÚSetOfTimingMetricsN)r*   r+   r,   rÒ   rd   r.   r.   r.   r/   rØ   z  re   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-   r.   r.   r.   r/   rÙ   ~  r¢   rÙ   c                   @   rb   )ÚSetOfTimingPolicyN)r*   r+   r,   rÙ   rd   r.   r.   r.   r/   rÝ   †  re   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.2NrB   r.   r.   r.   r/   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 )ÚAttCertAttributerk   rl   )rß   rà   rá   râ   rã   rä   rå   ræ   c                 C   rn   ro   rp   rt   r.   r.   r/   rv   ¨  rw   zAttCertAttribute._values_specrm   N)r*   r+   r,   rÞ   r-   rµ   r°   r¹   rÉ   rØ   rÝ   rq   rv   rx   r.   r.   r.   r/   rç   —  s     þøÿrç   c                   @   rb   )ÚAttCertAttributesN)r*   r+   r,   rç   rd   r.   r.   r.   r/   rè   °  re   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{   r4   rŽ   r�   r)   r�   r`   Tr‘   N)r*   r+   r,   r€   rœ   r¤   r   r   rˆ   rè   r   r!   r-   r.   r.   r.   r/   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“   r3   r4   N)r*   r+   r,   Ú_bad_tagré   r   r   r-   r.   r.   r.   r/   rë   Â  s    ýrë   c                   @   rL   )ÚOtherCertificateFormatÚother_cert_formatÚ
other_certNrÃ   r.   r.   r.   r/   rí   Í  rQ   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_certificater_   r   Úv1_attr_certr   Úv2_attr_certr>   Úotherr?   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   r9   r?   N)	Úsuperrð   ÚvalidateÚ_choicer€   Úloadr   Údumprs   )ru   Úclass_ÚtagÚcontents©Ú	__class__r.   r/   rö   Ý  s   

þzCertificateChoices.validate)r*   r+   r,   r    r1   r’   rë   rí   rP   rö   Ú__classcell__r.   r.   rý   r/   rð   Ô  s    ûrð   c                   @   rb   )ÚCertificateSetN)r*   r+   r,   rð   rd   r.   r.   r.   r/   r   ÷  re   r   c                   @   ó,   e Zd ZdefdedddœfgZdZi ZdS )ÚContentInforF   Úcontentr   Tr¡   ©rF   r  N)r*   r+   r,   rR   r   r-   Ú	_oid_pairrq   r.   r.   r.   r/   r  û  ó    þr  c                   @   rb   )ÚSetOfContentInfoN)r*   r+   r,   r  rd   r.   r.   r.   r/   r    re   r  c                   @   r  )ÚEncapsulatedContentInforF   r  r   Tr¡   r  N)r*   r+   r,   rR   r   r-   r  rq   r.   r.   r.   r/   r  	  r  r  c                   @   rL   )ÚIssuerAndSerialNumberr{   rŽ   N)r*   r+   r,   r$   r   r-   r.   r.   r.   r/   r	    rQ   r	  c                   @   r£   )ÚSignerIdentifierÚissuer_and_serial_numberÚsubject_key_identifierr_   r   N©r*   r+   r,   r	  r   rP   r.   r.   r.   r/   r
    r§   r
  c                   @   rb   )ÚDigestAlgorithmsN)r*   r+   r,   r   rd   r.   r.   r.   r/   r  !  re   r  c                   @   rb   )ÚCertificateRevocationListsN)r*   r+   r,   r   rd   r.   r.   r.   r/   r  %  re   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.   r/   r  )  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.4NrB   r.   r.   r.   r/   r  0  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  rq   r.   r.   r.   r/   r  7  s    þ
þr  c                   @   r£   )ÚRevocationInfoChoiceÚcrlrô   r_   r   N)r*   r+   r,   r   r  rP   r.   r.   r.   r/   r  D  r§   r  c                   @   rb   )ÚRevocationInfoChoicesN)r*   r+   r,   r  rd   r.   r.   r.   r/   r  K  re   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'   Úsidr]   Úsigned_attrsr   Tr^   r3   r4   Úunsigned_attrsr   N)
r*   r+   r,   r6   r
  r   ry   r   r   r-   r.   r.   r.   r/   r  O  s    ùr  c                   @   rb   )ÚSignerInfosN)r*   r+   r,   r  rd   r.   r.   r.   r/   r   [  re   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   Tr^   Úcrlsr   Úsigner_infosc                 C   ó   | d j dkr	tS tS ©Nr'   r8   ©rs   r  r  rt   r.   r.   r/   Ú_encap_content_info_speci  ó   z#SignedData._encap_content_info_specr$  N)r*   r+   r,   r6   r  r   r  r   r-   r+  rx   r.   r.   r.   r/   r!  _  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   Tr^   r&  r   N)r*   r+   r,   r   r  r-   r.   r.   r.   r/   r-  |  s    þr-  c                   @   r£   )ÚRecipientIdentifierr  r  r_   r   Nr  r.   r.   r.   r/   r/  ƒ  r§   r/  c                   @   s    e Zd ZddddddddœZd	S )
ÚKeyEncryptionAlgorithmIdÚrsaÚaes128_wrapÚaes128_wrap_padÚaes192_wrapÚaes192_wrap_padÚaes256_wrapÚaes256_wrap_pad)z1.2.840.113549.1.1.1z2.16.840.1.101.3.4.1.5z2.16.840.1.101.3.4.1.8z2.16.840.1.101.3.4.1.25z2.16.840.1.101.3.4.1.28z2.16.840.1.101.3.4.1.45z2.16.840.1.101.3.4.1.48NrB   r.   r.   r.   r/   r0  Š  s    
ùr0  c                   @   r£   )ÚKeyEncryptionAlgorithmÚ	algorithmÚ
parametersr`   TN)r*   r+   r,   r0  r   r-   r.   r.   r.   r/   r8  –  r§   r8  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,   r6   r/  r8  r   r-   r.   r.   r.   r/   r<  �  ó    ü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  r_   r   Úoriginator_keyr   N)r*   r+   r,   r	  r   r   rP   r.   r.   r.   r/   rA  ¦  ó
    ýrA  c                   @   rL   )ÚOtherKeyAttributeÚkey_attr_idÚkey_attrNrÃ   r.   r.   r.   r/   rD  ®  rQ   rD  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  Údater`   Trô   N©r*   r+   r,   r   r   rD  r-   r.   r.   r.   r/   rH  µ  rC  rH  c                   @   r£   )ÚKeyAgreementRecipientIdentifierr  Úr_key_idr_   r   N)r*   r+   r,   r	  rH  rP   r.   r.   r.   r/   rK  ½  r§   rK  c                   @   rL   )ÚRecipientEncryptedKeyr=  r?  N)r*   r+   r,   rK  r   r-   r.   r.   r.   r/   rM  Ä  rQ   rM  c                   @   rb   )ÚRecipientEncryptedKeysN)r*   r+   r,   rM  rd   r.   r.   r.   r/   rN  Ë  re   rN  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¡   r>  Úrecipient_encrypted_keysN)	r*   r+   r,   r6   rA  r   r8  rN  r-   r.   r.   r.   r/   rO  Ï  s    ûrO  c                   @   rG  )ÚKEKIdentifierÚkey_identifierrI  r`   Trô   NrJ  r.   r.   r.   r/   rS  Ù  rC  rS  c                   @   r;  )ÚKEKRecipientInfor'   Úkekidr>  r?  N)r*   r+   r,   r6   rS  r8  r   r-   r.   r.   r.   r/   rU  á  r@  rU  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   Tr^   r>  r?  N)r*   r+   r,   r6   r   r8  r   r-   r.   r.   r.   r/   rW  ê  s    ürW  c                   @   rL   )ÚOtherRecipientInfoÚori_typeÚ	ori_valueNrÃ   r.   r.   r.   r/   rY  ó  rQ   rY  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Úkarir_   r   Úkekrir>   Úpwrir?   Úorir@   N)	r*   r+   r,   r<  rO  rU  rW  rY  rP   r.   r.   r.   r/   r\  ú  s    ûr\  c                   @   rb   )ÚRecipientInfosN)r*   r+   r,   r\  rd   r.   r.   r.   r/   rb    re   rb  c                   @   ó*   e Zd ZdefdefdedddœfgZdS )ÚEncryptedContentInforF   Úcontent_encryption_algorithmÚencrypted_contentr   Tr^   N)r*   r+   r,   rR   r	   r   r-   r.   r.   r.   r/   rd    ó
    ýrd  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   Tr^   Úrecipient_infosÚencrypted_content_infoÚunprotected_attrsr   N)	r*   r+   r,   r6   r-  rb  rd  ry   r-   r.   r.   r.   r/   rh    s    ûrh  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'   rj  r"  rk  r%  r   Tr^   r&  r   r'  N)r*   r+   r,   r6   rb  r  rd  r   r  r   r-   r.   r.   r.   r/   rm    s    ùrm  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'   r]   r#  Údigestc                 C   r(  r)  r*  rt   r.   r.   r/   r+  .  r,  z%DigestedData._encap_content_info_specr$  N)	r*   r+   r,   r6   r   r   r-   r+  rx   r.   r.   r.   r/   rn  &  s    üÿrn  c                   @   rc  )ÚEncryptedDatar'   rk  rl  r   Tr^   N)r*   r+   r,   r6   rd  ry   r-   r.   r.   r.   r/   rp  A  rg  rp  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'   ri  r   Tr^   rj  ra   r]   r   r$  Ú
auth_attrsr>   ÚmacÚunauth_attrsr?   N)r*   r+   r,   r6   r-  rb  r
   r   r  ry   r   r-   r.   r.   r.   r/   rq  I  s    õrq  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'   ri  r   Tr^   rj  Úauth_encrypted_content_inforr  r   rs  rt  r>   N)
r*   r+   r,   r6   r-  rb  rd  ry   r   r-   r.   r.   r.   r/   ru  Y  s    ùru  c                   @   s   e Zd ZddiZdS )ÚCompressionAlgorithmIdz1.2.840.113549.1.9.16.3.8ÚzlibNrB   r.   r.   r.   r/   rw  e  s    ÿrw  c                   @   r£   )ÚCompressionAlgorithmr9  r:  r`   TN)r*   r+   r,   rw  r   r-   r.   r.   r.   r/   ry  k  r§   ry  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  )Ú_decompressedrx  ÚSystemErrorÚ
decompressrs   rt   r.   r.   r/   Údecompressed{  s
   
zCompressedData.decompressed)
r*   r+   r,   r6   ry  r  r-   r|  Úpropertyr  r.   r.   r.   r/   rz  r  s    ýrz  )	rS   rT   rU   rV   rW   rX   rY   rZ   r[   )rT   rU   rV   rW   rX   rY   rZ   r[   )rF   rG   rH   rI   rJ   rK   )�Ú__doc__Ú
__future__r   r   r   r   rx  ÚImportErrorÚalgosr   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&   r1   r6   rE   rM   rR   r\   rc   rf   rg   rh   ri   rj   ry   rz   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  r8  r<  rA  rD  rH  rK  rM  rN  rO  rS  rU  rW  rY  r\  rb  rd  rh  rm  rn  rp  rq  ru  rw  ry  rz  rq   r.   r.   r.   r/   Ú<module>   s  ÿ D 	
#

	
		

÷øú