Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/rsa/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/rsa/__pycache__/util.cpython-38.pyc
U

O��g�@s2dZddlZddlmZddlZdd�dd�ZdS)zUtility functions.�N)�OptionParser)�returnc		Cs�tddd�}|jdddddd	�|jd
dddd
d	�|jdddddd�|jdddddd�|�tj�\}}|jr�td|j|jftjd�t	|jd��}|�
�}W5QRXn$td|jtjd�tj�
��d�}t
|�tks�tt
|���tjj�||j�}tj�|j|j�}|�|j�}|j�r`td|j|jftjd�t	|jd��}|�|�W5QRXn&td|jtjd�tj�|�d��dS) z=Reads a private key and outputs the corresponding public key.zusage: %prog [options]z�Reads a private key and outputs the corresponding public key. Both private and public keys use the format described in PKCS#1 v1.5)�usage�descriptionz-iz--input�
infilename�stringz1Input filename. Reads from stdin if not specified)�dest�type�helpz-oz--output�outfilenamez2Output filename. Writes to stdout of not specifiedz--inform�informz!key format of input - default PEM)�PEMZDERr
)rr
�choices�defaultz	--outform�outformz"key format of output - default PEMz(Reading private key from %s in %s format)�file�rbz+Reading private key from stdin in %s format�asciiz%Writing public key to %s in %s format�wbz)Writing public key to stdout in %s formatN)r�
add_option�
parse_args�sys�argvr�printr�stderr�open�read�stdin�encoder	�bytes�AssertionError�rsa�keyZ
PrivateKeyZ
load_pkcs1Z	PublicKey�n�eZ
save_pkcs1rr�write�stdout�decode)	�parser�cliZcli_args�infileZin_dataZpriv_keyZpub_keyZout_data�outfile�r,�5/opt/cppython/lib/python3.8/site-packages/rsa/util.py�private_to_publicsn�������r.)�__doc__r�optparserZrsa.keyr!r.r,r,r,r-�<module>s

F1le Man4ger