< prev index next >

test/jdk/java/security/KeyStore/PKCS12/StoreTrustedCertKeytool.java

Print this page
rev 51638 : [mq]: 8210112


  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 import java.io.File;
  27 import java.io.IOException;
  28 import java.security.KeyStore;
  29 import java.security.KeyStoreException;
  30 import java.security.NoSuchAlgorithmException;
  31 import java.security.cert.CertificateException;
  32 import java.security.cert.X509Certificate;
  33 import jdk.testlibrary.OutputAnalyzer;
  34 import static java.lang.System.out;
  35 
  36 /**
  37  * @test
  38  * @bug 8048830
  39  * @summary Tests keytool command imports certificate , list keystore, print
  40  * certificate and import password help.
  41  * @library /lib/testlibrary ../

  42  * @run main StoreTrustedCertKeytool
  43  */
  44 public class StoreTrustedCertKeytool {
  45     private static final String PASSWORD = "passwd";
  46     private static final String ALIAS = "testkey_stckey";
  47     private static final String FILE_SEPARATOR = File.separator;
  48     private static final String WORKING_DIRECTORY = System.getProperty(
  49             "test.classes", "." + FILE_SEPARATOR);
  50     private static final String CERT_PATH = WORKING_DIRECTORY
  51             + FILE_SEPARATOR
  52             + "cert.data";
  53     private static final String KEYSTORE_PATH = WORKING_DIRECTORY
  54             + FILE_SEPARATOR + "ks.pkcs12";
  55 
  56     protected void run() throws IOException, KeyStoreException,
  57             NoSuchAlgorithmException, CertificateException {
  58         setUp();
  59         importCert();
  60         out.println("Import Cert test passed");
  61         listCerts();




  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 import java.io.File;
  27 import java.io.IOException;
  28 import java.security.KeyStore;
  29 import java.security.KeyStoreException;
  30 import java.security.NoSuchAlgorithmException;
  31 import java.security.cert.CertificateException;
  32 import java.security.cert.X509Certificate;
  33 import jdk.test.lib.process.OutputAnalyzer;
  34 import static java.lang.System.out;
  35 
  36 /**
  37  * @test
  38  * @bug 8048830
  39  * @summary Tests keytool command imports certificate , list keystore, print
  40  * certificate and import password help.
  41  * @library /lib/testlibrary ../
  42  * @library /test/lib
  43  * @run main StoreTrustedCertKeytool
  44  */
  45 public class StoreTrustedCertKeytool {
  46     private static final String PASSWORD = "passwd";
  47     private static final String ALIAS = "testkey_stckey";
  48     private static final String FILE_SEPARATOR = File.separator;
  49     private static final String WORKING_DIRECTORY = System.getProperty(
  50             "test.classes", "." + FILE_SEPARATOR);
  51     private static final String CERT_PATH = WORKING_DIRECTORY
  52             + FILE_SEPARATOR
  53             + "cert.data";
  54     private static final String KEYSTORE_PATH = WORKING_DIRECTORY
  55             + FILE_SEPARATOR + "ks.pkcs12";
  56 
  57     protected void run() throws IOException, KeyStoreException,
  58             NoSuchAlgorithmException, CertificateException {
  59         setUp();
  60         importCert();
  61         out.println("Import Cert test passed");
  62         listCerts();


< prev index next >