Use JcaPEMWriter to export PEM file?
I am trying to figure out how to export private key from the X509Certificate instance as a PEM string encoded.
What I have done to far is to export certificate as PEM encoded:
import org.bouncycastle.jce.provider.BouncyCastleProvider
import org.bouncycastle.openssl.jcajce.JcaPEMWriter
import java.io.StringWriter
import java.security.KeyPairGenerator
import java.security.Security
import java.security.spec.ECGenParameterSpec
fun main(args: Array) {...