HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/rsa/__pycache__/util.cpython-312.pyc
�

�Cb`��,�dZddlZddlmZddlZdd�Zy)zUtility functions.�N)�OptionParserc��tdd��}|jddddd�	�|jd
dddd
�	�|jddddd��|jddddd��|jtj�\}}|j
rft
d|j
�d|j�d�tj��t|j
d�5}|j�}ddd�nUt
d|jztj��tjj�jd�}t�tk(sJt|���tj j"j%||j�}tj j'|j(|j*�}|j-|j.�}|j0rgt
d|j0�d|j.�d�tj��t|j0d �5}|j3|�ddd�yt
d!|j.ztj��tj4j3|j7d��y#1swY��yxYw#1swYyxYw)"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)r	r�choices�defaultz	--outform�outformz"key format of output - default PEMzReading private key from z in z format)�file�rbNz+Reading private key from stdin in %s format�asciizWriting public key to �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�outfiles	         �*/usr/lib/python3/dist-packages/rsa/util.py�private_to_publicr7sX���&�.��F������
�
�
@��������
�
�
A�������
�
0���������
�
1������'�'����1�O�S�(��~�~�
�:=�.�.�#�*�*�U����	
��#�.�.�$�
'�	$�6��k�k�m�G�	$�	$�	�;�c�j�j�H�s�z�z�Z��)�)�.�.�"�)�)�'�2����=�E�!�0�4��=�0�!��w�w�!�!�,�,�W�c�j�j�A�H��g�g����
�
�H�J�J�7�G��!�!�#�+�+�.�H�
���
�7:������T����	
��#�/�/�4�
(�	$�G��M�M�(�#�	$�	$�	�9�C�K�K�G�c�j�j�Y��
�
�������1�2�1	$�	$��(	$�	$�s� J>�K�>K�K)�returnN)�__doc__r�optparser�rsa.keyr"r7��r6�<module>r>s���
�!��J3r=