
     hl                        d Z ddlmZmZmZmZ 	 ddlZn# e$ r dZY nw xY 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e          Z. G d de          Z/ G d de          Z0 G d de          Z1 G d de          Z2 G d de          Z3 G d de          Z4 G d de          Z5 G d de          Z6 G d de          Z7 G d d e          Z8 G d! d"e          Z9 G d# d$e          Z: G d% d&e          Z; G d' d(e          Z< G d) d*e          Z= G d+ d,e          Z> G d- d.e          Z? G d/ d0e          Z@ G d1 d2e          ZA G d3 d4e          ZB G d5 d6e          ZC G d7 d8e          ZD G d9 d:e          ZE G d; d<e          ZF G d= d>e          ZG G d? d@e          ZH G dA dBe          ZI G dC dDe          ZJ G dE dFe          ZK G dG dHe          ZL G dI dJe          ZM G dK dLe          ZN G dM dNe          ZO G dO dPe          ZP G dQ dRe          ZQ G dS dTe          ZR G dU dVe          ZS G dW dXe          ZT G dY dZe          ZU G d[ d\e          ZV G d] d^e          ZW G d_ d`e          ZX G da dbe          ZY G dc dde          ZZ G de dfe          Z[ G dg dhe          Z\ G di dje          Z] G dk dle          Z^ G dm dne          Z_ G do dpe          Z` G dq dre          Za G ds dte          Zb G du dve          Zc G dw dxe          Zd G dy dze          Ze G d{ d|e          Zf G d} d~e          Zg G d de          Zh G d de          Zi G d de          Zj G d de          Zk G d de          Zl G d de          Zm G d de          Zn G d de          Zo G d de          Zp G d de          Zq G d de          Zr G d de          Zs G d de          Zt G d de	e          Zu G d de          Zv G d de          Zw G d de          Zx G d de          Zy G d de          Zz G d de          Z{ G d de          Z| G d de          Z} G d de          Z~ G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G dÄ de          Z G dń de          Z G dǄ de          Z G dɄ de          Z G d˄ de          Zy G d̄ de          Z G d΄ de          Z G dЄ de          Z G d҄ de          Z G dԄ 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                   $    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     J/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/asn1crypto/cms.pyr)   r)   A   s-        	G	$	z"GGGr2   r)   c                   $    e Zd ZdefdefdefgZdS )ExtendedCertificateextended_certificate_infosignature_algorithm	signatureN)r-   r.   r/   r)   r   r   r0   r1   r2   r3   r5   r5   I   s/        	$&=>	 56	n%GGGr2   r5   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/   _mapr1   r2   r3   r:   r:   W   s,         DDDr2   r:   c                   (    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.1NrF   r1   r2   r3   rI   rI   b   s:         . 0 . 3!5&8&B!;!= ">) DDDr2   rI   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   _alternativesr1   r2   r3   rU   rU   {   s%        	W	_-MMMr2   rU   c            
       &    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.23NrF   r1   r2   r3   rZ   rZ      s5         & - 0 ; / 0%9%6&D
 
