Create x.509 certificate using bouncycastle and chain it with ca certificate I generate a self-signed certificate, then I generate a keystore from that.