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")));
cert = certGen.generate(privKey);
cert.checkValidity(new Date());
cert.verify(pubKey);