@Test
public void testEncryptedSignedOutput() throws Exception
{
ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/smime/encrypted/signed"));
EnvelopedInput enveloped = request.getTarget(EnvelopedInput.class);
SignedInput signed = (SignedInput) enveloped.getEntity(SignedInput.class, privateKey, cert);
String output = (String) signed.getEntity(String.class);
System.out.println(output);
Assert.assertEquals("hello world", output);
Assert.assertTrue(signed.verify(cert));
Assert.assertEquals("hello world", output);
}