DDDr2   rZ   c                   4    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_algorithmr7   r   Timplicitoptionalmac_algorithmrB   N)r-   r.   r/   r	   r   r   r0   r1   r2   r3   re   re      sC        	_-	 5ASW7X7XY	-aT)J)JKGGGr2   re   c                       e Zd ZeZdS )SetOfContentTypeN)r-   r.   r/   rZ   _child_specr1   r2   r3   rl   rl              KKKr2   rl   c                       e Zd ZeZdS )SetOfOctetStringN)r-   r.   r/   r   rm   r1   r2   r3   rp   rp      rn   r2   rp   c                       e Zd ZeZdS )	SetOfTimeN)r-   r.   r/   rU   rm   r1   r2   r3   rr   rr      s        KKKr2   rr   c                       e Zd ZeZdS )SetOfAnyN)r-   r.   r/   r   rm   r1   r2   r3   rt   rt      s        KKKr2   rt   c                       e Zd ZeZdS )SetOfCMSAlgorithmProtectionN)r-   r.   r/   re   rm   r1   r2   r3   rv   rv      s        (KKKr2   rv   c                   ,    e Zd ZdefdgZi Zd ZdeiZdS )CMSAttributetypevaluesNc                 X    | j                             | d         j        t                    S Nry   
_oid_specsgetnativert   selfs    r3   _values_speczCMSAttribute._values_spec   !    ""4<#6AAAr2   r{   N)r-   r.   r/   rI   r0   r   r   _spec_callbacksr1   r2   r3   rx   rx      sH        	!"G
 JB B B 	,OOOr2   rx   c                       e Zd ZeZdS )CMSAttributesN)r-   r.   r/   rx   rm   r1   r2   r3   r   r              KKKr2   r   c                   *    e Zd ZdefdefdeddifgZdS )IssuerSerialissuerserial
