generateCertificate
fun generateCertificate(
file: File,
algorithm: String = "SHA1withRSA",
keyAlias: String = "mykey",
keyPassword: String = "changeit",
jksPassword: String = keyPassword,
keySizeInBits: Int = 1024
): KeyStore
Generates simple self-signed certificate with keyAlias name, private key is encrypted with keyPassword, and a JKS keystore to hold it in file with jksPassword.
Only for testing purposes: NEVER use it for production!
A generated certificate will have 3 days validity period and 1024-bits key strength. Only localhost and 127.0.0.1 domains are valid with the certificate.