I have a java application to verify digital signatures . The Generate.java class takes a file (for which signature is to be generated) as command line argument and stores two files in the bin folder , one with the public keyand other with the private key .
The Verify.java class takes 3 command line arguments , the public key file , the private key file , and the file for which signature was generated.
Instead of giving these as command arguments , can i permanently them permanently in the java programs by giving their file path or somethign ?
While you can hardcode them in your code, it might not be a good solution.
Alternatives are to look in a file/resource bundle that contains the entries for these files.
sayush anand
Greenhorn
Joined: May 23, 2012
Posts: 13
posted
0
I need to show the program today in college , hence was thinking of hardcoding it in the program .Can you please tell how to do that
Stuart A. Burkett
Ranch Hand
Joined: May 30, 2012
Posts: 319
posted
0
sayush anand wrote:I need to show the program today in college , hence was thinking of hardcoding it in the program .Can you please tell how to do that
You replace the references to the command line arguments with string literals.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.