@GET
@Produces("text/plain")
@Path("bad-signature")
public Response badSignature() throws Exception
{
DKIMSignature signature = new DKIMSignature();
signature.setDomain("samplezone.org");
signature.setSelector("test");
signature.sign(new HashMap(), "hello world".getBytes(), keys.getPrivate());
byte[] sig = {0x0f, 0x03};
String encodedBadSig = Base64.encodeBytes(sig);
ParameterParser parser = new ParameterParser();
String s = signature.toString();
String header = parser.setAttribute(s.toCharArray(), 0, s.length(), ';', "b", encodedBadSig);
signature.setSignature(sig);
return Response.ok("hello world").header(DKIMSignature.DKIM_SIGNATURE, header).build();
}