issuer_uidri   TN)r-   r.   r/   r&   r   r   r0   r1   r2   r3   r   r      s4        	< 	7	~
D'9:GGGr2   r   c                       e Zd ZdddZdS )AttCertVersionr<   r=   )r   r   NrF   r1   r2   r3   r   r      s          DDDr2   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/   r   r&   rX   r1   r2   r3   r   r      s1        	z1o>	
A7MMMr2   r   c                       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   r0   r1   r2   r3   r   r      s%        	O,	?+GGGr2   r   c                   Z    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   r8   serial_numberatt_cert_validity_periodr,   issuer_unique_idri   T
extensionsN)r-   r.   r/   r   r   r&   r   r   r   r"   r   r$   r0   r1   r2   r3   r   r      st        	NY$56	N#	< 	+,	'"	#%:;	z"	^j$-?@	zJ#56
GGGr2   r   c                   $    e Zd ZdefdefdefgZdS )AttributeCertificateV1ac_infor7   r8   N)r-   r.   r/   r   r   r   r0   r1   r2   r3   r   r      s/        	./	 56	n%GGGr2   r   c                       e Zd ZddddZdS )DigestedObjectType
public_keypublic_key_certother_objy_types)r   r   rB   NrF   r1   r2   r3   r   r      s#         DDDr2   r   c                   0    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_idri   Trf   object_digestN)r-   r.   r/   r   r   r	   r   r0   r1   r2   r3   r   r      s>        	!34	!1J3EF	_-	.)	GGGr2   r   c                   <    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   Trg   entity_namer   object_digest_inforB   N)r-   r.   r/   r   r&   r   r0   r1   r2   r3   r   r     sL        	1$.O.OP	1$&G&GH	/aT1R1RSGGGr2   r   c                   :    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_nameri   Tr   r   r   ri   r   r   N)r-   r.   r/   r&   r   r   r0   r1   r2   r3   r   r     sI        	z4&89	1$.O.OP	/aT1R1RSGGGr2   r   c                   $    e Zd ZdefdeddifgZdS )AttCertIssuerv1_formv2_formrh   r   N)r-   r.   r/   r&   r   rX   r1   r2   r3   r   r     s+        	L!	FZO,MMMr2   r   c                   $    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   rX   r1   r2   r3   r   r     s.        	;	 !	:MMMr2   r   c                       e Zd ZeZdS )IetfAttrValuesN)r-   r.   r/   r   rm   r1   r2   r3   r   r   #          KKKr2   r   c                   &    e Zd ZdedddfdefgZdS )IetfAttrSyntaxpolicy_authorityr   Trg   r{   N)r-   r.   r/   r&   r   r0   r1   r2   r3   r   r   '  s/        	\t+L+LM	>"GGGr2   r   c                       e Zd ZeZdS )SetOfIetfAttrSyntaxN)r-   r.   r/   r   rm   r1   r2   r3   r   r   .  s         KKKr2   r   c                   *    e Zd ZdefdefdeddifgZdS )SvceAuthInfoserviceident	auth_infori   TN)r-   r.   r/   r%   r   r0   r1   r2   r3   r   r   2  s4        	K 	+	kJ#56GGGr2   r   c                       e Zd ZeZdS )SetOfSvceAuthInfoN)r-   r.   r/   r   rm   r1   r2   r3   r   r   :  r   r2   r   c                   ,    e Zd ZdedddfdeddifgZdS )	
RoleSyntaxrole_authorityr   Trg   	role_namer   r   N)r-   r.   r/   r&   r%   r0   r1   r2   r3   r   r   >  s5        	<aT)J)JK	kJ?3GGGr2   r   c                       e Zd ZeZdS )SetOfRoleSyntaxN)r-   r.   r/   r   rm   r1   r2   r3   r   r   E          KKKr2   r   c                        e Zd ZdddddddZdS )		ClassListunmarkedunclassified
restrictedconfidentialsecret
top_secretrA   NrF   r1   r2   r3   r   r   I  s,         DDDr2   r   c                   *    e Zd ZdeddifdeddifgZdS )SecurityCategoryry   rh   r   valuer   r   Nr-   r.   r/   r   r   r0   r1   r2   r3   r   r   T  s2        	!J?3	#
A'GGGr2   r   c                       e Zd ZeZdS )SetOfSecurityCategoryN)r-   r.   r/   r   rm   r1   r2   r3   r   r   [          "KKKr2   r   c                   D    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_categoriesri   TN)r-   r.   r/   r   r   setr   r0   r1   r2   r3   r   r   _  sJ        	&'	y9cc>2B.C.C"DE	 5
D7IJGGGr2   r   c                       e Zd ZeZdS )SetOfClearanceN)r-   r.   r/   r   rm   r1   r2   r3   r   r   g  s        KKKr2   r   c                   *    e Zd ZdefdefdeddifgZdS )BigTimemajorfractional_secondssignri   TN)r-   r.   r/   r   r0   r1   r2   r3   r   r   k  s4        	'	w'	:t,-GGGr2   r   c                       e Zd ZdefdefgZdS )LeapData	leap_timeactionN)r-   r.   r/   r   r   r0   r1   r2   r3   r   r   s  s%        	g	7GGGr2   r   c                       e Zd ZeZdS )SetOfLeapDataN)r-   r.   r/   r   rm   r1   r2   r3   r   r   z  s        KKKr2   r   c                   6    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_eventri   TN)r-   r.   r/   r   r   r0   r1   r2   r3   r   r   ~  sD        	W	7	'	w	}z4&89GGGr2   r   c                       e Zd ZeZdS )SetOfTimingMetricsN)r-   r.   r/   r   rm   r1   r2   r3   r   r     r   r2   r   c                   :    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   r0   r1   r2   r3   r  r    sI        	j6+;"<=	wQD A AB	gA4@@AGGGr2   r  c                       e Zd ZeZdS )SetOfTimingPolicyN)r-   r.   r/   r  rm   r1   r2   r3   r  r    r   r2   r  c            	       $    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.2NrF   r1   r2   r3   r	  r	    s2        3/1%"2"1	 	DDDr2   r	  c            	       >    e Zd ZdefdgZeeeeeee	e
dZd ZdeiZdS )AttCertAttributery   rz   )r
  r  r  r  r  r  r  r  c                 X    | j                             | d         j        t                    S r}   r~   r   s    r3   r   zAttCertAttribute._values_spec  r   r2   r{   N)r-   r.   r/   r	  r0   r   r   r   r   r   r  r   r   r   r1   r2   r3   r  r    sg        	%&G  1,0$#,*	 	JB B B 	,OOOr2   r  c                       e Zd ZeZdS )AttCertAttributesN)r-   r.   r/   r  rm   r1   r2   r3   r  r    r   r2   r  c                   T    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   r8   r   r   r,   r   ri   Tr   N)r-   r.   r/   r   r   r   r   r   r   r  r   r$   r0   r1   r2   r3   r  r    sn        	N#	6	=!	+,	'"	#%:;	()	^j$-?@	zJ#56
