use of org.apache.cxf.rs.security.jose.jws.HmacJwsSignatureProvider in project cxf by apache.
the class JAXRSJweJwsTest method testJweRsaJwsPlainTextHMac.
@Test
public void testJweRsaJwsPlainTextHMac() throws Exception {
String address = "https://localhost:" + PORT + "/jwejwshmac";
HmacJwsSignatureProvider hmacProvider = new HmacJwsSignatureProvider(ENCODED_MAC_KEY, SignatureAlgorithm.HS256);
BookStore bs = createJweJwsBookStore(address, hmacProvider, null);
String text = bs.echoText("book");
assertEquals("book", text);
}
use of org.apache.cxf.rs.security.jose.jws.HmacJwsSignatureProvider in project cxf by apache.
the class JAXRSJweJwsTest method testJweRsaJwsBookHMac.
@Test
public void testJweRsaJwsBookHMac() throws Exception {
String address = "https://localhost:" + PORT + "/jwejwshmac";
HmacJwsSignatureProvider hmacProvider = new HmacJwsSignatureProvider(ENCODED_MAC_KEY, SignatureAlgorithm.HS256);
BookStore bs = createJweJwsBookStore(address, hmacProvider, Collections.singletonList(new JacksonJsonProvider()));
Book book = bs.echoBook(new Book("book", 123L));
assertEquals("book", book.getName());
assertEquals(123L, book.getId());
}
Aggregations