§
    ¥”jO€  ã                   óÔ  — d dl Z d dl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mZmZmZmZ d dlmZmZmZmZmZ d dl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% ddl&m'Z'm(Z(m)Z) ddl*m+Z+m,Z, ddl-m.Z.m/Z/ ddl0m1Z1m2Z2 ddl3m4Z4 g d¢Z5 e j6        e7¦  «        Z8 ed¬¦  «         G d„ d¦  «        ¦   «         Z9 ed¬¦  «         G d„ d¦  «        ¦   «         Z: ed¬¦  «         G d„ de:¦  «        ¦   «         Z; ed¬¦  «         G d„ d¦  «        ¦   «         Z< ed¬¦  «         G d „ d!e<¦  «        ¦   «         Z=d"ee>         d#e>d$e?d%e@fd&„ZA G d'„ d(¦  «        ZB G d)„ d*¦  «        ZC ed¬¦  «         G d+„ d,¦  «        ¦   «         ZD ed¬¦  «         G d-„ d.¦  «        ¦   «         ZEd/„ ZFd0„ ZGd1„ ZHd2„ ZI ed¬¦  «         G d3„ d4eEe:¦  «        ¦   «         ZJe G d5„ d6e"¦  «        ¦   «         ZK ed¬¦  «         G d7„ d8¦  «        ¦   «         ZL ed¬¦  «         G d9„ d:eLeJ¦  «        ¦   «         ZM ed¬¦  «         G d;„ d<eLe;¦  «        ¦   «         ZN	 dBd>eJd?eee>e>f                  d@e>fdA„ZOdS )Cé    N)Údefaultdict)Ú	dataclass)Údatetime)Úunique)
ÚAnyÚClassVarÚ
CollectionÚDictÚIterableÚListÚOptionalÚSetÚTupleÚUnion)ÚcmsÚcoreÚcrlÚkeysÚx509)ÚPathBuildingErrorÚPathValidationErrorÚValidationError)ÚValidationPath)ÚACValidationResulté   )ÚOrderedEnumé   )ÚAdESFailureÚAdESSubIndic)Ú
DiffResultÚModificationLevelÚSuspiciousModificationé   )ÚSignatureValidationErrorÚSigSeedValueValidationError)ÚQcPrivateKeyManagementTypeÚQualificationResult)ÚQTST_URIÚ
QcCertType)ÚKeyUsageConstraints)ÚCAdESSignerAttributeAssertionsÚCertifiedAttributeInfoÚCertifiedAttributesÚClaimedAttributesÚDocumentTimestampStatusÚModificationInfoÚPdfSignatureStatusÚRevocationDetailsÚSignatureCoverageLevelÚSignatureStatusÚSignerAttributeStatusÚStandardCMSSignatureStatusÚTimestampSignatureStatusÚX509AttributeInfoÚformat_pretty_print_detailsT)Úfrozenc                   ó@   — e Zd ZU dZeed<   	 eed<   	 ej        ed<   dS )r2   zQ
    Contains details about a certificate revocation related to a signature.
    Ú
ca_revokedÚrevocation_dateÚrevocation_reasonN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚboolÚ__annotations__r   r   Ú	CRLReason© ó    úm/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/pyhanko/sign/validation/status.pyr2   r2   =   sV   € € € € € € ðð ð ÐÐÑðð
 ÐÐÑðð ”}Ð$Ð$Ñ$ðð rG   r2   c                   óà  — e Zd ZU dZeed<   	 eed<   	 ee         ed<   	 ej	        ed<   	 e
ed<   	 e
ed<   	 ee         ed<   	 ee         ed	<   	 ee         ed
<   	 dhZeee
                  ed<   	 dZeeee
                           ed<   	 ee         ed<   	 ee         ed<   	 d„ Zedefd„¦   «         Zedefd„¦   «         Zdde
fd„Ze	 ddee         defd„¦   «         Zede
fd„¦   «         ZdS )r4   zE
    Class describing the validity of a (general) CMS signature.
    ÚintactÚvalidÚtrust_problem_indicÚsigning_certÚpkcs7_signature_mechanismÚmd_algorithmÚvalidation_pathÚrevocation_detailsÚerror_time_horizonÚnon_repudiationÚ	key_usageNÚextd_key_usageÚvalidation_timeÚqualification_resultc              #   ó†   K  — | j         rd}n| j        rd}nd}|V — | j        r| j        j        j        rdV — d S dV — d S d S )NÚTRUSTEDÚREVOKEDÚ	UNTRUSTEDÚ	QUALIFIEDÚNOT_QUALIFIED)ÚtrustedÚrevokedrW   ÚstatusÚ	qualified)ÚselfÚcert_statuss     rH   Úsummary_fieldszSignatureStatus.summary_fields¶   sƒ   è è € ØŒ<ð 	&Ø#ˆKˆKØŒ\ð 	&Ø#ˆKˆKà%ˆKØÐÐÐØÔ$ð 	&ØÔ(Ô/Ô9ð &Ø!Ð!Ð!Ð!Ð!Ð!à%Ð%Ð%Ð%Ð%Ð%ð		&ð 	&rG   Úreturnc                 ó   — | j         duS )z°
        Reports whether the signer's certificate has been revoked or not.
        If this field is ``True``, then obviously :attr:`trusted` will be
        ``False``.
        N)rQ   ©rb   s    rH   r_   zSignatureStatus.revokedÄ   s   € ð Ô&¨dÐ2Ð2rG   c                 óB   — | j         o| j        o| j        du o| j        duS )zš
        Reports whether the signer's certificate is trusted w.r.t. the currently
        relevant validation context and key usage requirements.
        N)rK   rJ   rL   rP   rg   s    rH   r^   zSignatureStatus.trustedÍ   s:   € ð ŒJð 1Ø”ð1àÔ(¨DÐ0ð1ð Ô$¨DÐ0ð		
rG   ú,c                 óv   — | j         r1| j        r*d|                     |                      ¦   «         ¦  «        z   S dS )zQ
        Provide a textual but machine-parsable summary of the validity.
        zINTACT:ÚINVALID)rJ   rK   Újoinrd   )rb   Ú	delimiters     rH   ÚsummaryzSignatureStatus.summaryÛ   s?   € ð Œ;ð 	˜4œ:ð 	Ø˜yŸ~š~¨d×.AÒ.AÑ.CÔ.CÑDÔDÑDÐDà�9rG   Úkey_usage_settingsc                 ó”   — |pt          ¦   «         }t          |j        €| j        n|j        |j        €| j        n|j        ¬¦  «        }|S )N)rT   rU   )r*   rT   rU   )Úclsro   s     rH   Údefault_usage_constraintsz)SignatureStatus.default_usage_constraintsä   si   € ð 0ÐHÕ3FÑ3HÔ3HÐÝ0ð &Ô/Ð7ð ”�à'Ô1ð &Ô4Ð<ð Ô"Ð"à'Ô6ð
