Index: modules/tools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java =================================================================== --- modules/tools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java (revision 0) +++ modules/tools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java (revision 0) @@ -0,0 +1,33 @@ +/** + * @author Anton D.Rusanov + * + */ + +package org.apache.harmony.tools.keytool; + +/** + * The class to interact with the user - parse the program arguments, ask for + * confirmations, and necessary parameters which haven't been set in the command + * line. + */ + +class ArgumentsParser { + /** + * The method finds known options in args which is usually taken from + * command line and sets the corresponding fields of the returned + * KeytoolParameters object to given values. + */ + static KeytoolParameters parseArgs(String[] args){ + // TODO + throw new RuntimeException("The method is not implemented yet."); + } + + /** + * Checks if the needed values are set and, if not, prompts for them. + */ + static void getAdditionalParameters(KeytoolParameters param){ + // TODO + throw new RuntimeException("The method is not implemented yet."); + } + +} Index: modules/tools/src/main/java/org/apache/harmony/tools/keytool/Main.java =================================================================== --- modules/tools/src/main/java/org/apache/harmony/tools/keytool/Main.java (revision 0) +++ modules/tools/src/main/java/org/apache/harmony/tools/keytool/Main.java (revision 0) @@ -0,0 +1,50 @@ +/** + * @author Anton D. Rusanov + * + * Class that implements the functionality of the key and certificate management + * tool. + */ + +package org.apache.harmony.tools.keytool; + +/** + * The main class that bundles command line parsing, interaction with the user + * and work with keys and certificates. + */ +public class Main { + + /** + * Does the actual work with keys and certificates, based on the parameter + * param. If something goes wrong an exception is thrown. + */ + static void doWork(KeytoolParameters param) throws Exception { + // TODO + throw new RuntimeException("The method is not implemented yet."); + } + + /** + * The main method to run from another program. + * + * @param args - + * command line with options. + */ + public static void run(String[] args) throws Exception { + // TODO + throw new RuntimeException("The method is not implemented yet."); + } + + /** + * The main method to run from command line. + * + * @param args - + * command line with options. + */ + public static void main(String[] args) { + try { + run(args); + } catch (Exception e) { + // System.out.println("Keytool error: " + e); + e.printStackTrace(); + } + } +} Index: modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolParameters.java =================================================================== --- modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolParameters.java (revision 0) +++ modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolParameters.java (revision 0) @@ -0,0 +1,13 @@ +/** + * @author Anton D. Rusanov + * + */ +package org.apache.harmony.tools.keytool; + +/** + * The class encapsulates paramaters for Keytool most of which are ususally given + * in command line. + */ +public class KeytoolParameters { + // TODO +}