Search in sources :

Example 21 with BookStore

use of org.apache.cxf.systest.jaxrs.security.jose.BookStore in project cxf by apache.

the class JAXRSJweJsonTest method testJweJsonSingleRecipientAesGcmDirect.

@Test
public void testJweJsonSingleRecipientAesGcmDirect() throws Exception {
    String address = "https://localhost:" + PORT + "/jwejsondirect";
    BookStore bs = createBookStore(address, "org/apache/cxf/systest/jaxrs/security/jwe.direct.properties");
    String text = bs.echoText("book");
    assertEquals("book", text);
}
Also used : BookStore(org.apache.cxf.systest.jaxrs.security.jose.BookStore) Test(org.junit.Test)

Example 22 with BookStore

use of org.apache.cxf.systest.jaxrs.security.jose.BookStore in project cxf by apache.

the class JAXRSJweJwsTest method testJweJwkPlainTextRSA.

@Test
public void testJweJwkPlainTextRSA() throws Exception {
    String address = "https://localhost:" + PORT + "/jwejwkrsa";
    BookStore bs = createJweBookStore(address, null);
    String text = bs.echoText("book");
    assertEquals("book", text);
}
Also used : BookStore(org.apache.cxf.systest.jaxrs.security.jose.BookStore) Test(org.junit.Test)

Example 23 with BookStore

use of org.apache.cxf.systest.jaxrs.security.jose.BookStore in project cxf by apache.

the class JAXRSJweJwsTest method testJwsJwkPlainTextHMac.

@Test
public void testJwsJwkPlainTextHMac() throws Exception {
    String address = "https://localhost:" + PORT + "/jwsjwkhmac";
    BookStore bs = createJwsBookStore(address, null);
    String text = bs.echoText("book");
    assertEquals("book", text);
}
Also used : BookStore(org.apache.cxf.systest.jaxrs.security.jose.BookStore) Test(org.junit.Test)

Example 24 with BookStore

use of org.apache.cxf.systest.jaxrs.security.jose.BookStore in project cxf by apache.

the class JAXRSJweJwsTest method testJweRsaJwsRsa.

@Test
public void testJweRsaJwsRsa() throws Exception {
    String address = "https://localhost:" + PORT + "/jwejwsrsa";
    BookStore bs = createJweJwsBookStore(address, null, null);
    String text = bs.echoText("book");
    assertEquals("book", text);
}
Also used : BookStore(org.apache.cxf.systest.jaxrs.security.jose.BookStore) Test(org.junit.Test)

Example 25 with BookStore

use of org.apache.cxf.systest.jaxrs.security.jose.BookStore in project cxf by apache.

the class JAXRSJweJwsTest method testJweRsaJwsRsaCertInHeaders.

@Test
public void testJweRsaJwsRsaCertInHeaders() throws Exception {
    String address = "https://localhost:" + PORT + "/jwejwsrsaCertInHeaders";
    BookStore bs = createJweJwsBookStore(address, null, null);
    WebClient.getConfig(bs).getRequestContext().put("rs.security.signature.include.cert", "true");
    WebClient.getConfig(bs).getRequestContext().put("rs.security.encryption.include.cert", "true");
    String text = bs.echoText("book");
    assertEquals("book", text);
}
Also used : BookStore(org.apache.cxf.systest.jaxrs.security.jose.BookStore) Test(org.junit.Test)

Aggregations

BookStore (org.apache.cxf.systest.jaxrs.security.jose.BookStore)37 Test (org.junit.Test)35 Book (org.apache.cxf.systest.jaxrs.security.Book)15 LinkedList (java.util.LinkedList)8 URL (java.net.URL)7 Bus (org.apache.cxf.Bus)7 SpringBusFactory (org.apache.cxf.bus.spring.SpringBusFactory)7 JAXRSClientFactoryBean (org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean)7 JweClientResponseFilter (org.apache.cxf.rs.security.jose.jaxrs.JweClientResponseFilter)6 JweWriterInterceptor (org.apache.cxf.rs.security.jose.jaxrs.JweWriterInterceptor)6 JacksonJsonProvider (com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider)5 JwsClientResponseFilter (org.apache.cxf.rs.security.jose.jaxrs.JwsClientResponseFilter)3 JwsWriterInterceptor (org.apache.cxf.rs.security.jose.jaxrs.JwsWriterInterceptor)3 HashMap (java.util.HashMap)2 PrivateKeyPasswordProvider (org.apache.cxf.rs.security.jose.common.PrivateKeyPasswordProvider)2 HmacJwsSignatureProvider (org.apache.cxf.rs.security.jose.jws.HmacJwsSignatureProvider)2 ArrayList (java.util.ArrayList)1 BadRequestException (javax.ws.rs.BadRequestException)1 AesCbcHmacJweDecryption (org.apache.cxf.rs.security.jose.jwe.AesCbcHmacJweDecryption)1 AesCbcHmacJweEncryption (org.apache.cxf.rs.security.jose.jwe.AesCbcHmacJweEncryption)1