code: public static void writeCertificate(OutputStream out,
                                          X509Certificate cert)
          throws IOException, CertificateEncodingException {
          CertificateIOUtil.writeCertificate(out, cert);
      }
docs: Writes certificate to the specified output stream in PEM format.