How to create self signed certificates programmatically ?
The most common approach of generating a self-signed certificate is using the java keytool. There may be a situation when you want to create a self signed certificates programmatically One approach of programmatically generating these self-signed certificates is through the Bouncy Castle API. To start with this, you need to have the Bouncy Castle jar in your classpath.(You can download it from here ) Steps to generate self signed certificate key: 1. Create a public/private key pair for the new certificate KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); keyPairGenerator.initialize(1024, new SecureRandom()); KeyPair keyPair = keyPairGenerator.generateKeyPair(); 2. Create new certificate Structure // GENERATE THE X509 CERTIFICATE X509V3Certi...