docs: private String saveCertificateAsPEMFile(Object x509Certificate, String filename, boolean deleteOnExit) throws IOException {
          File pemFile = File.createTempFile(filename, null);
          try (FileWriter pemfileWriter = new FileWriter(pemFile)) {
              try (JcaPEMWriter jcaPEMWriter = new JcaPEMWriter(pemfileWriter)) {
                  jcaPEMWriter.writeObject(x509Certificate);
              }
          }
          if (deleteOnExit) {
              pemFile.deleteOnExit();
          }
          return pemFile.getAbsolutePath();
      }