+
    oi&                        R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt]! ]P                  P                  P                  4       4      t
]P                  ]P                  ]P                  ],          3,          tR R lt ! R R]P$                  R7      t ! R R]4      t ! R	 R
]4      t ! R R]4      t ! R R]4      t]! 4       t]! 4       t]! 4       t]! 4       tR# )zWCommandline scripts.

These scripts are called by the executables defined in setup.py.
Nc                    V ^8  d   QhRR/#    returnN )formats   "j/Users/tonyclaw/.openclaw/workspace/scripts/youtube-playlists/venv/lib/python3.14/site-packages/rsa/cli.py__annotate__r	   !   s     @& @& @&    c                    \         P                  ! RRR7      p V P                  RRRR7       V P                  RR	RR
R7       V P                  RRRRR7       V P                  \        P
                  R,          4      w  r\        V4      ^8w  d   V P                  4        \        ^4      h \        V^ ,          4      p\        RT,          \        P                  R7       \        P                  ! T4      w  rVTP                  '       d   \        RTP                  ,          \        P                  R7       TP!                  TP"                  R7      p\%        TP                  R4      ;_uu_ 4       pTP'                  T4       RRR4       TP!                  TP"                  R7      pTP(                  '       dg   \        RTP(                  ,          \        P                  R7       \%        TP(                  R4      ;_uu_ 4       pTP'                  T4       RRR4       R# \        R\        P                  R7       \        P*                  P,                  P'                  T4       R#   \         dK   pT P                  4        \        RT^ ,          ,          \        P                  R7       \        ^4      ThRp?ii ; i  + '       g   i     ELC; i  + '       g   i     R# ; i)zKey generator.zusage: %prog [options] keysizez/Generates a new RSA key pair of "keysize" bits.usagedescriptionz--puboutstringzOutput filename for the public key. The public key is not saved if this option is not present. You can use pyrsa-priv2pub to create the public key file later.typehelp-oz--outz`Output filename for the private key. The key is written to stdout if this option is not present.z--formz7key format of the private and public keys - default PEMPEMr   choicesdefault   NNzNot a valid number: %sfileNzGenerating %i-bit keyzWriting public key to %s)r   wbzWriting private key to %szWriting private key to stdoutr   DER)optparseOptionParser
add_option
parse_argssysargvlen
print_help
SystemExitint
ValueErrorprintstderrrsanewkeyspubout
save_pkcs1formopenwriteoutstdoutbuffer)	parserclicli_argskeysizeexpub_keypriv_keydataoutfiles	            r   keygenr?   !   s8    "".EF
 >   ;	   F	   ''5OS
8}m$hqk" 

!G
+#**=++g.W zzz(3::5CJJG!!!2#**d##wMM$ $ chh/D
www)CGG3#**E#''4  GMM$ !  	-CJJ?

