Thanks in advance for your help and ideas,
Vimal Gupta
unfortunately, there is no public API for the keytool which would allow you
to create a certificate.
In case you don't specifically need to generate X.509 certificates, but just
a digitally signed object, please consider the TrueLicense package at
http://truelicense.dev.java.net. The classes
de.schlichtherle.xml.GenericCertificate and
de.schlichtherle.license.LicenseNotary would solve your problem then.
My apologies that I can't comment on BouncyCastle.
Regards,
Christian