// System.out.println(cert);
//
// create the certificate - version 1
//
X509V1CertificateGenerator certGen1 = new X509V1CertificateGenerator();
certGen1.setSerialNumber(BigInteger.valueOf(1));
certGen1.setIssuerDN(new X509Principal(ord, values));
certGen1.setNotBefore(new Date(System.currentTimeMillis() - 50000));
certGen1.setNotAfter(new Date(System.currentTimeMillis() + 50000));
certGen1.setSubjectDN(new X509Principal(ord, values));
certGen1.setPublicKey(pubKey);
certGen1.setSignatureAlgorithm("MD5WithRSAEncryption");
cert = certGen1.generate(privKey);
cert.checkValidity(new Date());
cert.verify(pubKey);