public X509CertImpl(InputStream in) throws CertificateException {
  DerValue der=null;
  BufferedInputStream inBuffered=new BufferedInputStream(in);
  try {
    inBuffered.mark(Integer.MAX_VALUE);
    der=readRFC1421Cert(inBuffered);
  }
 catch (  IOException ioe) {
    try {
      inBuffered.reset();
      der=new DerValue(inBuffered);
    }
 catch (    IOException ioe1) {
      throw new CertificateException("Input stream must be " + "either DER-encoded bytes " + "or RFC1421 hex-encoded "+ "DER-encoded bytes: "+ ioe1.getMessage(),ioe1);
    }
  }
  try {
    parse(der);
  }
 catch (  IOException ioe) {
    signedCert=null;
    throw new CertificateException("Unable to parse DER value of " + "certificate, " + ioe,ioe);
  }
}

public X509CertImpl ( InputStream in ) throws CertificateException { DerValue der = null ; BufferedInputStream inBuffered = new BufferedInputStream ( in ) ; try { inBuffered . mark ( Integer . MAX_VALUE ) ; der = readRFC1421Cert ( inBuffered ) ; } catch ( IOException ioe ) { try { inBuffered . reset ( ) ; der = new DerValue ( inBuffered ) ; } catch ( IOException ioe1 ) { throw new CertificateException ( "Input stream must be " + "either DER-encoded bytes " + "or RFC1421 hex-encoded " + "DER-encoded bytes: " + ioe1 . getMessage ( ) , ioe1 ) ; } } try { parse ( der ) ; } catch ( IOException ioe ) { signedCert = null ; throw new CertificateException ( "Unable to parse DER value of " + "certificate, " + ioe , ioe ) ; } }
unmarshals an x . 509 certificate from an input stream . if the certificate is rfc1421 hex - encoded , then it must begin with the line x509factory . begin_cert and end with the line x509factory . end_cert .
