question: private static List < X509Certificate > parsePKCS7 ( InputStream is ) throws CertificateException { List < X509Certificate > certList ; if ( is == null ) { throw new CertificateException ( "input stream is null" ) ; } try { if ( is . markSupported ( ) == false ) { is = new ByteArrayInputStream ( readAllBytes ( is ) ) ; } PKCS7 pkcs7 = new PKCS7 ( is ) ; X509Certificate [ ] certArray = pkcs7 . getCertificates ( ) ; if ( certArray != null ) { certList = Arrays . asList ( certArray ) ; } else { certList = new ArrayList < X509Certificate > ( 0 ) ; } } catch ( IOException ioe ) { throw new CertificateException ( "IOException parsing PKCS7 data: " + ioe ) ; } return Collections . unmodifiableList ( certList ) ; }
target:  Parse a PKCS#7 format CertPath from an InputStream. Return an unmodifiable List of the certificates.