ñ 
ô 
Ðð "Ð!rG   c                 óF   — | j         �| j         d         }|j        j        S dS )Nr   zNo path to trust anchor found.)rP   ÚsubjectÚhuman_friendly)rb   Útrust_anchors     rH   Ú_trust_anchorzSignatureStatus._trust_anchor÷   s*   € àÔÐ+Ø-1Ô-AÀ!Ô-DˆLØÔ'Ô6Ð6à3Ð3rG   )ri   ©N)r?   r@   rA   rB   rC   rD   r   r   r   ÚCertificateÚstrr   r2   r   rT   r   r   rU   r'   rd   Úpropertyr_   r^   rn   Úclassmethodr*   rr   rw   rF   rG   rH   r4   r4   T   s8  € € € € € € ðð ð €L€L�Lðð €K€K�Kðð " ,Ô/Ð/Ð/Ñ/ðð
 Ô"Ð"Ð"Ñ"ðð  #Ð"Ð"Ñ"ðð
 ÐÐÑðð ˜nÔ-Ð-Ð-Ñ-ðð
 !Ð!2Ô3Ð3Ð3Ñ3ðð
 ! Ô*Ð*Ð*Ñ*ðð &7Ð$7€Iˆx˜˜CœÔ!Ð7Ð7Ñ7ðð
 48€N�H˜X c¨#¤hÔ/Ô0Ð7Ð7Ñ7ðð ˜hÔ'Ð'Ð'Ñ'ðð #Ð#6Ô7Ð7Ð7Ñ7ð	ð&ð &ð &ð ð3˜ð 3ð 3ð 3ñ „Xð3ð ð

˜ð 

ð 

ð 

ñ „Xð

ðð ¨ð ð ð ð ð àAEð"ð "Ø!)Ð*=Ô!>ð"à	ð"ð "ð "ñ „[ð"ð$ ð4˜sð 4ð 4ð 4ñ „Xð4ð 4ð 4rG   r4   c                   óf   — e Zd ZU dZ e¦   «         Zeee                  e	d<   	 dhZ
	 ee	d<   	 d„ ZdS )r7   zG
    Signature status class used when validating timestamp tokens.
    rT   Útime_stampingÚ	timestampc                 óæ   — | j         }d| j        r	| j        rdnd› d|j        j        › d|j                             ¦   «         › d|j                             ¦   «         › d| j        › d| j	        rdnd› d	�S )
