Assert.assertEquals(200, response.getStatus());
String signatureHeader = response.getResponseHeaders().getFirst(DKIMSignature.DKIM_SIGNATURE);
Assert.assertNotNull(signatureHeader);
System.out.println(DKIMSignature.DKIM_SIGNATURE + ": " + signatureHeader);
DKIMSignature contentSignature = new DKIMSignature(signatureHeader);
MarshalledEntity<String> entity = response.getEntity(new GenericType<MarshalledEntity<String>>()
{
});
boolean failedVerification = false;
try
{
contentSignature.verify(response.getResponseHeaders(), entity.getMarshalledBytes(), keys.getPublic());
}
catch (SignatureException e)
{
failedVerification = true;
}