slatk3y 0 Newbie Poster

I can generate a certificate from terminal using this command:
keytool -genkey -keystore myCert -keyalg RSA

... and then you enter name, ...

Is there an alternative way to do the same thing in JAVA?
Any help is appreciated, thanks