Nz`This timestamp is backed by a time stamping authority.
The timestamp token is cryptographically Ú Úunz!sound.
TSA certificate subject: "z$"
TSA certificate SHA1 fingerprint: z%
TSA certificate SHA256 fingerprint: z
TSA cert trust anchor: "z"
The TSA certificate is ztrusted.)
rM   rJ   rK   rt   ru   Úsha1ÚhexÚsha256rw   r^   )rb   Útsas     rH   Údescribe_timestamp_trustz1TimestampSignatureStatus.describe_timestamp_trust  s¬   € ØÔˆð6à”[Ð9 T¤ZÐ9ˆrˆr°Tð6ð 6ð +.¬+Ô*Dð6ð 6ð 25´·²±´ð	6ð 6ð
 47´:·>²>Ñ3CÔ3Cð6ð 6ð )-Ô(:ð6ð 6ð ”\Ð+ˆrˆr tð6ð 6ð 6ð
	
rG   N)r?   r@   rA   rB   ÚsetrT   r   r   rz   rD   rU   r   r‡   rF   rG   rH   r7   r7      sw   € € € € € € ðð ð %( C¡E¤E€Iˆx˜˜CœÔ!Ð)Ð)Ñ)ðð &Ð&€Nðð
 ÐÐÑðð
ð 
ð 
ð 
ð 
rG   r7   c                   óJ   — e Zd ZU dZej        ed<   	 eej	                 ed<   dS )r8   z%
    Info on an X.509 attribute.
    Ú	attr_typeÚattr_valuesN)
r?   r@   rA   rB   r   ÚAttCertAttributeTyperD   r   r   Ú	Asn1ValuerF   rG   rH   r8   r8   &  sK   € € € € € € ðð ð Ô'Ð'Ð'Ñ'ðð ˜$œ.Ô)Ð)Ð)Ñ)ðð rG   r8   c                   ó*   — e Zd ZU dZee         ed<   dS )r,   zI
    Info on a certified attribute, including AC validation results.
    Úvalidation_resultsN)r?   r@   rA   rB   r   r   rD   rF   rG   rH   r,   r,   7  s4   € € € € € € ðð ð !Ð!3Ô4Ð4Ð4Ñ4ðð rG   r,   rŠ   Ú	attr_kindÚerrÚfatalc                 óº   — | sdnd| › d�}d|› d|› d|j         d         › �}|rt          |t          j        ¬¦  «        |‚t                               ||¬	¦  «         d S )
Nzunknown typeztype 'ú'zFailed to parse z of z: r   )Úades_subindication)Úexc_info)Úargsr$   r   ÚFORMAT_FAILUREÚloggerÚwarning)rŠ   r�   r‘   r’   Úattr_type_strÚmsgs         rH   Ú_handle_attr_errr�   E  s‰   € ð +4ÐN�N�NÐ9NÀ)Ð9NÐ9NÐ9N€MØ
J˜YÐ
JÐ
J¨MÐ
JÐ
J¸S¼XÀa¼[Ð
JÐ
J€CØð *Ý&Ø¥KÔ$>ð
ñ 
ô 
àð	õ 	�Š�s SˆÑ)Ô)Ð)Ð)Ð)rG   c                   óx   — e Zd ZdZe	 ddee         fd„¦   «         Zdd„Zde	de
fd	„Zd
„ Zd„ Zd„ Zde	defd„ZdS )r-   zJ
    Container class for extracted attribute certificate information.
    FÚresultsc           	      óP  — t          d„ ¦  «        }|D ]¡}|j                             ¦   «         D ]…}|d         j        }	 t	          |d         ¦  «        }n*# t
          $ r}t          |d||¬¦  «         Y d }~ŒHd }~ww xY w||         \  }	}
|	                     |¦  «         |
                     |¦  «         Œ†Œ¢t          ¦   «         }| 
                    ¦   «         D ]N\  }\  }	}
t          t          j        |¦  «        t          |	¦  «        t          |
¦  «        ¬¦  «        |j        |<   ŒO|S )Nc                  ó
   — g g fS rx   rF   rF   rG   rH   ú<lambda>z2CertifiedAttributes.from_results.<locals>.<lambda>]  s
   €   R € rG   ÚtypeÚvalueszcertified attribute©r’   )rŠ   r‹   r�   )r   Úapproved_attributesr¤   ÚnativeÚlistÚ
ValueErrorr�   ÚextendÚappendr-   Úitemsr,   r   rŒ   ÚtupleÚ_attrs)rq   rŸ   Úparse_error_fatalÚby_typeÚresultÚattrrŠ   r¤   ÚeÚtype_valuesÚtype_resultsÚinfoss               rH   Úfrom_resultsz CertifiedAttributes.from_resultsW  sr  € õ Ð(Ð(Ñ)Ô)ð 	ð ð 	,ð 	,ˆFØÔ2×9Ò9Ñ;Ô;ð ,ð ,�Ø  œLÔ/�	ð	Ý! $ x¤.Ñ1Ô1�F�FøÝ!ð ð ð Ý$Ø!Ø-ØØ/ð	ñ ô ð ð �H�H�H�Høøøøðøøøð -4°IÔ,>Ñ)�˜\Ø×"Ò" 6Ñ*Ô*Ð*Ø×#Ò# FÑ+Ô+Ð+Ð+ð,õ  $Ñ%Ô%ˆØ6=·m²m±o´oð 	ð 	Ñ2ˆIÑ2˜ \Ý&<ÝÔ2°9Ñ=Ô=å! +Ñ.Ô.Ý#(¨Ñ#6Ô#6ð	'ñ 'ô 'ˆEŒL˜Ñ#Ð#ð ˆs   ¾AÁ
A;ÁA6Á6A;rb   c                 ó   — i | _         d S rx   ©r®   rg   s    rH   Ú__init__zCertifiedAttributes.__init__z  s   € Ø9;ˆŒˆˆrG   Úitemre   c                 ó   — | j         |         S rx   r¹   ©rb   r»   s     rH   Ú__getitem__zCertifiedAttributes.__getitem__}  ó   € ØŒ{˜4Ô Ð rG   c                 ó*   — t          | j        ¦  «        S rx   ©Úlenr®   rg   s    rH   Ú__len__zCertifiedAttributes.__len__€  ó   € Ý�4”;ÑÔÐrG   c                 ó*   — t          | j        ¦  «        S rx   ©rC   r®   rg   s    rH   Ú__bool__zCertifiedAttributes.__bool__ƒ  ó   € Ý�D”KÑ Ô Ð rG   c                 óN   — t          | j                             ¦   «         ¦  «        S rx   ©Úiterr®   r¤   rg   s    rH   Ú__iter__zCertifiedAttributes.__iter__†  ó   € Ý�D”K×&Ò&Ñ(Ô(Ñ)Ô)Ð)rG   c                 ó   — || j         v S rx   r¹   r½   s     rH   Ú__contains__z CertifiedAttributes.__contains__‰  ó   € Ø�t”{Ð"Ð"rG   N©F)rb   r-   )r?   r@   rA   rB   r|   r   r   r·   rº   rz   r,   r¾   rÃ   rÇ   rÌ   rC   rÏ   rF   rG   rH   r-   r-   R  sÛ   € € € € € ðð ð àFKð ð  ØÐ1Ô2ð ð  ð  ñ „[ð ðD<ð <ð <ð <ð! ð !Ð(>ð !ð !ð !ð !ð ð  ð  ð!ð !ð !ð*ð *ð *ð# ð #¨ð #ð #ð #ð #ð #ð #rG   r-   c                   ó‚   — e Zd ZdZe	 ddeej                 fd„¦   «         Zdd„Z	de
defd	„Zd
„ Zd„ Zd„ Zde
defd„ZdS )r.   z|
    Container class for extracted information on attributes asserted
    by a signer without an attribute certificate.
    FÚattrsc                 óÎ  — t          ¦   «         }t          t          ¦  «        }|D ]m}d }	 |d         j        }t          |d         ¦  «        }n*# t          $ r}t          |d||¬¦  «         Y d }~ŒJd }~ww xY w||                              |¦  «         Œn|                     ¦   «         D ]=\  }}	t          t          j
        |¦  «        t          |	¦  «        ¬¦  «        |j        |<   Œ>|S )Nr£   r¤   zclaimed attributer¥   )rŠ   r‹   )r.   r   r¨   r§   r©   r�   rª   r¬   r8   r   rŒ   r­   r®   )
rq   rÓ   r¯   r¶   r°   r²   rŠ   r¤   r³   r´   s
             rH   Úfrom_iterablezClaimedAttributes.from_iterable“  s  € õ "Ñ#Ô#ˆÝ�dÑ#Ô#ˆØð 
	.ð 
	.ˆDØˆIðØ  œLÔ/�	Ý˜d 8œnÑ-Ô-��øÝð ð ð Ý ØÐ2°AÐ=Nðñ ô ð ð ����øøøøð	øøøð
 �IÔ×%Ò% fÑ-Ô-Ð-Ð-à&-§m¢m¡o¤oð 	ð 	Ñ"ˆI�{Ý&7ÝÔ2°9Ñ=Ô=å! +Ñ.Ô.ð'ñ 'ô 'ˆEŒL˜Ñ#Ð#ð
 ˆs   ª"AÁ
A4ÁA/Á/A4rb   c                 ó   — i | _         d S rx   r¹   rg   s    rH   rº   zClaimedAttributes.__init__­  s   € Ø46ˆŒˆˆrG   r»   re   c                 ó   — | j         |         S rx   r¹   r½   s     rH   r¾   zClaimedAttributes.__getitem__°  r¿   rG   c                 ó*   — t          | j        ¦  «        S rx   rÁ   rg   s    rH   rÃ   zClaimedAttributes.__len__³  rÄ   rG   c                 ó*   — t          | j        ¦  «        S rx   rÆ   rg   s    rH   rÇ   zClaimedAttributes.__bool__¶  rÈ   rG   c                 óN   — t          | j                             ¦   «         ¦  «        S rx   rÊ   rg   s    rH   rÌ   zClaimedAttributes.__iter__¹  rÍ   rG   c                 ó   — || j         v S rx   r¹   r½   s     rH   rÏ   zClaimedAttributes.__contains__¼  rÐ   rG   NrÑ   )rb   r.   )r?   r@   rA   rB   r|   r   r   ÚAttCertAttributerÕ   rº   rz   r8   r¾   rÃ   rÇ   rÌ   rC   rÏ   rF   rG   rH   r.   r.   �  sÜ   € € € € € ðð ð
 àFKðð Ø˜SÔ1Ô2ðð ð ñ „[ðð27ð 7ð 7ð 7ð! ð !Ð(9ð !ð !ð !ð !ð ð  ð  ð!ð !ð !ð*ð *ð *ð# ð #¨ð #ð #ð #ð #ð #ð #rG   r.   c                   óš   — e Zd ZU dZeed<   	 dZee         ed<   	 dZ	ee
eeef                           ed<   	 dZeed<   	 ed„ ¦   «         ZdS )	r+   z„
    Value type describing information extracted (and, if relevant, validated)
    from a ``signer-attrs-v2`` signed attribute.
    Úclaimed_attrsNÚcertified_attrsÚac_validation_errsFÚunknown_attrs_presentc                 ó   — | j          S rx   )rà   rg   s    rH   rK   z$CAdESSignerAttributeAssertions.validê  s   € àÔ*Ð*Ð*rG   )r?   r@   rA   rB   r.   rD   rß   r   r-   rà   r	   r   r   r   rá   rC   r{   rK   rF   rG   rH   r+   r+   À  s»   € € € € € € ðð ð
 %Ð$Ð$Ñ$ðð
 6:€O�XÐ1Ô2Ð9Ð9Ñ9ðð 	ð ˜Ø�5˜Ð*;Ð;Ô<Ô=ôð ð ñ ðð #(Ð˜4Ð'Ð'Ñ'ðð ð+ð +ñ „Xð+ð +ð +rG   r+   c                   ó~   — e Zd ZU dZee         ed<   	 dZeee	e
ef                           ed<   	 dZee         ed<   dS )r5   NÚac_attrsrà   Úcades_signer_attrs)r?   r@   rA   rä   r   r-   rD   rà   r	   r   r   r   rå   r+   rF   rG   rH   r5   r5   ï  s…   € € € € € € à.2€HˆhÐ*Ô+Ð2Ð2Ñ2ðð( 	ð ˜Ø�5Ð,Ð.?Ð?Ô@ÔAôð ð ñ ðð DHÐ˜Ð!?Ô@ÐGÐGÑGðð rG   r5   c                 óv   — t           j        dt           j        dt           j        di                     | d¦  «        S )Nz4The certificate is qualified for web authentication.z<The certificate is qualified for electronic sealing (eSeal).z?The certificate is qualified for electronic signatures (eSign).z The certificate type is unknown.)r)   ÚQC_WEBÚQC_ESEALÚQC_ESIGNÚget)Úqc_types    rH   Údescribe_qc_typerì     s9   € åÔØBåÔØJåÔØMð
÷ 
‚cˆ'Ð5Ñ6Ô6ð
7rG   c                 óv   — t           j        dt           j        dt           j        di                     | d¦  «        S )NzKThe private key is managed in a qualified signature creation device (QSCD).zoThe private key is managed in a qualified signature creation device (QSCD) managed on behalf of the subscriber.z`The private key is managed in a qualified signature creation device (QSCD) (declared by policy).z2The private key management methodology is unknown.)r&   ÚQSCDÚQSCD_DELEGATEDÚQSCD_BY_POLICYrê   )Ú	mgmt_types    rH   Údescribe_key_mgmt_methodologyrò   %  sD   € å"Ô'ð0õ 	#Ô1ð+õ 	#Ô1ð$ð÷ 
‚cˆ)ÐIÑJÔJðKrG   c                 óô   — | j         }|› d|                     ¦   «         › �d|                      ¦   «         › g}| j        r'|                     t          | j        ¦  «        ¦  «         d                     |¦  «        S )Nz timestamp token: z7The token is guaranteed to be newer than the signature.ú
)r   Ú	isoformatr‡   rW   r«   Ú(_describe_timestamp_qualification_statusrl   )Ú
tst_statusÚnatureÚtsÚts_infos       rH   Ú_describe_tstrû   8  s‰   € Ø	Ô	€BàÐ5Ð5 R§\¢\¡^¤^Ð5Ð5ØAØ×.Ò.Ñ0Ô0Ð2ð€Gð
 Ô&ð 
