use of tests.targets.security.KeyStoreTestPKCS12 in project robovm by robovm.
the class OldPKIXParametersTest method testPKIXParametersKeyStore04.
/**
* Test #4 for <code>PKIXParameters(KeyStore)</code> constructor<br>
*
* @throws InvalidAlgorithmParameterException
* @throws KeyStoreException
*/
@BrokenTest("Fails in CTS environment, but passes in CoreTestRunner")
public final void testPKIXParametersKeyStore04() throws Exception {
KeyStore store = KeyStore.getInstance("PKCS12");
KeyStoreTestPKCS12 k = new KeyStoreTestPKCS12();
ByteArrayInputStream stream = new ByteArrayInputStream(k.keyStoreData);
try {
PKIXParameters p = new PKIXParameters(store);
} catch (KeyStoreException e) {
// ok
}
store = KeyStore.getInstance("PKCS12");
store.load(stream, new String(KeyStoreTestPKCS12.keyStorePassword).toCharArray());
stream.close();
try {
PKIXParameters p = new PKIXParameters(store);
} catch (InvalidAlgorithmParameterException e) {
// ok
}
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
keystore.load(null, null);
keystore.setCertificateEntry("test", TestUtils.rootCertificateSS);
PKIXParameters p = new PKIXParameters(keystore);
}
Aggregations