Is there some high level way to write an X509Certificate into a PEM formatted string? Currently I\'m doing x509cert.encode() to write it into a DER formatted string, then ba
Almost the same as @Andy Brown one less line of code.
StringWriter sw = new StringWriter(); try (JcaPEMWriter jpw = new JcaPEMWriter(sw)) { jpw.writeObject(cert); } String pem = sw.toString();
As he said PEMWriter is deprecated.