Ø�ŠÝ4ØÔ/ñô ñ	
ô 	
ð 	
ð
 �9Š9�WÑÔÐrG   c           	      ó  — | j         }|j        sdS | j        }|€J ‚|j        j        t
          k    rdnd}d                     d|d|j        j        › d�t          | j         j	        ¦  «        t          | j         j        ¦  «        g¦  «        S )Nz-The time stamping authority is not qualified.z=The time stamping authority is directly identified as a QTST.zAThe time stamping authority is NOT directly identified as a QTST.rô   z8The time stamping authority's certificate is qualified. ú5The associated qualified trusted service provider is ú.)r`   ra   Úservice_definitionÚ	base_infoÚservice_typer(   rl   Úservice_namerò   Úqc_key_securityrì   rë   )ÚqrÚq_statusÚsdÚis_qtsts       rH   rö   rö   H  s­   € ØŒy€HØÔð ?Ø>Ð>à	Ô	€BØˆ>ˆ>ˆ>ð Œ<Ô$­Ò0Ð0ð 	HÐGàPð ð �9Š9àFØð,ØŒ|Ô(ð,ð ,ð ,å)¨"¬)Ô*CÑDÔDÝ˜RœYÔ.Ñ/Ô/ð	
ñ	ô 	ð 	rG   c                   óÂ   ‡ — e Zd ZU dZdZee         ed<   	 dZee	         ed<   	 dZ
ee	         ed<   	 edefd„¦   «         Zˆ fd„Zd	„ Zdeeeef                  fd
„Zˆ xZS )r6   zs
    Status of a standard "end-entity" CMS signature, potentially with
    timing information embedded inside.
    NÚsigner_reported_dtÚtimestamp_validityÚcontent_timestamp_validityre   c                 ó¸   — | j         }|€d}n|j        o|j        o|j        }| j        }|€d}n|j        o|j        o|j        }| j        o| j        o
