/*
* Turn into a pkcs certificate chain, and deliver to the client
*/
PKCS7CertList pkcs7 = new PKCS7CertList();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try {
pkcs7.createCertificateList(chain);
pkcs7.writeTo(bos);
} catch (iaik.pkcs.PKCSException e) {
System.out.println("OOPS " + e);
request.sendError(400, "Sorry, can't create certificate");
return true;
}