U
    ;gl                     @   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 deZhG dd deZiG dd deZjG dd deZkG dd deZlG dd deZmG dd deZnG dd deZoG dd deZpG dd deZqG dd deZrG dd deZsG dd deZtG dd de	eZuG dd deZvG dd deZwG dd deZxG dd deZyG dd deZzG dd deZ{G dd deZ|G dd deZ}G dd deZ~G dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG ddĄ deZG ddƄ deZG ddȄ deZG ddʄ deZG dd deZyG dd̈́ deZG ddτ deZG ddф deZG ddӄ deZG ddՄ deZeeqeeeeeeed֜	ec_eqeeeeeeedלee_e5e6e7epede9ededeed؜
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/   2/tmp/pip-unpacked-wheel-fr05hfkd/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v2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   rJ   {   s   rJ   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   rL      s   rL   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_algorithmr9   N)r+   r,   r-   r   r   r   r.   r/   r/   r/   r0   rV      s   rV   c                   @   s   e Zd ZeZdS )SetOfContentTypeN)r+   r,   r-   rL   _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-   rJ   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-   rV   r]   r/   r/   r/   r0   ra      s   ra   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 Nrc   
_oid_specsgetnativer`   selfr/   r/   r0   _values_spec   s    zCMSAttribute._values_specre   N)r+   r,   r-   r?   r.   rh   rm   _spec_callbacksr/   r/   r/   r0   rb      s    rb   c                   @   s   e Zd ZeZdS )CMSAttributesN)r+   r,   r-   rb   r]   r/   r/   r/   r0   ro      s   ro   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_uidrZ   TN)r+   r,   r-   r%   r   r   r.   r/   r/   r/   r0   rp      s   rp   c                   @   s   e Zd ZdddZdS )AttCertVersionr5   r6   )r   r   Nr=   r/   r/   r/   r0   rs      s   rs   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-   rp   r%   rK   r/   r/   r/   r0   rt      s   rt   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   rx      s   rx   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   subjectrq   r3   serial_numberatt_cert_validity_periodr*   issuer_unique_idrZ   T
extensionsN)r+   r,   r-   rs   rt   r%   r   r   rx   r!   r   r#   r.   r/   r/   r/   r0   ry      s   ry   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-   ry   r   r   r.   r/   r/   r/   r0   r      s   r   c                   @   s   e Zd ZddddZdS )DigestedObjectType
public_keyZpublic_key_certZother_objy_types)r   r   r9   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_idrZ   TrW   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 )
Holderru   r   TrX   entity_namer   object_digest_infor9   N)r+   r,   r-   rp   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 )
V2Formissuer_namerZ   Tru   r   rv   rZ   r   r   N)r+   r,   r-   r%   rp   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_formrY   r   N)r+   r,   r-   r%   r   rK   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   rK   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   TrX   re   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_inforZ   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   TrX   Z	role_namerv   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_secretr8   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 )SecurityCategoryrc   rY   r   valuerv   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_listrz   r   Zsecurity_categoriesrZ   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signrZ   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_eventrZ   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   specZ
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 )AttCertAttributerc   rd   )r   r   r   r   r   r   r   r   c                 C   s   | j | d jtS rf   rg   rk   r/   r/   r0   rm     s    zAttCertAttribute._values_specre   N)r+   r,   r-   r   r.   r   r   r   r   r   r   rh   rm   rn   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holderrq   r3   r|   r}   r*   r~   rZ   Tr   N)r+   r,   r-   rs   r   r   r   r   rx   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_certificaterY   r   Zv1_attr_certr   Zv2_attr_certr9   otherr:   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
        r9   r   r6   r:   N)	superr   validateZ_choicers   loadr   dumprj   )rl   class_tagcontents	__class__r/   r0   r     s    
zCertificateChoices.validate)r+   r,   r-   r"   r1   r   r   r   rK   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-   rL   r   r.   	_oid_pairrh   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-   rL   r   r.   r   rh   r/   r/   r/   r0   r     s
   r   c                   @   s   e Zd ZdefdefgZdS )IssuerAndSerialNumberrq   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 )SignerIdentifierissuer_and_serial_numbersubject_key_identifierrY   r   Nr+   r,   r-   r   r   rK   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   rh   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   rY   r   N)r+   r,   r-   r   r   rK   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sidrW   Zsigned_attrsr   TrX   r2   r3   Zunsigned_attrsr   N)
r+   r,   r-   r4   r   r   ro   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   TrX   crlsr   signer_infosc                 C   s   | d j dkrtS tS Nr(   r5   rj   r   r   rk   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   rn   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   TrX   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   rY   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
parametersrZ   T)r  r  r   N)	r+   r,   r-   r   r   r.   r   r   rh   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   rY   r   Zoriginator_keyr   N)r+   r,   r-   r   r   r   rK   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   daterZ   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_idrY   r   N)r+   r,   r-   r   r  rK   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
originatorrv   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 )KEKIdentifierkey_identifierr  rZ   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   TrX   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karirY   r   Zkekrir9   Zpwrir:   Zorir;   N)	r+   r,   r-   r  r  r  r  r  rK   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   TrX   N)r+   r,   r-   rL   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   TrX   recipient_infosencrypted_content_infounprotected_attrsr   N)	r+   r,   r-   r4   r   r  r  ro   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   TrX   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(   rW   r   digestc                 C   s   | d j dkrtS tS r   r   rk   r/   r/   r0   r   N  s    z%DigestedData._encap_content_info_specr   N)	r+   r,   r-   r4   r   r   r.   r   rn   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   TrX   N)r+   r,   r-   r4   r  ro   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   TrX   r  r[   rW   r   r   
auth_attrsr9   macunauth_attrsr:   N)r+   r,   r-   r4   r   r  r   r   r   ro   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   TrX   r  Zauth_encrypted_content_infor'  r   r(  r)  r9   N)
r+   r,   r-   r4   r   r  r  ro   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  rZ   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
decompressrj   rk   r/   r/   r0   decompressed  s
    
zCompressedData.decompressed)
r+   r,   r-   r4   r-  r   r.   r/  propertyr2  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  subjectKeyIdentifierr  rZ   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   rY   r   ZrecipientKeyIdr   ZsubjectAltKeyIdentifierr9   N)r+   r,   r-   r   r  r   rK   r/   r/   r/   r0   r5    s   r5  c                   @   s   e Zd ZeZdS )SMIMEEncryptionKeyPreferencesN)r+   r,   r-   r5  r]   r/   r/   r/   r0   r6    s   r6  c                   @   s"   e Zd ZdefdeddifgZdS )SMIMECapabilityIdentifierZcapability_idr  rZ   TN)r+   r,   r-   r
   r   r.   r/   r/   r/   r0   r7    s   r7  c                   @   s   e Zd ZeZdS )SMIMECapabilitesN)r+   r,   r-   r7  r]   r/   r/   r/   r0   r8    s   r8  c                   @   s   e Zd ZeZdS )SetOfSMIMECapabilitesN)r+   r,   r-   r8  r]   r/   r/   r/   r0   r9    s   r9  )	rM   rN   rO   rP   rQ   rR   rS   rT   rU   )rN   rO   rP   rQ   rR   rS   rT   rU   )
r@   rA   rB   rC   rF   rG   rH   rI   rE   rD   )__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   ocspr    x509r!   r"   r#   r$   r%   r&   r'   r1   r4   r?   rJ   rL   rV   r\   r^   r_   r`   ra   rb   ro   rp   rs   rt   rx   ry   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.  r5  r6  r7  r8  r9  rh   r/   r/   r/   r0   <module>   s  
(
D 	
#

	
		

