certGen.setNotAfter(new Date(System.currentTimeMillis() + 50000));
certGen.setSubjectDN(new X509Principal(ord, values));
certGen.setPublicKey(pubKey);
certGen.setSignatureAlgorithm("MD5WithRSAEncryption");
certGen.copyAndAddExtension(new DERObjectIdentifier("2.5.29.15"), true, baseCert);
certGen.copyAndAddExtension("2.5.29.37", false, baseCert);
X509Certificate cert = certGen.generate(privKey, "BC");
cert.checkValidity(new Date());