/************************************************************************* * * * SignServer: The OpenSource Automated Signing Server * * * * This software is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or any later version. * * * * See terms of license at gnu.org. * * * *************************************************************************/ package org.signserver.client.cli.defaultimpl; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.security.*; import java.security.cert.CertificateException; import java.util.Arrays; import java.util.List; import java.util.ResourceBundle; import javax.net.ssl.*; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Option; /** * Handles keystore and truststore options from the command line as well * as setting them up for use with SSL. * * @author Markus KilÄs * @version $Id: KeyStoreOptions.java 2095 2012-02-06 16:06:07Z netmackan $ */ public class KeyStoreOptions { /** ResourceBundle with internationalized StringS. */ private static final ResourceBundle TEXTS = ResourceBundle.getBundle( "org/signserver/client/cli/defaultimpl/ResourceBundle"); /** Default host */ public static final String DEFAULT_HOST = "localhost"; /** Default HTTP port. */ public static final int DEFAULT_HTTP_PORT = 8080; /** Default public HTTPS port. */ public static final int DEFAULT_PUBLIC_HTTPS_PORT = 8442; /** Default private HTTPS port. */ public static final int DEFAULT_PRIVATE_HTTPS_PORT = 8443; /** Option TRUSTSTORE. */ public static final String TRUSTSTORE = "truststore"; /** Option TRUSTSTOREPWD. */ public static final String TRUSTSTOREPWD = "truststorepwd"; /** Option KEYSTORE. */ public static final String KEYSTORE = "keystore"; /** Option KEYSTOREPWD. */ public static final String KEYSTOREPWD = "keystorepwd"; /** Option KEYALIAS. */ public static final String KEYALIAS = "keyalias"; public static List