
     h                     ^    d Z ddlmZ ddlmZ ddgZddefd	Z G d
 dej                  ZdS )z
Sign PDF files using a Belgian eID card.

This module defines a very thin convenience wrapper around
:mod:`.pyhanko.sign.pkcs11` to set up a PKCS#11 session with an eID card and
read the appropriate certificates on the device.
    )Session   )pkcs11open_beid_session
BEIDSignerNreturnc                 0    t          j        | |d          S )a  
    Open a PKCS#11 session

    :param lib_location:
        Path to the shared library file containing the eID PKCS#11 module.
        Usually, the file is named ``libbeidpkcs11.so``,
        ``libbeidpkcs11.dylib`` or ``beidpkcs11.dll``, depending on your
        operating system.
    :param slot_no:
        Slot number to use. If not specified, the first slot containing a token
        labelled ``BELPIC`` will be used.
    :return:
        An open PKCS#11 session object.
    BELPIC)slot_notoken_label)sign_pkcs11open_pkcs11_session)lib_locationr   s     M/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/pyhanko/sign/beid.pyr   r      s%    " *g8       c                   8     e Zd ZdZ	 	 	 ddededef fdZ xZS )	r   a+  
    Belgian eID-specific signer implementation that automatically populates
    the (trustless) certificate list with the relevant certificates stored
    on the card.
    This includes the government's (self-signed) root certificate and the
    certificate of the appropriate intermediate CA.
    FTpkcs11_sessionuse_auth_cert
bulk_fetchc                 \    t                                          ||rdndd||           d S )NAuthentication	Signature)RootCA)r   
cert_labelother_certs_to_pullr   embed_roots)super__init__)selfr   r   r   r   	__class__s        r   r   zBEIDSigner.__init__/   sJ     	)+8I''k .!# 	 	
 	
 	
 	
 	
r   )FFT)__name__
__module____qualname____doc__r   boolr   __classcell__)r!   s   @r   r   r   &   ss          $ 
 

 
 	
 
 
 
 
 
 
 
 
 
r   )N)	r%   r   r    r   __all__r   PKCS11Signerr    r   r   <module>r,      s           # # # # # #
- W    ,
 
 
 
 
) 
 
 
 
 
r   