code: public CertPath engineGenerateCertPath(InputStream inStream,
          String encoding) throws CertificateException
      {
          if (inStream == null) {
              throw new CertificateException("Missing input stream");
          }
          try {
              byte[] data = readOneBlock(inStream);
              if (data != null) {
                  return new X509CertPath(new ByteArrayInputStream(data), encoding);
              } else {
                  throw new IOException("Empty input");
              }
          } catch (IOException ioe) {
              throw new CertificateException(ioe.getMessage());
          }
      }
docs: Generates a <code>CertPath</code> object and initializes it with
  the data read from the <code>InputStream</code> inStream. The data
  is assumed to be in the specified encoding.
  
  @param inStream an <code>InputStream</code> containing the data
  @param encoding the encoding used for the data
  @return a <code>CertPath</code> initialized with the data from the
  <code>InputStream</code>
  @exception CertificateException if an exception occurs while decoding or
  the encoding requested is not supported
  @since 1.4