public static void main(String[] args) {
        int i=0;
        String arg=null;

        while(i < args.length && args[i].startsWith("-")) {
            arg=args[i++];
            if(arg.equalsIgnoreCase("--alg")) {
                symAlg=args[i++];
                continue;
            }
            if(arg.equalsIgnoreCase("--size")) {
                keySize=Integer.parseInt(args[i++]);
                continue;
            }
            if(arg.equalsIgnoreCase("--storeName")) {
                keyStoreName=args[i++];
                continue;
            }
            if(arg.equalsIgnoreCase("--storePass")) {
                    storePass=args[i++];
                continue;
            }
            if(arg.equalsIgnoreCase("--alias")) {
                alias=args[i++];
                continue;
            }
            help();
            return;
        }
        System.out.printf("Creating file '%s' using algorithm '%s' size '%d'\n", keyStoreName, symAlg, keySize);

        try(OutputStream stream=new FileOutputStream(keyStoreName)) {
            SecretKey key=createSecretKey();
            KeyStore store=KeyStore.getInstance("JCEKS");
            store.load(null, null);
            store.setKeyEntry(alias, key, storePass.toCharArray(), null);
            store.store(stream, storePass.toCharArray());

        }
        catch(Exception e) {
            e.printStackTrace();
        }
        System.out.println("Finished keystore creation");
    }