%1  $&!43::Fm#$ $## !  s1   +I# /J;K#J8.AJ33J8;K	K 	c                      a  ] tR t^dt o RtRtRtRtRtRt	Rt
RtR	t^tR
t]P                   tV 3R lR lt]P(                  V 3R lR l4       tV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltRtV tR# )CryptoOperationz9CLI callable that operates with input, output, and a key.publicz'usage: %%prog [options] %(keyname)s_key decrypt	decrypted
decryptingzEName of the file to %(operation)s. Reads from stdin if not specified.zjName of the file to write the %(operation_past)s file to. Written to stdout if this option is not present.Tc                   < V ^8  d   QhRR/# r   r   )r   __classdict__s   "r   r	   CryptoOperation.__annotate__w   s     F F$ Fr
   c                   V P                   V P                  P                  ,          V n         V P                  V P                  P                  ,          V n        V P                  V P                  P                  ,          V n        R # )N)r   	__class____dict__
input_helpoutput_help)selfs   &r   __init__CryptoOperation.__init__w   sS    ZZ$.."9"99
//DNN,C,CC++dnn.E.EEr
   c                n   < V ^8  d   QhRS[ RS[P                  P                  RS[RS[P                  /# )r   indatakeyr8   r   )bytesr,   rT   AbstractKey	IndexabletypingAny)r   rH   s   "r   r	   rI   }   s;      "%''"5"5AJ	r
   c                    R# )zhPerforms the program's operation.

Implement in a subclass.

:returns: the data to write to the output.
Nr   )rO   rS   rT   r8   s   &&&&r   perform_operation!CryptoOperation.perform_operation|   s    r
   c                   < V ^8  d   QhRR/# r   r   )r   rH   s   "r   r	   rI      s     4 4$ 4r
   c                   V P                  4       w  rV P                  V^ ,          VP                  4      pV P                  VP                  4      p\        V P                  P                  4       \        P                  R7       V P                  WCV4      pV P                  '       d   V P                  WQP                  4       R# R# )zRuns the program.r   N)	parse_cliread_keykeyformread_infileinputr*   operation_progressivetitler#   r+   r[   
has_outputwrite_outfileoutput)rO   r7   r8   rT   rS   outdatas   &     r   __call__CryptoOperation.__call__   s     ..*mmHQK5!!#)),d((..0szzB((h????w

3 r
   c                   < V ^8  d   QhRS[ P                  S[P                  S[ P                  S[,          3,          /# )r   r   )rX   Tupler   ValuesListstr)r   rH   s   "r   r	   rI      s/      6<<S9I(IJ r
   c                   \         P                  ! V P                  V P                  R7      pVP	                  RRRV P
                  R7       V P                  '       d    VP	                  RRRV P                  R7       VP	                  RR	V P                  ,          RR
R7       VP                  \        P                  R,          4      w  r#\        V4      V P                  8w  d   VP                  4        \        ^4      hW#3# )z6Parse the CLI options

:returns: (cli_opts, cli_args)
r   z-iz--inputr   r   r   z--outputz	--keyformz&Key format of the %s key - default PEMr   r   r   r   )r   r    r   r   r!   rM   rf   rN   keynamer"   r#   r$   r%   expected_cli_argsr&   r'   )rO   r6   r7   r8   s   &   r   r_   CryptoOperation.parse_cli   s     &&TZZTEUEUV$	tO???dJXDDTDTU9DLLH"	 	 	
 !++CHHRL9x=D222Q-}r
   c                T   < V ^8  d   QhRS[ RS[ RS[P                  P                  /# )r   filenamera   r   )rp   r,   rT   rV   )r   rH   s   "r   r	   rI      s,     ; ; ;s ;sww7J7J ;r
   c                   \        RV P                  : RV: 2\        P                  R7       \	        VR4      ;_uu_ 4       pVP                  4       pRRR4       V P                  P                  XV4      #   + '       g   i     L,; i)zReads a public or private key.zReading z
 key from r   rbN)r*   rr   r#   r+   r1   read	key_class
load_pkcs1)rO   rv   ra   keyfilekeydatas   &&&  r   r`   CryptoOperation.read_key   s\     	$,,A

S(D!!WllnG " ~~((':: "!s   A77B	c                &   < V ^8  d   QhRS[ RS[/# )r   innamer   )rp   rU   )r   rH   s   "r   r	   rI      s     	' 	'# 	'% 	'r
   c                `   V'       dR   \        RV,          \        P                  R7       \        VR4      ;_uu_ 4       pVP	                  4       uuRRR4       # \        R\        P                  R7       \        P
                  P                  P	                  4       #   + '       g   i     LS; i)zRead the input filezReading input from %sr   rx   NzReading input from stdin)r*   r#   r+   r1   ry   stdinr5   )rO   r   infiles   && r   rb   CryptoOperation.read_infile   sn     )F2Dfd##v{{} $# 	(szz:yy$$&&	 $#s   BB-	c                *   < V ^8  d   QhRS[ RS[RR/# )r   ri   outnamer   N)rU   rp   )r   rH   s   "r   r	   rI      s"     	- 	-U 	-S 	-T 	-r
   c                j   V'       dS   \        RV,          \        P                  R7       \        VR4      ;_uu_ 4       pVP	                  V4       RRR4       R# \        R\        P                  R7       \        P
                  P                  P	                  V4       R#   + '       g   i     R# ; i)zWrite the output filezWriting output to %sr   r   NzWriting output to stdout)r*   r#   r+   r1   r2   r4   r5   )rO   ri   r   r>   s   &&& r   rg   CryptoOperation.write_outfile   ss     (72Dgt$$g& %$ ,3::>JJ##G,	 %$$s   B!!B2	)rM   rN   r   N)__name__
__module____qualname____firstlineno____doc__rr   r   r   	operationoperation_pastrd   rM   rN   rs   rf   r,   	PublicKeyrz   rP   abcabstractmethodr[   rj   r_   r`   rb   rg   __static_attributes____classdictcell__rH   s   @r   rA   rA   d   s     CG5EKI N([J	?  JIF F
 	 4 4 8; ;	' 	'	- 	-r
   rA   )	metaclassc                   N   a  ] tR t^t o RtRtRtRtRtRt	RV 3R lR llt
R	tV tR
# )EncryptOperationzEncrypts a file.rB   zWEncrypts a file. The file must be shorter than the key length in order to be encrypted.encrypt	encrypted
encryptingc                Z   < V ^8  d   QhRS[ RS[P                  P                  RS[RS[ /# )r   rS   r;   r8   r   rU   r,   rT   rV   rW   )r   rH   s   "r   r	   EncryptOperation.__annotate__   s7     , ,,&)gg&9&9,EN,	,r
   c                    \        V\        P                  P                  4      '       g   Q h\        P                  ! W4      # )zEncrypts files.)
isinstancer,   rT   r   r   )rO   rS   r;   r8   s   &&&&r   r[   "EncryptOperation.perform_operation   s0     '377#4#45555{{6++r
   r   Nr   )r   r   r   r   r   rr   r   r   r   rd   r[   r   r   r   s   @r   r   r      s6     Gd  I N(, , ,r
   r   c                   f   a  ] tR t^t o RtRtRtRtRtRt	]
P                  tRV 3R lR lltR	tV tR
# )DecryptOperationzDecrypts a file.privatezgDecrypts a file. The original file must be shorter than the key length in order to have been encrypted.rD   rE   rF   c                Z   < V ^8  d   QhRS[ RS[P                  P                  RS[RS[ /# r   rS   r<   r8   r   r   )r   rH   s   "r   r	   DecryptOperation.__annotate__   s7     - --'*ww':':-FO-	-r
   c                    \        V\        P                  P                  4      '       g   Q h\        P                  ! W4      # )zDecrypts files.)r   r,   rT   
PrivateKeyrD   )rO   rS   r<   r8   s   &&&&r   r[   "DecryptOperation.perform_operation   s0     (CGG$6$67777{{6,,r
   r   Nr   )r   r   r   r   r   rr   r   r   r   rd   r,   r   rz   r[   r   r   r   s   @r   r   r      sA     G	:  I N(I- - -r
   r   c                      a  ] tR t^t o RtRtRtRRP                  ]4      ,          t	Rt
RtRt]P                  t^tR	tV 3R
 lR ltRtV tR# )SignOperationzSigns a file.r   z/usage: %%prog [options] private_key hash_methodzCSigns a file, outputs the signature. Choose the hash method from %s, sign	signatureSigningz\Name of the file to write the signature to. Written to stdout if this option is not present.c                Z   < V ^8  d   QhRS[ RS[P                  P                  RS[RS[ /# r   r   )r   rH   s   "r   r	   SignOperation.__annotate__  s7     
7 
7
7'*ww':':
7FO
7	
7r
   c                    \        V\        P                  P                  4      '       g   Q hV^,          pV\        9  d&   \        RRP                  \        4      ,          4      h\        P                  ! WV4      # )zSigns files.z%Invalid hash method, choose one of %sr   )r   r,   rT   r   HASH_METHODSr'   joinr   )rO   rS   r<   r8   hash_methods   &&&& r   r[   SignOperation.perform_operation  s^     (CGG$6$67777qkl*DtyyQ]G^^__xx+66r
   r   N)r   r   r   r   r   rr   r   r   r   r   r   r   rd   r,   r   rz   rs   rN   r[   r   r   r   s   @r   r   r      sb     G=E	99\2	3  I N%I	3 

7 
7r
   r   c                   n   a  ] tR tRt o RtRtRtRtRtRt	Rt
]P                  t^tR	tV 3R
 lR ltRtV tR# )VerifyOperationi  zVerify a signature.rB   z1usage: %%prog [options] public_key signature_filezsVerifies a signature, exits with status 0 upon success, prints an error message and exits with status 1 upon error.verifyverified	VerifyingFc                X   < V ^8  d   QhRS[ RS[P                  P                  RS[RR/# )r   rS   r;   r8   r   Nr   )r   rH   s   "r   r	   VerifyOperation.__annotate__+  s7     2 22&)gg&9&92EN2	2r
   c                   \        V\        P                  P                  4      '       g   Q hV^,          p\	        VR4      ;_uu_ 4       pVP                  4       pRRR4        \        P                  ! VXV4       \        R\        P                  R7       R#   + '       g   i     LF; i  \        P                   d   p\        R4      ThRp?ii ; i)zVerifies files.rx   NzVerification failed.zVerification OKr   )r   r,   rT   r   r1   ry   r   VerificationErrorr'   r*   r#   r+   )rO   rS   r;   r8   signature_filesigfiler   r:   s   &&&&    r   r[   !VerifyOperation.perform_operation+  s     '377#4#45555!!.$''7I (	=JJvy'2 	cjj1 ('
 $$ 	=34"<	=s$   
B$B, B)	,CCCr   N)r   r   r   r   r   rr   r   r   r   r   rd   r,   r   rz   rs   rf   r[   r   r   r   s   @r   r   r     sM     G?E	F  IN'IJ2 2r
   r   )r   r   r#   rX   r   r,   rsa.key	rsa.pkcs1sortedpkcs1r   keysUnionrm   ro   rp   rW   r?   ABCMetarA   r   r   r   r   r   rD   r   r   r   r
   r   <module>r      s   
  
   
  cii,,1134LLv{{3'778	@&Fk- k-\, ,&- -*7O 7B 2o  2F 


		r
   