| j        o|o|S )ab  
        Formulates a general judgment on the validity of this signature.
        This takes into account the cryptographic validity of the signature,
        the signature's chain of trust and the validity of the timestamp token
        (if present).

        :return:
            ``True`` if all constraints are satisfied, ``False`` otherwise.
        NT)r
  rK   rJ   r^   r  )rb   rù   Útimestamp_okÚ
content_tsÚcontent_timestamp_oks        rH   Úbottom_linez&StandardCMSSignatureStatus.bottom_line{  s•   € ð Ô$ˆØˆ:ØˆLˆLàœ8Ð@¨¬	Ð@°b´jˆLàÔ4ˆ
ØÐØ#'Ð Ð ð Ô ÐM ZÔ%6ÐM¸:Ô;Mð !ð
 ŒKð %Ø”
ð%à”ð%ð ð%ð %ð	
rG   c              #   ó*  •K  — t          ¦   «                              ¦   «         E d {V —† | j        � d| j                             d¬¦  «        z  V — | j        � d| j                             d¬¦  «        z  V — | j        �| j        j        sdV — d S d S d S )NzTIMESTAMP_TOKEN<%s>ú|)rm   zCONTENT_TIMESTAMP_TOKEN<%s>ÚCERTIFIED_SIGNER_ATTRS_INVALID)Úsuperrd   r
  rn   r  rå   rK   ©rb   Ú	__class__s    €rH   rd   z)StandardCMSSignatureStatus.summary_fields�  sÚ   øè è € Ý‘7”7×)Ò)Ñ+Ô+Ð+Ð+Ð+Ð+Ð+Ð+Ð+àÔ"Ð.Ø'ØÔ'×/Ò/¸#Ð/Ñ>Ô>ñð ð ð ð Ô*Ð6Ø/ØÔ/×7Ò7À#Ð7ÑFÔFñð ð ð ð Ô#Ð/ØÔ+Ô1ð 0ð 3Ð2Ð2Ð2Ð2Ð2ð 0Ð/Ð/Ð/rG   c                 ó    — t          | ¦  «        S rx   )r9   rg   s    rH   Úpretty_print_detailsz/StandardCMSSignatureStatus.pretty_print_details®  s   € Ý*¨4Ñ0Ô0Ð0rG   c                 ó2  — | j         }| j        rd}n| j        rd}nd}d|j        j        › d|j                             ¦   «         › d|j                             ¦   «         › d| j        › d|› d	�}d
| j	        r	| j
        rdnd› d| j        › d| j        › d�}d| j        v r;|j        d         d         }|j        dk    r|j        }|d|j        › d|j        › d�z  }g }| j        }|�*|                     d|                     ¦   «         › �¦  «         | j        }	|	�#|                     t-          |	d¦  «        ¦  «         | j        }
