
    i                     .    S r SSKrSSKJr  SSKrSS jrg)zUtility functions.    N)OptionParserc                     [        SSS9n U R                  SSSSSS	9  U R                  S
SSSSS	9  U R                  SSSSSS9  U R                  SSSSSS9  U R                  [        R                  5      u  pUR
                  (       ae  [        SUR
                  < SUR                  < S3[        R                  S9  [        UR
                  S5       nUR                  5       nSSS5        OR[        SUR                  -  [        R                  S9  [        R                  R                  5       R                  S5      n[        W5      [        :X  d   [        U5      5       e[        R                   R"                  R%                  XAR                  5      n[        R                   R'                  UR(                  UR*                  5      nUR-                  UR.                  5      nUR0                  (       af  [        SUR0                  < SUR.                  < S3[        R                  S9  [        UR0                  S 5       nUR3                  U5        SSS5        g[        S!UR.                  -  [        R                  S9  [        R4                  R3                  UR7                  S5      5        g! , (       d  f       GN= f! , (       d  f       g= f)"z=Reads a private key and outputs the corresponding public key.zusage: %prog [options]zReads 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 PEMzReading private key from z in z format)filerbNz+Reading private key from stdin in %s formatasciizWriting 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_pkcs1r   r   writestdoutdecode)	parserclicli_argsinfilein_datapriv_keypub_keyout_dataoutfiles	            S/home/maestro/MAESTRO/maestro-backend/venv/lib/python3.13/site-packages/rsa/util.pyprivate_to_publicr7      sB    &.F @   A   0   1   ''1OS ~~:=..#**U	
 #..$'6kkmG (' 	;cjjHszzZ)).."))'2=E!04=0! ww!!,,WjjAHgg

HJJ7G !!#++.H
7:T	
 #//4(GMM(# )( 	9CKKGcjjY

121 ('( )(s   J0K0
J?
K)returnN)__doc__r   optparser   rsa.keyr"   r7        r6   <module>r>      s     
 ! J3r=   