X509KeyUsage ku = new X509KeyUsage(bcku);
bOut = new ByteArrayOutputStream();
dOut = new DEROutputStream(bOut);
dOut.writeObject(ku);
byte[] value = bOut.toByteArray();
X509Extension kuext = new X509Extension(false, new DEROctetString(value));
values.add(kuext);
oids.add(X509Extensions.KeyUsage);
myCertTemplate.setExtensions(new X509Extensions(oids, values));
CertRequest myCertRequest = new CertRequest(new DERInteger(4), myCertTemplate);
CertReqMsg myCertReqMsg = new CertReqMsg(myCertRequest);