DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
Date validFromDate = df.parse(validFrom);
Date validToDate = df.parse(validTo);
String algorithm = request.getParameter("algorithm");
// Issue certificate
ca.issueCertificate(new X500Principal(subject.getEncoded()), publickey, sNo, validFromDate, validToDate, algorithm);
// Store the challenge phrase against the issued certificate serial number
if(challenge != null && !challenge.equals("")) {
getCertificateStore(request).setCertificateChallenge(sNo, challenge);
}