HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/rsa/__pycache__/util.cpython-310.pyc
o

j��`��@s.dZddlZddlmZddlZddd�ZdS)zUtility functions.�N)�OptionParser�returnc	Cs�tddd�}|jdddddd	�|jd
dddd
d	�|jdddddd�|jdddddd�|�tj�\}}|jratd|j|jftjd�t	|jd��}|�
�}Wd�n1s[wYntd|jtjd�tj�
��d�}t
|�tksJt
|���tjj�||j�}tj�|j|j�}|�|j�}|jr�td|j|jftjd�t	|jd��}|�|�Wd�dS1s�wYdStd|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)�PEM�DERr
)rr
�choices�defaultz	--outform�outformz"key format of output - default PEMz(Reading private key from %s in %s format)�file�rbNz+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 format)r�
add_option�
parse_args�sys�argvr�printr�stderr�open�read�stdin�encoder	�bytes�rsa�key�
PrivateKey�
load_pkcs1�	PublicKey�n�e�
save_pkcs1rr�write�stdout�decode)	�parser�cli�cli_args�infile�in_data�priv_key�pub_key�out_data�outfile�r5�*/usr/lib/python3/dist-packages/rsa/util.py�private_to_publicst������
���"�r7)rN)�__doc__r�optparser�rsa.keyr!r7r5r5r5r6�<module>s