|
�#|                     t-          |
d¦  «        ¦  «         |sdnd                     |¦  «        }d|fd|fd|fg}| j        rˆ| j        j        }|j        r\| j        j        }|€J ‚d                     d d!|j        j        › d	�t?          |j         ¦  «        tC          |j"        ¦  «        g¦  «        }nd"}|                     d#|f¦  «         |S )$Nr^   r_   Ú	untrustedzCertificate subject: "z "
Certificate SHA1 fingerprint: z!
Certificate SHA256 fingerprint: z
Trust anchor: "z"
The signer's certificate is rþ   z#The signature is cryptographically r�   r‚   z'sound.

The digest algorithm used was 'z%'.
The signature mechanism used was 'z'.ÚecdsaÚ	algorithmÚ
parametersÚnamedz@
The elliptic curve used for the signer's ECDSA public key was 'z' (OID: z).z$Signing time as reported by signer: Ú	SignatureÚContentz0No available information about the signing time.z

zSigner infoÚ	IntegrityzSigning timerô   z&The signer's certificate is qualified.rý   z*The signer's certificate is not qualified.zQualification status)#rM   r^   r_   rt   ru   rƒ   r„   r…   rw   rJ   rK   rO   rN   Ú
public_keyÚnameÚchosenr§   Údottedr	  r«   rõ   r
  rû   r  rl   rW   r`   ra   rÿ   r   r  rò   r  rì   rë   )rb   ÚcertÚtrust_statusÚabout_signerÚvalidity_infoÚ	ec_paramsÚ	curve_oidÚtiming_infosÚreported_tsr÷   Úcontent_tst_statusÚtiming_infoÚsectionsÚsig_q_statusr  Úsig_q_status_reports                   rH   Úpretty_print_sectionsz0StandardCMSSignatureStatus.pretty_print_sections±  s	  € Ø!%Ô!2ˆð Œ<ð 	'Ø$ˆLˆLØŒ\ð 	'Ø$ˆLˆLà&ˆLð; d¤lÔ&Að ;ð ;Ø-1¬Y¯]ª]©_¬_ð;ð ;à/3¬{¯ªÑ/@Ô/@ð;ð ;ð  $Ô1ð;ð ;ð ,8ð	;ð ;ð ;ð 	ð3Ø”[Ð9 T¤ZÐ9ˆrˆr°Tð3ð 3à.2Ô.?ð3ð 3ð Ô.ð	3ð 3ð 3ð 	ð �dÔ4Ð4Ð4Ø15´ÀÔ1MØô2ˆIð Œ~ Ò(Ð(Ø3<Ô3C�	Øð2Ø'0Ô'7ð2ð 2à&Ô-ð2ð 2ð 2ñ�ð ˆØÔ-ˆØÐ"Ø×ÒØP°{×7LÒ7LÑ7NÔ7NÐPÐPñô ð ð Ô,ˆ
àÐ!Ø×Ò¥¨j¸+Ñ FÔ FÑGÔGÐGØ!Ô<ÐØÐ)Ø×Ò¥Ð.@À)Ñ LÔ LÑMÔMÐMð  ð+Ð>Ð>à—’˜\Ñ*Ô*ð 	ð ˜LÐ)Ø˜-Ð(Ø˜[Ð)ð
ˆð Ô$ð 	KØÔ4Ô;ˆLØÔ%ð ØÔ.ÔA�Ø�~�~�~Ø&*§i¢ià@ð8Øœ<Ô4ð8ð 8ð 8å5Ø(Ô8ñô õ )¨Ô)=Ñ>Ô>ðñ
'ô 
'Ð#Ð#ð Að $ð �OŠOÐ3Ð5HÐIÑJÔJÐJàˆrG   )r?   r@   rA   rB   r	  r   r   rD   r
  r7   r  r{   rC   r  rd   r  r   r   rz   r3  Ú__classcell__©r  s   @rH   r6   r6   a  s  ø€ € € € € € ðð ð
 .2Ð˜ Ô*Ð1Ð1Ñ1ðð >BÐ˜Ð!9Ô:ÐAÐAÑAðð
 FJÐ Ð)AÔ BÐIÐIÑIðð
 ð
˜Tð 
ð 
ð 
ñ „Xð
ðB3ð 3ð 3ð 3ð 3ð"1ð 1ð 1ðT t¨E°#°s°(¬OÔ'<ð Tð Tð Tð Tð Tð Tð Tð TrG   r6   c                   ó(   — e Zd ZdZdZ	 dZ	 dZ	 dZdS )r3   a"  
    Indicate the extent to which a PDF signature (cryptographically) covers
    a document. Note that this does *not* pass judgment on whether uncovered
    updates are legitimate or not, but as a general rule, a legitimate signature
    will satisfy at least :attr:`ENTIRE_REVISION`.
    r   r#   r   r   N)r?   r@   rA   rB   ÚUNCLEARÚCONTIGUOUS_BLOCK_FROM_STARTÚENTIRE_REVISIONÚENTIRE_FILErF   rG   rH   r3   r3     sJ   € € € € € ðð ð €Gðð
 #$Ððð €Oðð €Kðð rG   r3   c                   óœ   — e Zd ZU dZee         ed<   	 dZeee	e
f                  ed<   	 dZee         ed<   	 edee         fd„¦   «         ZdS )r0   NÚcoverageÚdiff_resultÚ	docmdp_okre   c                 óö   — | j         }| j        €:|t          j        k    rdS |t          j        k    rt
          j        nt
          j        S t          | j        t          ¦  «        r| j        j
        S t
          j        S )zü
        Indicates the degree to which the document was modified after the
        signature was applied.

        Will be ``None`` if difference analysis results are not available;
        an instance of :class:`.ModificationLevel` otherwise.
        N)r<  r=  r3   r9  r:  r!   ÚNONEÚOTHERÚ
isinstancer    Úmodification_level)rb   r<  s     rH   rC  z#ModificationInfo.modification_levelI  s{   € ð ”=ˆØÔÐ#ØÕ1ÔAÒAÐAà�tð Õ5ÔAÒAÐAõ "Ô&Ð&å&Ô,ðõ
 ˜Ô(­*Ñ5Ô5ð 	+ØÔ#Ô6Ð6å$Ô*Ð*rG   )r?   r@   rA   r<  r   r3   rD   r=  r   r    r"   r>  rC   r{   r!   rC  rF   rG   rH   r0   r0   -  s¢   € € € € € € à15€HˆhÐ-Ô.Ð5Ð5Ñ5ðð HL€K�˜% 
Ð,BÐ BÔCÔDÐKÐKÑKð	ð !%€Iˆx˜Œ~Ð$Ð$Ñ$ðð ð+ HÐ->Ô$?ð +ð +ð +ñ „Xð+ð +ð +rG   r0   c                   ó–   ‡ — e Zd ZU dZdZeed<   	 dZee	         ed<   	 e
defˆ fd„¦   «         Ze
defd„¦   «         Zˆ fd	„Zˆ fd
„Zˆ xZS )r1   z;Class to indicate the validation status of a PDF signature.FÚhas_seed_valuesNÚseed_value_constraint_errorre   c                 ó\   •— t          ¦   «         j        }|o| j        o| j        p| j        du S )a¾  
        Formulates a general judgment on the validity of this signature.
        This takes into account the cryptographic validity of the signature,
        the signature's chain of trust, compliance with the document
        modification policy, seed value constraint compliance and the validity
        of the timestamp token (if present).

        :return:
            ``True`` if all constraints are satisfied, ``False`` otherwise.
        N)r  r  Úseed_value_okr>  rC  )rb   Úgeneric_checks_okr  s     €rH   r  zPdfSignatureStatus.bottom_liner  s@   ø€ õ "™GœGÔ/Ðð ð DØÔ"ðDà”ÐB 4Ô#:¸dÐ#Bð	
rG   c                 ó   — | j         du S )aª  
        Indicates whether the signature satisfies all mandatory constraints in
        the seed value dictionary of the associated form field.

        .. warning::
            Currently, not all seed value entries are recognised by the signer
            and/or the validator, so this judgment may not be entirely accurate
            in some cases.

            See :class:`~.pyhanko.sign.fields.SigSeedValueSpec`.
        N)rF  rg   s    rH   rH  z PdfSignatureStatus.seed_value_ok†  s   € ð Ô/°4Ð7Ð7rG   c              #   óJ  •K  — t          ¦   «                              ¦   «         E d {V —† | j        t          j        k    rdV — n7| j        t          j        k    r| j        �d| j        j        z   V — n	dV — ndV — | j        r| j        t          j        k    rdV — d S d S dV — d S )NÚ	UNTOUCHEDÚEXTENDED_WITH_ÚEXTENDEDÚNONSTANDARD_COVERAGEÚACCEPTABLE_MODIFICATIONSÚILLEGAL_MODIFICATIONS)	r  rd   r<  r3   r:  r9  rC  r#  r>  r  s    €rH   rd   z!PdfSignatureStatus.summary_fields–  sè   øè è € Ý‘7”7×)Ò)Ñ+Ô+Ð+Ð+Ð+Ð+Ð+Ð+Ð+ØŒ=Õ2Ô>Ò>Ð>ØÐÐÐÐØŒ]Õ4ÔDÒDÐDØÔ&Ð2Ø&¨Ô)@Ô)EÑEÐEÐEÐEÐEà Ð Ð Ð Ð à(Ð(Ð(Ð(ØŒ>ð 	*ØŒ}Õ 6Ô BÒBÐBØ0Ð0Ð0Ð0Ð0Ð0ð CÐBð *Ð)Ð)Ð)Ð)Ð)rG   c                 ó°  •— t          ¦   «                              ¦   «         }| j        t          j        k    rd}nN| j        �E| j        t          j        k    rd}n| j        t          j        k    rd}nd}d|› d| j	        rdnd› d	�}nd
}| 
                    d|f¦  «         | j        r0| j        rd}nd| j        j        z   }| 
                    d|f¦  «         |S )Nz%The signature covers the entire file.z1All modifications relate to signature maintenancez?All modifications relate to signing and form filling operationsz&Some modifications may be illegitimatez.The signature does not cover the entire file.
z, and they appear to be r�   Úinz9compatible with the current document modification policy.z'Incremental update analysis was skippedÚModificationsz4There were no SV issues detected for this signature.zXThe signature did not satisfy the SV constraints on the signature field.
Error message: zSeed value constraints)r  r3  r<  r3   r:  rC  r!   ÚLTA_UPDATESÚFORM_FILLINGr>  r«   rE  rH  rF  Úfailure_message)rb   r0  Úmodification_strÚmodlvl_stringÚsv_infor  s        €rH   r3  z(PdfSignatureStatus.pretty_print_sections§  s-  ø€ Ý‘7”7×0Ò0Ñ2Ô2ˆØŒ=Õ2Ô>Ò>Ð>ØFÐÐàÔ&Ð2ØÔ*Õ.?Ô.KÒKÐKàKð "�Mð Ô,Õ0AÔ0NÒNÐNð%ð "�Mð
 %M�Mð<Ø$ð<ð <à!œ^Ð5�r�r°ð<ð <ð <ð !Ð ð $MÐ à�Š˜Ð*:Ð;Ñ<Ô<Ð<ØÔð 		AØÔ!ð ØP��ð<àÔ6ÔFñGð ð
 �OŠOÐ5°wÐ?Ñ@Ô@Ð@àˆrG   )r?   r@   rA   rB   rE  rC   rD   rF  r   r%   r{   r  rH  rd   r3  r4  r5  s   @rH   r1   r1   c  sæ   ø€ € € € € € àEÐEà!€O�TÐ!Ð!Ñ!ðð JNÐ Ð*EÔ!FÐMÐMÑMðð
 ð
˜Tð 
ð 
ð 
ð 
ð 
ñ „Xð
ð& ð8˜tð 8ð 8ð 8ñ „Xð8ð*ð *ð *ð *ð *ð"&ð &ð &ð &ð &ð &ð &ð &ð &rG   r1   c                   ó   — e Zd ZdZdS )r/   zDClass to indicate the validation status of a PDF document timestamp.N)r?   r@   rA   rB   rF   rG   rH   r/   r/   Ð  s   € € € € € àNÐNÐNÐNrG   r/   rF   r`   Úextra_sectionsre   c                 ó  ‡— d„ Št          |                      ¦   «         ¦  «        }|                     |¦  «         d| j        rdnd› d�}|                     d|f¦  «         d                     ˆfd„|D ¦   «         ¦  «        S )	Nc                 óT   — d                      | dt          | ¦  «        z  |df¦  «        S )Nrô   ú-)rl   rÂ   )ÚhdrÚbodys     rH   Úfmt_sectionz0format_pretty_print_details.<locals>.fmt_sectionÙ  s'   € Ø�yŠy˜#˜s¥S¨¡X¤X™~¨t°TÐ:Ñ;Ô;Ð;rG   zThe signature is judged r�   ÚINzVALID.zBottom linerô   c              3   ó6   •K  — | ]\  }} ‰||¦  «        V — Œd S rx   rF   )Ú.0r`  ra  rb  s      €rH   ú	<genexpr>z.format_pretty_print_details.<locals>.<genexpr>â  s3   øè è € ÐFÐF±	°°T�[�[  dÑ+Ô+ÐFÐFÐFÐFÐFÐFrG   )r¨   r3  rª   r  r«   rl   )r`   r\  r0  r  rb  s       @rH   r9   r9   Õ  sž   ø€ ð<ð <ð <õ �F×0Ò0Ñ2Ô2Ñ3Ô3€HØ‡O‚O�NÑ#Ô#Ð#àM¨Ô);Ð#E 2 2ÀÐMÐMÐMð ð ‡O‚O�] KÐ0Ñ1Ô1Ð1Ø�9Š9ÐFÐFÐFÐF¸XÐFÑFÔFÑFÔFÐFrG   )rF   )PÚloggingÚcollectionsr   Údataclassesr   r   Úenumr   Útypingr   r   r	   r
   r   r   r   r   r   r   Ú
