Search in sources :

Example 1 with CipherSuite

use of org.eclipse.californium.scandium.dtls.cipher.CipherSuite in project californium by eclipse.

the class LibCoapClientGnuTlsInteroperabilityTest method testLibCoapClientPskNoSessionId.

@Test
public void testLibCoapClientPskNoSessionId() throws Exception {
    CipherSuite cipherSuite = CipherSuite.TLS_PSK_WITH_AES_128_CCM_8;
    DtlsConnectorConfig.Builder builder = DtlsConnectorConfig.builder(new Configuration()).set(DtlsConfig.DTLS_SERVER_USE_SESSION_ID, false);
    californiumUtil.start(BIND, builder, null, cipherSuite);
    processUtil.startupClient(DESTINATION_URL + "test", PSK, "Hello, CoAP!", cipherSuite);
    connect("Hello, CoAP!", "Greetings!");
    californiumUtil.assertPrincipalType(PreSharedKeyIdentity.class);
}
Also used : Configuration(org.eclipse.californium.elements.config.Configuration) CipherSuite(org.eclipse.californium.scandium.dtls.cipher.CipherSuite) DtlsConnectorConfig(org.eclipse.californium.scandium.config.DtlsConnectorConfig) Test(org.junit.Test)

Example 2 with CipherSuite

use of org.eclipse.californium.scandium.dtls.cipher.CipherSuite in project californium by eclipse.

the class LibCoapClientGnuTlsInteroperabilityTest method testLibCoapClientPsk.

@Test
public void testLibCoapClientPsk() throws Exception {
    CipherSuite cipherSuite = CipherSuite.TLS_PSK_WITH_AES_128_CCM_8;
    californiumUtil.start(BIND, null, cipherSuite);
    processUtil.startupClient(DESTINATION_URL + "test", PSK, "Hello, CoAP!", cipherSuite);
    connect("Hello, CoAP!", "Greetings!");
    californiumUtil.assertPrincipalType(PreSharedKeyIdentity.class);
}
Also used : CipherSuite(org.eclipse.californium.scandium.dtls.cipher.CipherSuite) Test(org.junit.Test)

Example 3 with CipherSuite

use of org.eclipse.californium.scandium.dtls.cipher.CipherSuite in project californium by eclipse.

the class LibCoapClientGnuTlsInteroperabilityTest method testLibCoapClientEcdsaGCM.

@Test
public void testLibCoapClientEcdsaGCM() throws Exception {
    assumeNotNull(clientPrivateKey);
    CipherSuite cipherSuite = CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256;
    assumeTrue("GCM not support by JCE", cipherSuite.isSupported());
    californiumUtil.start(BIND, null, cipherSuite);
    processUtil.startupClient(DESTINATION_URL + "test", CHAIN, "Hello, CoAP!", cipherSuite);
    connect("Hello, CoAP!", "Greetings!");
    californiumUtil.assertPrincipalType(X509CertPath.class);
}
Also used : CipherSuite(org.eclipse.californium.scandium.dtls.cipher.CipherSuite) Test(org.junit.Test)

Example 4 with CipherSuite

use of org.eclipse.californium.scandium.dtls.cipher.CipherSuite in project californium by eclipse.

the class LibCoapClientGnuTlsInteroperabilityTest method testLibCoapClientEcdsaTrust.

@Test
public void testLibCoapClientEcdsaTrust() throws Exception {
    assumeNotNull(clientPrivateKey);
    CipherSuite cipherSuite = CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8;
    californiumUtil.start(BIND, null, cipherSuite);
    processUtil.startupClient(DESTINATION_URL + "test", TRUST, "Hello, CoAP!", cipherSuite);
    connect("Hello, CoAP!", "Greetings!");
    californiumUtil.assertPrincipalType(X509CertPath.class);
}
Also used : CipherSuite(org.eclipse.californium.scandium.dtls.cipher.CipherSuite) Test(org.junit.Test)

Example 5 with CipherSuite

use of org.eclipse.californium.scandium.dtls.cipher.CipherSuite in project californium by eclipse.

the class LibCoapClientGnuTlsInteroperabilityTest method testLibCoapClientPskGCM.

@Test
public void testLibCoapClientPskGCM() throws Exception {
    CipherSuite cipherSuite = CipherSuite.TLS_PSK_WITH_AES_128_GCM_SHA256;
    assumeTrue("GCM not support by JCE", cipherSuite.isSupported());
    californiumUtil.start(BIND, null, cipherSuite);
    processUtil.startupClient(DESTINATION_URL + "test", PSK, "Hello, CoAP!", cipherSuite);
    connect("Hello, CoAP!", "Greetings!");
    californiumUtil.assertPrincipalType(PreSharedKeyIdentity.class);
}
Also used : CipherSuite(org.eclipse.californium.scandium.dtls.cipher.CipherSuite) Test(org.junit.Test)

Aggregations

CipherSuite (org.eclipse.californium.scandium.dtls.cipher.CipherSuite)228 Test (org.junit.Test)214 Configuration (org.eclipse.californium.elements.config.Configuration)30 DtlsConnectorConfig (org.eclipse.californium.scandium.config.DtlsConnectorConfig)28 AlertMessage (org.eclipse.californium.scandium.dtls.AlertMessage)24 ProcessResult (org.eclipse.californium.interoperability.test.ProcessUtil.ProcessResult)20 CoapResponse (org.eclipse.californium.core.CoapResponse)10 Request (org.eclipse.californium.core.coap.Request)10 SingleCertificateProvider (org.eclipse.californium.scandium.dtls.x509.SingleCertificateProvider)8 Credentials (org.eclipse.californium.elements.util.SslContextUtil.Credentials)6 DTLSSession (org.eclipse.californium.scandium.dtls.DTLSSession)6 Ignore (org.junit.Ignore)6 AdvancedSinglePskStore (org.eclipse.californium.scandium.dtls.pskstore.AdvancedSinglePskStore)5 AsyncNewAdvancedCertificateVerifier (org.eclipse.californium.scandium.dtls.x509.AsyncNewAdvancedCertificateVerifier)5 ArrayList (java.util.ArrayList)4 RawPublicKeyIdentity (org.eclipse.californium.elements.auth.RawPublicKeyIdentity)4 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)4 KeyManagerCertificateProvider (org.eclipse.californium.scandium.dtls.x509.KeyManagerCertificateProvider)3 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)2 BlockOption (org.eclipse.californium.core.coap.BlockOption)2