certGen.addExtension("2.5.29.37", true,
new DERSequence(KeyPurposeId.anyExtendedKeyUsage));
certGen.addExtension("2.5.29.17", true,
new GeneralNames(new GeneralName(GeneralName.rfc822Name, "test@test.test")));
X509Certificate baseCert = certGen.generate(privKey, "BC");
//
// copy certificate
//
certGen = new X509V3CertificateGenerator();