asn1cryptor   r   r   r   r   Úpyhanko_certvalidator.errorsr   r   r   Úpyhanko_certvalidator.pathr   Úpyhanko_certvalidator.validater   Úpdf_utils.miscr   Úades.reportr   r   Údiff_analysisr    r!   r"   Úerrorsr$   r%   Úqualified.q_statusr&   r'   Úqualified.tspr(   r)   Úsettingsr*   Ú__all__Ú	getLoggerr?   r™   r2   r4   r7   r8   r,   rz   r©   rC   r�   r-   r.   r+   r5   rì   rò   rû   rö   r6   r3   r0   r1   r/   r9   rF   rG   rH   ú<module>ry     sœ  ðØ €€€Ø #Ð #Ð #Ð #Ð #Ð #Ø !Ð !Ð !Ð !Ð !Ð !Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð 2Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1ðð ð ð ð ð ð ð ð ð ð
 6Ð 5Ð 5Ð 5Ð 5Ð 5Ø =Ð =Ð =Ð =Ð =Ð =à )Ð )Ð )Ð )Ð )Ð )Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3ðð ð ð ð ð ð ð ð ð ð
 JÐ IÐ IÐ IÐ IÐ IÐ IÐ IØ OÐ OÐ OÐ OÐ OÐ OÐ OÐ OØ /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ø )Ð )Ð )Ð )Ð )Ð )ðð ð €ð$ 