GGGr2   r  c                   (    e Zd ZdZdefdefdefgZdS )AttributeCertificateV2r   r   r7   r8   N)r-   r.   r/   _bad_tagr  r   r   r0   r1   r2   r3   r  r    s6        H 
./	 56	n%GGGr2   r  c                       e Zd ZdefdefgZdS )OtherCertificateFormatother_cert_format
other_certNr   r1   r2   r3   r  r    s&        	./	sGGGr2   r  c                   X     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Z	 xZ
S )CertificateChoicesr+   extended_certificaterh   r   v1_attr_certr   v2_attr_certrB   otherrC   c                 "   t          t          |                               |||           | j        dk    rVt                              t          j        |          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
        rB   r   r=   rC   N)	superr"  validate_choicer   loadr   dumpr   )r   class_tagcontents	__class__s       r3   r)  zCertificateChoices.validate  s    ( 	 $''00hGGG<1""8=#:#:1#=#B#B#D#DEELPTTT  TTr2   )r-   r.   r/   r#   r5   r   r  r  rX   r)  __classcell__)r0  s   @r3   r"  r"    s        	$	!4z1oF	/*aA	/*aA	(:q/:M! ! ! ! ! ! ! ! !r2   r"  c                       e Zd ZeZdS )CertificateSetN)r-   r.   r/   r"  rm   r1   r2   r3   r3  r3    s        $KKKr2   r3  c                   .    e Zd ZdefdedddfgZdZi ZdS )ContentInforJ   contentr   Tr   rJ   r6  N)r-   r.   r/   rZ   r   r0   	_oid_pairr   r1   r2   r3   r5  r5  	  s;        	%	CaT::;G
 ,IJJJr2   r5  c                       e Zd ZeZdS )SetOfContentInfoN)r-   r.   r/   r5  rm   r1   r2   r3   r:  r:    rn   r2   r:  c                   .    e Zd ZdefdedddfgZdZi ZdS )EncapsulatedContentInforJ   r6  r   Tr   r7  N)r-   r.   r/   rZ   r   r0   r8  r   r1   r2   r3   r<  r<    s<        	%	'aT)J)JKG
 ,IJJJr2   r<  c                       e Zd ZdefdefgZdS )IssuerAndSerialNumberr   r   N)r-   r.   r/   r'   r   r0   r1   r2   r3   r>  r>  !  s%        	4	'"GGGr2   r>  c                   $    e Zd ZdefdeddifgZdS )SignerIdentifierissuer_and_serial_numbersubject_key_identifierrh   r   Nr-   r.   r/   r>  r   rX   r1   r2   r3   r@  r@  (  ,        	#%:;	!;Q@MMMr2   r@  c                       e Zd ZeZdS )DigestAlgorithmsN)r-   r.   r/   r	   rm   r1   r2   r3   rF  rF  /          !KKKr2   rF  c                       e Zd ZeZdS )CertificateRevocationListsN)r-   r.   r/   r   rm   r1   r2   r3   rI  rI  3  rG  r2   rI  c                   &    e Zd ZdedddfdefgZdS )
SCVPReqResrequestr   Tr   responseN)r-   r.   r/   r5  r0   r1   r2   r3   rK  rK  7  s/        	KaT!B!BC	[!GGGr2   rK  c                       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.4NrF   r1   r2   r3   rO  rO  >  s         -$ DDDr2   rO  c                   ,    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)rT  rU  )rP  rQ  N)
r-   r.   r/   rO  r   r0   r8  r!   rK  r   r1   r2   r3   rS  rS  E  s?        	 "67	3G
 <I% JJJr2   rS  c                   $    e Zd ZdefdeddifgZdS )RevocationInfoChoicecrlr&  rh   r   N)r-   r.   r/   r   rS  rX   r1   r2   r3   rW  rW  R  s,        	 	+j!_=MMMr2   rW  c                       e Zd ZeZdS )RevocationInfoChoicesN)r-   r.   r/   rW  rm   r1   r2   r3   rZ  rZ  Y  s        &KKKr2   rZ  c                   L    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*   sidrf   signed_attrsr   Trg   r7   r8   unsigned_attrsr   N)
