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);
}
@Test
public void testEncryptedInput() throws Exception