Search in sources :

Example 6 with TestKeyStore

use of libcore.java.security.TestKeyStore in project robovm by robovm.

the class KeyStoreBuilderParametersTest method test_init_Builder.

public void test_init_Builder() {
    TestKeyStore testKeyStore = TestKeyStore.getClient();
    Builder builder = Builder.newInstance(testKeyStore.keyStore, new PasswordProtection(testKeyStore.storePassword));
    KeyStoreBuilderParameters ksbp = new KeyStoreBuilderParameters(builder);
    assertNotNull(ksbp);
    assertNotNull(ksbp.getParameters());
    assertEquals(1, ksbp.getParameters().size());
    assertSame(builder, ksbp.getParameters().get(0));
}
Also used : TestKeyStore(libcore.java.security.TestKeyStore) KeyStoreBuilderParameters(javax.net.ssl.KeyStoreBuilderParameters) Builder(java.security.KeyStore.Builder) PasswordProtection(java.security.KeyStore.PasswordProtection)

Example 7 with TestKeyStore

use of libcore.java.security.TestKeyStore in project robovm by robovm.

the class SSLEngineTest method test_SSLEngine_getSupportedCipherSuites_connect.

public void test_SSLEngine_getSupportedCipherSuites_connect() throws Exception {
    // note the rare usage of non-RSA keys
    TestKeyStore testKeyStore = new TestKeyStore.Builder().keyAlgorithms("RSA", "DSA", "EC", "EC_RSA").aliasPrefix("rsa-dsa-ec").ca(true).build();
    test_SSLEngine_getSupportedCipherSuites_connect(testKeyStore, false);
    if (StandardNames.IS_RI) {
        test_SSLEngine_getSupportedCipherSuites_connect(testKeyStore, true);
    }
}
Also used : TestKeyStore(libcore.java.security.TestKeyStore)

Aggregations

TestKeyStore (libcore.java.security.TestKeyStore)7 InvalidAlgorithmParameterException (java.security.InvalidAlgorithmParameterException)2 Builder (java.security.KeyStore.Builder)2 PasswordProtection (java.security.KeyStore.PasswordProtection)2 CertificateException (java.security.cert.CertificateException)2 KeyStoreBuilderParameters (javax.net.ssl.KeyStoreBuilderParameters)2 IOException (java.io.IOException)1 SocketException (java.net.SocketException)1 SocketTimeoutException (java.net.SocketTimeoutException)1 KeyStore (java.security.KeyStore)1 PrivateKeyEntry (java.security.KeyStore.PrivateKeyEntry)1 PKIXParameters (java.security.cert.PKIXParameters)1 X509Certificate (java.security.cert.X509Certificate)1 List (java.util.List)1 KeyManager (javax.net.ssl.KeyManager)1 KeyManagerFactory (javax.net.ssl.KeyManagerFactory)1 SSLException (javax.net.ssl.SSLException)1 SSLHandshakeException (javax.net.ssl.SSLHandshakeException)1 SSLPeerUnverifiedException (javax.net.ssl.SSLPeerUnverifiedException)1 SSLProtocolException (javax.net.ssl.SSLProtocolException)1