question: public List < BurpCertificate > importCertificateChain ( String filename ) { setStatus ( "Importing certificate chain..." ) ; FileInputStream fis ; List < BurpCertificate > certificateChain = new LinkedList < > ( ) ; try { fis = new FileInputStream ( filename ) ; byte value [ ] = new byte [ fis . available ( ) ] ; fis . read ( value ) ; ByteArrayInputStream bais = new ByteArrayInputStream ( value ) ; fis . close ( ) ; CertificateFactory certFactory = CertificateFactory . getInstance ( "X.509" ) ; for ( Certificate c : certFactory . generateCertificates ( bais ) ) { X509Certificate x509certificate = ( X509Certificate ) c ; BurpCertificate certificate = new BurpCertificate ( x509certificate ) ; certificate . setPublicKey ( x509certificate . getPublicKey ( ) ) ; certificate . setSource ( "Imported Chain" ) ; certificateChain . add ( certificate ) ; } burpCertificateStore . addCertificateChain ( certificateChain ) ; setCertificateTree ( ) ; setStatus ( "Certificate Chain imported" ) ; return certificateChain ; } catch ( IOException | CertificateException e ) { setStatus ( "Error reading certificate chain. (" + e . getMessage ( ) + ")" ) ; e . printStackTrace ( ) ; } catch ( Exception e ) { setStatus ( "Error (" + e . getMessage ( ) + ")" ) ; } return null ; }
target:  Read and import an X.509v3 certificate chain.