After reading a number of questions on generating X509 certificates using bouncy castle I found that the X509V1CertificateGenerator class documented here is deprecated and tried to use the current version, X509v1CertificateBuilder, as suggested here. The problem is that there doesn't seem to be a package cert as mentioned in the documentation. I am using maven to retrieve bouncy castle:
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.53</version>
</dependency>
In which package is X509v1CertificateBuilder located?