HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib64/python3.6/site-packages/M2Crypto/__pycache__/Engine.cpython-36.pyc
3

���['�@s�ddlmZddlmZmZmZmZmZmZej	rFddl
mZmZm
Z
Gdd�de�Zeje�Gdd�de�Zdd	�Zd
d�Zdd
�Zdd�ZdS)�)�absolute_import)�EVP�Err�X509�m2�six�util)�AnyStr�Callable�Optionalc@seZdZdS)�EngineErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.6/Engine.pyrsrc@s�eZdZdZejZddd�Zdd�Zdd	�Z	d
d�Z
dd
d�Zdd�Zdd�Z
ejfdd�Zddd�Zd dd�Zd!dd�Zdd�ZdS)"�EnginezWrapper for ENGINE object.N�cCsH|r|rtd��||_|js>tj|�|_|js>td|��||_dS)z5Create new Engine from ENGINE pointer or obtain by idzNo engine id specifiedzUnknown engine: %sN)�
ValueError�_ptrrZengine_by_id�_pyfree)�self�idrrrrr�__init__szEngine.__init__cCst|dd�r|j|j�dS)Nrr)�getattr�m2_engine_freer)rrrr�__del__'szEngine.__del__cCstj|j�S)z_Obtain a functional reference to the engine.

        :return: 0 on error, non-zero on success.)rZengine_initr)rrrr�init,szEngine.initcCstj|j�S)z<Release a functional and structural reference to the engine.)rZ
engine_finishr)rrrr�finish3sz
Engine.finishrcCs>tj|�}|dk	rtj|�}tj|j|||�s:ttj���dS)zCall ENGINE_ctrl_cmd_stringN)rZ
ensure_strrZengine_ctrl_cmd_stringrrr�	get_error)r�cmd�argZoptionalrrr�ctrl_cmd_string8s


zEngine.ctrl_cmd_stringcCstj|j�S)zReturn engine name)rZengine_get_namer)rrrr�get_nameAszEngine.get_namecCstj|j�S)zReturn engine id)rZ
engine_get_idr)rrrr�get_idFsz
Engine.get_idcCstj|j|�S)z�
        Use this engine as default for methods specified in argument

        :param methods: Possible values are bitwise OR of m2.ENGINE_METHOD_*
        )rZengine_set_defaultr)r�methodsrrr�set_defaultKszEngine.set_defaultcCsVtj�}tj|�}z2||j|||�}|s4ttj���tj|dd�}Wdtj	|�X|S)z Helper function for loading keysr)rN)
rZ
ui_opensslZengine_pkcs11_data_newrrrrrZPKeyZengine_pkcs11_data_free)r�func�name�pinZuiZcbdZkptr�keyrrr�_engine_load_keyTs
zEngine._engine_load_keycCs|jtj||�S)zrLoad private key with engine methods (e.g from smartcard).
            If pin is not set it will be asked
        )r+rZengine_load_private_key)rr(r)rrr�load_private_keybszEngine.load_private_keycCs|jtj||�S)z9Load public key with engine methods (e.g from smartcard).)r+rZengine_load_public_key)rr(r)rrr�load_public_keyiszEngine.load_public_keycCs(tj|j|�}|std��tj|dd�S)zpLoad certificate from engine (e.g from smartcard).
        NOTE: This function may be not implemented by engine!zCertificate or card not foundr)r)rZengine_load_certificaterrr)rr(Zcptrrrr�load_certificatenszEngine.load_certificate)NNr)r)N)N)N)r
rr�__doc__rZengine_freerrrrrr"r#r$ZENGINE_METHOD_ALLr&r+r,r-r.rrrrrs

		


rcCsZt|tj�r|jd�}tj�td�}|jd|�|jd|�|jdd�|jdd�|S)	z>Load and return dymanic engine from sopath and assign id to it�utf8ZdynamicZSO_PATHZIDZLIST_ADD�1ZLOADN)�
isinstancerZ	text_type�encoder�engine_load_dynamicrr")rZsopath�errr�load_dynamic_enginexs
r6cCstj�dS)zLoad dynamic engineN)rr4rrrr�load_dynamic�sr7cCstj�dS)zLoad openssl engineN)rZengine_load_opensslrrrr�load_openssl�sr8cCstj�dS)zfIf you load any engines, you need to clean up after your application
    is finished with the engines.N)rZengine_cleanuprrrr�cleanup�sr9N)Z
__future__rZM2CryptorrrrrrZpy27plusZtypingr	r
r�	ExceptionrZengine_init_error�objectrr6r7r8r9rrrr�<module>s	 
b