code: public void encode(OutputStream out)
      throws CertificateException, IOException {
          if (rawCertInfo == null) {
              DerOutputStream tmp = new DerOutputStream();
              emit(tmp);
              rawCertInfo = tmp.toByteArray();
          }
          out.write(rawCertInfo.clone());
      }
docs: Appends the certificate to an output stream.
  
  @param out an output stream to which the certificate is appended.
  @exception CertificateException on encoding errors.
  @exception IOException on other errors.