I need to get an X509Certificate from a CA server
I need to add some EnhancedKeyUsage extension such as "secureEmail" - "1.3.6.1.5.5.7.3.4"
How do I add that to the certificate request?
The following code runs, returns a certificate but without the wanted extension
ASN1EncodableVector secureEmail = new ASN1EncodableVector();
secureEmail.add(new DERObjectIdentifier("1.3.6.1.5.5.7.3.4"));
secureEmail.add(new DERTaggedObject(true, 0, new DERUTF8String( "secureEmail")));
genName = new DERTaggedObject(false, 0, new DERSequence(secureEmail));
genNames = new ASN1EncodableVector();
genNames.add(genName);
extGen=new ExtensionsGenerator(); //??????
extGen.addExtension(new ASN1ObjectIdentifier("1.3.6.1.5.5.7.3.4"), true, new DERSequence(genNames));
csrBuilder.addAttribute(PKCSObjectIdentifiers.pkcs_9_at_extensionRequest,extGen.generate());