< prev index next >

test/jdk/java/security/KeyStore/TestKeyStoreEntry.java

Print this page
rev 59107 : imported patch security

*** 34,44 **** /* * @test * @bug 8048621 * @summary Test the basic operations of KeyStore entry, provided by SunJCE ! * (jceks), and SunPKCS11-Solaris(PKCS11KeyStore) * @author Yu-Ching Valerie PENG */ public class TestKeyStoreEntry { private static final char[] PASSWDK = new char[] { --- 34,44 ---- /* * @test * @bug 8048621 * @summary Test the basic operations of KeyStore entry, provided by SunJCE ! * (jceks) * @author Yu-Ching Valerie PENG */ public class TestKeyStoreEntry { private static final char[] PASSWDK = new char[] {
*** 53,63 **** private static final String[] KS_TYPE = { "jks", "jceks", "pkcs12", "PKCS11KeyStore" }; private static final String[] PRO_TYPE = { ! "SUN", "SunJCE", "SunJSSE", "SunPKCS11-Solaris" }; private final SecretKey[] sks = new SecretKey[NUM_ALGOS]; TestKeyStoreEntry() throws Exception { --- 53,63 ---- private static final String[] KS_TYPE = { "jks", "jceks", "pkcs12", "PKCS11KeyStore" }; private static final String[] PRO_TYPE = { ! "SUN", "SunJCE", "SunJSSE" }; private final SecretKey[] sks = new SecretKey[NUM_ALGOS]; TestKeyStoreEntry() throws Exception {
*** 79,107 **** public void run() throws Exception { Provider[] providers = Security.getProviders(); for (Provider p: providers) { String prvName = p.getName(); ! if (prvName.startsWith("SunJCE") ! || prvName.startsWith("SunPKCS11-Solaris")) { try { runTest(p); out.println("Test with provider " + p.getName() + "" + " passed"); } catch (java.security.KeyStoreException e) { - if (prvName.startsWith("SunPKCS11-Solaris")) { - out.println("KeyStoreException is expected because " - + "PKCS11KeyStore is invalid keystore type."); - e.printStackTrace(); - } else { throw e; } } } } - } public void runTest(Provider p) throws Exception { try (FileOutputStream fos = new FileOutputStream("jceks"); FileInputStream fis = new FileInputStream("jceks");) { --- 79,100 ---- public void run() throws Exception { Provider[] providers = Security.getProviders(); for (Provider p: providers) { String prvName = p.getName(); ! if (prvName.startsWith("SunJCE")) { try { runTest(p); out.println("Test with provider " + p.getName() + "" + " passed"); } catch (java.security.KeyStoreException e) { throw e; } } } } public void runTest(Provider p) throws Exception { try (FileOutputStream fos = new FileOutputStream("jceks"); FileInputStream fis = new FileInputStream("jceks");) {
< prev index next >