String          line; StringBuffer    pemBuf = new StringBuffer();
ASN1Sequence seq = PEM_CERT_PARSER.readPEMObject(in);
    private Certificate readPEMCertificate(        InputStream  in)        throws IOException    {        String          line;        StringBuffer    pemBuf = new StringBuffer();        while ((line = readLine(in)) != null)        {            if (line.equals("-----BEGIN CERTIFICATE-----")                || line.equals("-----BEGIN X509 CERTIFICATE-----"))            {                break;            }        }        while ((line = readLine(in)) != null)        {            if (line.equals("-----END CERTIFICATE-----")                || line.equals("-----END X509 CERTIFICATE-----"))            {                break;            }            pemBuf.append(line);        }        if (pemBuf.length() != 0)        {            ByteArrayInputStream bIn = new ByteArrayInputStream(Base64.decode(pemBuf.toString()));            return readDERCertificate(bIn);        }        return null;    }