
     h                        d dl Z d dlmZ d dlmZm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 d d	lmZ d
dgZe ej        dd           e j        d e j        d                     e j        ddded           e j        ddeddd          e j        d                                                                         Ze ej        dd           e j        d e j        d                     e j        ddd           e j        ddded           e j        d d!deddd"          e j        d#                                                                                     ZdS )$    N)ValidationContext)build_vc_kwargstrust_options)signing)pyhanko_exception_manager)IncrementalPdfFileWriter)PdfFileReader)signers
validation)HTTPTimeStamperltv_fix
lta_update	ltaupdatezupdate LTA timestamp)namehelpinfilezr+b)typez--timestamp-urlzURL for timestamp serverT)r   requiredr   defaultz--retroactive-revinfozOTreat revocation info as retroactively valid (i.e. ignore thisUpdate timestamp)F)r   r   is_flagr   show_defaultc           	      0   t                      5  t          | j        j        |||||          }t	          |          }	t          |          }
t          j        |	                              |
t          di |           d d d            d S # 1 swxY w Y   d S )N )
r   r   objconfigr   r	   r
   PdfTimeStamperupdate_archival_timestamp_chainr   )ctxr   validation_contexttrusttrust_replaceother_certstimestamp_urlretroactive_revinfo	vc_kwargstimestamperrs              _/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/pyhanko/cli/commands/validation/ltv.pyr   r      s    < 
#	$	$ 
 
#GN
 
	 &m44&!!{++KK --9--	
 	
 	

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
s   A/BBBltvfixz5add revocation information for a signature to the DSSz--fieldzname of the signature field)r   r   z--apply-lta-timestampz8Apply a document timestamp after adding revocation info.)r   r   r   r   r   r   c	           	      0   |r|st          j        d          t          | j        j        ||||dd          }	d|	d<   t          |          }
	 t          fd|
j        D                       }n&# t          $ r t          j        d d	          w xY wt          j
        |t          di |	d
          }|r]t          |          }t          j        |                              t!          |          t          j        t          di |	d
           d S d S )Nz8Please specify a timestamp server using --timestamp-url.FT)r$   allow_fetchingz	hard-failrevocation_modec              3   2   K   | ]}|j         k    |V  d S )N)
field_name).0sfields     r(   	<genexpr>zltv_fix.<locals>.<genexpr>u   s8       
 
8M8MA8M8M8M8M
 
    z(Could not find a PDF signature labelled .)in_placer   )clickClickExceptionr   r   r   r	   nextembedded_regular_signaturesStopIterationr   add_validation_infor   r   r
   r   timestamp_pdfr   
DEFAULT_MD)r   r   r1   r#   apply_lta_timestampr   r!   r    r"   r%   r'   emb_sigoutputr&   s     `           r(   r   r   A   s   D  
= 
"F
 
 	
  !  I $/I fA
 
 
 
 
4
 
 
 
 
  
 
 
"?u???
 
 	


 +"//Y//$  F  
%m44{++99$V,,**	**	 	: 	
 	
 	
 	
 	

 
s    A0 0#B)r6   pyhanko_certvalidatorr   pyhanko.cli._trustr   r   pyhanko.cli.commands.signingr   pyhanko.cli.runtimer   $pyhanko.pdf_utils.incremental_writerr   pyhanko.pdf_utils.readerr	   pyhanko.signr
   r   pyhanko.sign.timestampsr   __all__commandargumentFileoptionstrboolpass_contextr   r   r   r3   r(   <module>rQ      s    3 3 3 3 3 3 = = = = = = = = 0 0 0 0 0 0 9 9 9 9 9 9 I I I I I I 2 2 2 2 2 2 , , , , , , , , 3 3 3 3 3 3l
# k(>???zuz%00111	#	   
)	   
 
    21 @? (
< 	O   zuz%00111i;dKKK	#	   	C	   0
 0
    LK 21  .0
 0
 0
r3   