ˆÔ	˜8Ñ	$Ô	$€ð €�$ÐÑÔðð ð ð ð ñ ô ñ Ôðð, €�$ÐÑÔðh4ð h4ð h4ð h4ð h4ñ h4ô h4ñ Ôðh4ðV €�$ÐÑÔð"
ð "
ð "
ð "
ð "
˜ñ "
ô "
ñ Ôð"
ðJ €�$ÐÑÔðð ð ð ð ñ ô ñ Ôðð  €�$ÐÑÔð
ð 
ð 
ð 
ð 
Ð.ñ 
ô 
ñ Ôð
ð
*Ø˜Œ}ð
*Ø),ð
*Ø3=ð
*ØFJð
*ð 
*ð 
*ð 
*ð8#ð 8#ð 8#ð 8#ð 8#ñ 8#ô 8#ð 8#ðv0#ð 0#ð 0#ð 0#ð 0#ñ 0#ô 0#ð 0#ðf €�$ÐÑÔð++ð ++ð ++ð ++ð ++ñ ++ô ++ñ Ôð++ð\ €�$ÐÑÔð$ð $ð $ð $ð $ñ $ô $ñ Ôð$ðN7ð 7ð 7ðKð Kð Kð&ð ð ð ð ð ð2 €�$ÐÑÔðcð cð cð cð cÐ!6¸ñ cô cñ ÔðcðL ð!ð !ð !ð !ð !˜[ñ !ô !ñ „ð!ðH €�$ÐÑÔð2+ð 2+ð 2+ð 2+ð 2+ñ 2+ô 2+ñ Ôð2+ðj €�$ÐÑÔðið ið ið ið iÐ)Ð+Eñ iô iñ ÔðiðX €�$ÐÑÔðOð Oð Oð Oð OÐ.Ð0Hñ Oô Oñ ÔðOð 13ðGð GØ&ðGà˜U 3¨ 8œ_Ô-ðGð 	ðGð Gð Gð Gð Gð GrG   