Hi Han,
I'm not completely sure if this will work for your requirement but recently I had to generate a certificate using openssl. I found this nice program with a GUI that generated the Cert along with public/private key pair.
You could also check out the jwt module. There is a java action to create a keypair. From there you can use openssl to create a cert.
https://appstore.home.mendix.com/link/app/106447/WebFlight/JWT
Hope this helps!