r-   r.   r/   r:   r@  r	   r   r   r   r0   r1   r2   r3   r\  r\  ]  sc        	J	 !	_-	QD(I(IJ	 56	k"	=qd*K*KLGGGr2   r\  c                       e Zd ZeZdS )SignerInfosN)r-   r.   r/   r\  rm   r1   r2   r3   ra  ra  i  r   r2   ra  c            	       P    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 Z	de	iZ
dS )
SignedDatar*   digest_algorithmsencap_content_infoNcertificatesr   Trg   crlsr   signer_infosc                 @    | d         j         dk    rt          S t          S Nr*   r<   r   r<  r5  r   s    r3   _encap_content_info_specz#SignedData._encap_content_info_specw  $     	?!T))**
 r2   rf  N)r-   r.   r/   r:   rF  r3  rZ  ra  r0   rm  r   r1   r2   r3   rc  rc  m  st        	J	./$	aT)J)JK	&QD(I(IJ	%G   	6OOOr2   rc  c                   .    e Zd ZdedddfdedddfgZdS )OriginatorInfocertsr   Trg   rh  r   N)r-   r.   r/   r3  rZ  r0   r1   r2   r3   rp  rp    s:        	.qd"C"CD	&QD(I(IJGGGr2   rp  c                   $    e Zd ZdefdeddifgZdS )RecipientIdentifierrA  rB  rh   r   NrC  r1   r2   r3   rs  rs    rD  r2   rs  c            
       <    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  )	rsarv  rw  rx  ry  rz  r{  r|  r}  N)r-   r.   r/   rG   _reverse_mapr1   r2   r3   ru  ru    s[         0 ,"/"3#0#4#0#4	 	D &0,/30404
 
LLLr2   ru  c                   0    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
parametersri   T)r  r  rw  N)	r-   r.   r/   ru  r   r0   r8  r   r   r1   r2   r3   r  r    s@        	./	sZ./G
 ,IoJJJr2   r  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/   r:   rs  r  r   r0   r1   r2   r3   r  r    s7        	J	#$	#%;<	+&	GGGr2   r  c                   0    e Zd ZdefdeddifdeddifgZdS )OriginatorIdentifierOrKeyrA  rB  rh   r   originator_keyr   N)r-   r.   r/   r>  r   r    rX   r1   r2   r3   r  r    s:        	#%:;	!;Q@	=:q/:MMMr2   r  c                       e Zd ZdefdefgZdS )OtherKeyAttributekey_attr_idkey_attrNr   r1   r2   r3   r  r    s&        	()	SGGGr2   r  c                   0    e Zd ZdefdeddifdeddifgZdS )RecipientKeyIdentifierrB  dateri   Tr&  Nr-   r.   r/   r   r   r  r0   r1   r2   r3   r  r    s<        	!;/	:t"45	#j$%78GGGr2   r  c                   $    e Zd ZdefdeddifgZdS )KeyAgreementRecipientIdentifierrA  r_key_idrh   r   N)r-   r.   r/   r>  r  rX   r1   r2   r3   r  r    s-        	#%:;	+j!_=MMMr2   r  c                       e Zd ZdefdefgZdS )RecipientEncryptedKeyr  r  N)r-   r.   r/   r  r   r0   r1   r2   r3   r  r    s&        	/0	+&GGGr2   r  c                       e Zd ZeZdS )RecipientEncryptedKeysN)r-   r.   r/   r  rm   r1   r2   r3   r  r    s        'KKKr2   r  c                   >    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/   r:   r  r   r  r  r0   r1   r2   r3   r  r    sP        	J	0:q/B	!>>?	#%;<	#%;<GGGr2   r  c                   0    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  ri   Tr&  Nr  r1   r2   r3   r  r    s<        	;'	:t"45	#j$%78GGGr2   r  c                   *    e Zd ZdefdefdefdefgZdS )KEKRecipientInfor*   kekidr  r  N)r-   r.   r/   r:   r  r  r   r0   r1   r2   r3   r  r    s6        	J	- 	#%;<	+&	GGGr2   r  c                   2    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   Trg   r  r  N)r-   r.   r/   r:   r   r  r   r0   r1   r2   r3   r  r  
  s@        	J	#\t3T3TU	#%;<	+&	GGGr2   r  c                       e Zd ZdefdefgZdS )OtherRecipientInfoori_type	ori_valueNr   r1   r2   r3   r  r    s&        	%&	cGGGr2   r  c                   H    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karirh   r   kekrirB   pwrirC   orirD   N)	r-   r.   r/   r  r  r  r  r  rX   r1   r2   r3   r  r    sZ        	&'	&Q8	"ZO4	&Q8	"ZO4MMMr2   r  c                       e Zd ZeZdS )RecipientInfosN)r-   r.   r/   r  rm   r1   r2   r3   r  r  $  r   r2   r  c                   ,    e Zd ZdefdefdedddfgZdS )EncryptedContentInforJ   content_encryption_algorithmencrypted_contentr   Trg   N)r-   r.   r/   rZ   r
   r   r0   r1   r2   r3   r  r  (  s8        	%	')<=	kt+L+LMGGGr2   r  c            	       @    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   Trg   recipient_infosencrypted_content_infounprotected_attrsr   N)	r-   r.   r/   r:   rp  r  r  r   r0   r1   r2   r3   r  r  0  sR        	J	N,M,MN	N+	!#78	m!-N-NOGGGr2   r  c            
       L    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  rd  r  rg  r   Trg   rh  r   ri  N)r-   r.   r/   r:   r  rF  r  r3  rI  ra  r0   r1   r2   r3   r  r  :  sd        	J	N+	./	!#78	aT)J)JK	+!-N-NO	%GGGr2   r  c                   4    e Zd ZdefdefddefgZd ZdeiZdS )DigestedDatar*   rf   re  digestc                 @    | d         j         dk    rt          S t          S rk  rl  r   s    r3   rm  z%DigestedData._encap_content_info_specN  rn  r2   rf  N)	r-   r.   r/   r:   r	   r   r0   rm  r   r1   r2   r3   r  r  F  sN        	J	_-$	;	G   	6OOOr2   r  c                   ,    e Zd ZdefdefdedddfgZdS )EncryptedDatar*   r  r  r   Trg   N)r-   r.   r/   r:   r  r   r0   r1   r2   r3   r  r  a  s8        	J	!#78	m!-N-NOGGGr2   r  c                   h    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   Trg   r  rj   rf   r   rf  
