jdk/test/sun/security/tools/keytool/KeyToolTest.java
changeset 39633 9dc7586be5f0
parent 29596 70399c7a7f5a
child 41107 567f832618d7
equal deleted inserted replaced
39570:f774415f91ad 39633:9dc7586be5f0
    80     private static final boolean debug =
    80     private static final boolean debug =
    81         System.getProperty("debug") != null;
    81         System.getProperty("debug") != null;
    82 
    82 
    83     static final String NSS_P11_ARG =
    83     static final String NSS_P11_ARG =
    84             "-keystore NONE -storetype PKCS11 -providerName SunPKCS11-nss " +
    84             "-keystore NONE -storetype PKCS11 -providerName SunPKCS11-nss " +
    85             "-providerClass sun.security.pkcs11.SunPKCS11 " +
    85             "-addprovider SunPKCS11 " +
    86             "-providerArg p11-nss.txt ";
    86             "-providerArg p11-nss.txt ";
       
    87     // Use -providerClass here, to confirm it still works for SunPKCS11.
    87     static final String NSS_SRC_P11_ARG =
    88     static final String NSS_SRC_P11_ARG =
    88             "-srckeystore NONE -srcstoretype PKCS11 " +
    89             "-srckeystore NONE -srcstoretype PKCS11 " +
    89             "-srcproviderName SunPKCS11-nss " +
    90             "-srcproviderName SunPKCS11-nss " +
    90             "-providerClass sun.security.pkcs11.SunPKCS11 " +
    91             "-providerClass sun.security.pkcs11.SunPKCS11 " +
    91             "-providerArg p11-nss.txt ";
    92             "-providerArg p11-nss.txt ";
    92     static final String NZZ_P11_ARG =
    93     static final String NZZ_P11_ARG =
    93             "-keystore NONE -storetype PKCS11 -providerName SunPKCS11-nzz " +
    94             "-keystore NONE -storetype PKCS11 -providerName SunPKCS11-nzz " +
    94             "-providerClass sun.security.pkcs11.SunPKCS11 " +
    95             "-addprovider SunPKCS11 " +
    95             "-providerArg p11-nzz.txt ";
    96             "-providerArg p11-nzz.txt ";
    96     static final String NZZ_SRC_P11_ARG =
    97     static final String NZZ_SRC_P11_ARG =
    97             "-srckeystore NONE -srcstoretype PKCS11 " +
    98             "-srckeystore NONE -srcstoretype PKCS11 " +
    98             "-srcproviderName SunPKCS11-nzz " +
    99             "-srcproviderName SunPKCS11-nzz " +
    99             "-providerClass sun.security.pkcs11.SunPKCS11 " +
   100             "-addprovider SunPKCS11 " +
   100             "-providerArg p11-nzz.txt ";
   101             "-providerArg p11-nzz.txt ";
   101     static final String SUN_P11_ARG = "-keystore NONE -storetype PKCS11 ";
   102     static final String SUN_P11_ARG = "-keystore NONE -storetype PKCS11 ";
   102     static final String SUN_SRC_P11_ARG =
   103     static final String SUN_SRC_P11_ARG =
   103             "-srckeystore NONE -srcstoretype PKCS11 ";
   104             "-srckeystore NONE -srcstoretype PKCS11 ";
   104 
   105 
  1713         assertTrue(ex.indexOf("Certificate reply and certificate" +
  1714         assertTrue(ex.indexOf("Certificate reply and certificate" +
  1714                 " in keystore are identical") != -1);
  1715                 " in keystore are identical") != -1);
  1715         //  14. keytool -printcert -file cert
  1716         //  14. keytool -printcert -file cert
  1716         testOK("", "-printcert -file cert -keystore x.jks -storetype JKS");
  1717         testOK("", "-printcert -file cert -keystore x.jks -storetype JKS");
  1717         remove("cert");
  1718         remove("cert");
  1718         //  15. keytool -list -storepass password -provider sun.security.provider.Sun
  1719         //  15. keytool -list -storepass password -addprovider SUN
  1719         testOK("", "-list -storepass password" +
  1720         testOK("", "-list -storepass password" +
  1720                 " -provider sun.security.provider.Sun" +
  1721                 " -addprovider SUN" +
  1721                 " -keystore x.jks -storetype JKS");
  1722                 " -keystore x.jks -storetype JKS");
  1722 
  1723 
  1723         //Error tests
  1724         //Error tests
  1724 
  1725 
  1725         //   1. keytool -storepasswd -storepass password -new abc
  1726         //   1. keytool -storepasswd -storepass password -new abc