auth_attrsrB   macunauth_attrsrC   N)r-   r.   r/   r:   rp  r  r   r	   r<  r   r   r0   r1   r2   r3   r  r  i  s        	J	N,M,MN	N+	-(	_1$.O.OP 
67	}1$&G&GH		QD(I(IJGGGr2   r  c                   T    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   Trg   r  auth_encrypted_content_infor  r   r  r  rB   N)
r-   r.   r/   r:   rp  r  r  r   r   r0   r1   r2   r3   r  r  y  sl        	J	N,M,MN	N+	&(<=	}1$&G&GH		QD(I(IJGGGr2   r  c                       e Zd ZddiZdS )CompressionAlgorithmIdz1.2.840.113549.1.9.16.3.8zlibNrF   r1   r2   r3   r  r    s        #VDDDr2   r  c                   $    e Zd ZdefdeddifgZdS )CompressionAlgorithmr  r  ri   TN)r-   r.   r/   r  r   r0   r1   r2   r3   r  r    s-        	,-	sZ./GGGr2   r  c                   >    e Zd ZdefdefdefgZdZed             Z	dS )CompressedDatar*   compression_algorithmrf  Nc                     | j         @t          t          d          t          j        | d         d         j                  | _         | j         S )Nz The zlib module is not availablerf  r6  )_decompressedr  SystemError
decompressr   r   s    r3   decompressedzCompressedData.decompressed  sH    %|!"DEEE!%6J1KI1V1]!^!^D!!r2   )
r-   r.   r/   r:   r  r<  r0   r  propertyr  r1   r2   r3   r  r    sU        	J	 "67	67G M" " X" " "r2   r  c                   0    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  ri   Tr&  Nr  r1   r2   r3   r  r    s<        	-	:t"45	#j$%78GGGr2   c                   6    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 )	SMIMEEncryptionKeyPreferencerA  rh   r   recipientKeyIdr   subjectAltKeyIdentifierrB   N)r-   r.   r/   r>  r  r    rX   r1   r2   r3   r  r    sA        	#%:ZOL	1J?C	"MJ?CMMMr2   r  c                       e Zd ZeZdS )SMIMEEncryptionKeyPreferencesN)r-   r.   r/   r  rm   r1   r2   r3   r  r    s        .KKKr2   r  c                   $    e Zd ZdefdeddifgZdS )SMIMECapabilityIdentifiercapability_idr  ri   TN)r-   r.   r/   r   r   r0   r1   r2   r3   r  r    s-        	/0	sZ./GGGr2   r  c                       e Zd ZeZdS )SMIMECapabilitesN)r-   r.   r/   r  rm   r1   r2   r3   r  r    s        +KKKr2   r  c                       e Zd ZeZdS )SetOfSMIMECapabilitesN)r-   r.   r/   r  rm   r1   r2   r3   r  r    r   r2   r  )	r[   r\   r]   r^   r_   r`   ra   rb   rc   )r\   r]   r^   r_   r`   ra   rb   rc   )
rJ   rK   rL   rM   rP   rQ   rR   rS   rO   rN   )__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   rX  r   keysr    ocspr!   x509r"   r#   r$   r%   r&   r'   r)   r5   r:   rI   rU   rZ   re   rl   rp   rr   rt   rv   rx   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  r:  r<  r>  r@  rF  rI  rK  rO  rS  rW  rZ  r\  ra  rc  rp  rs  ru  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   r1   r2   r3   <module>r     s1   & S R R R R R R R R R R RKKKK   DDD	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	                                 " !                       V V V V V V V V V V V V V V V V    h       (              '   2    6       "       X       u       u              u   ) ) ) ) )% ) ) )    8        E       8       W       V       H              X              x       X       X       F       F            Z          X   ! ! ! ! !% ! ! !    8                     e       	       x   # # # # #E # # #           U       h       x       E       H                      8          
 
 
 
 
+ 
 
 
    x   2# # # # #
 # # #           X       X    !  !  !  !  !  !  !  !F% % % % %U % % %    (       u       h       H       v   " " " " "u " " "" " " " " " " "           +   
 
 
 
 
 
 
 
    6   ' ' ' ' 'E ' ' '	 	 	 	 	 	 	 	    %          :    X       &       /   2	 	 	 	 	18 	 	 	    H                     X       f       H   ( ( ( ( (Z ( ( (    H       H       x       H              F            U          8       H   	 	 	 	 	X 	 	 	    8   6    H           	 	 	 	 	 	 	 	    -       8   " " " " "X " " "$    X       6   / / / / /E / / /       , , , , ,z , , ,# # # # #E # # #
 #!7!#+%$5
 
  #!7!#+%$5	& 	&  " %&$"2 ;"2"25/    s    