protected X509Certificate[] openCertificate(InputStream is,String name){
  try {
    X509Certificate[] certs=X509CertUtil.loadCertificates(is);
    if (certs.length == 0) {
      JOptionPane.showMessageDialog(frame,MessageFormat.format(res.getString("KeyStoreExplorerAction.NoCertsFound.message"),name),res.getString("KeyStoreExplorerAction.OpenCertificate.Title"),JOptionPane.WARNING_MESSAGE);
    }
    return certs;
  }
 catch (  Exception ex) {
    String problemStr=MessageFormat.format(res.getString("KeyStoreExplorerAction.NoOpenCert.Problem"),name);
    String[] causes=new String[]{res.getString("KeyStoreExplorerAction.NotCert.Cause"),res.getString("KeyStoreExplorerAction.CorruptedCert.Cause")};
    Problem problem=new Problem(problemStr,causes,ex);
    DProblem dProblem=new DProblem(frame,res.getString("KeyStoreExplorerAction.ProblemOpeningCert.Title"),problem);
    dProblem.setLocationRelativeTo(frame);
    dProblem.setVisible(true);
    return null;
  }
}

protected X509Certificate [ ] openCertificate ( InputStream is , String name ) { try { X509Certificate [ ] certs = X509CertUtil . loadCertificates ( is ) ; if ( certs . length == 0 ) { JOptionPane . showMessageDialog ( frame , MessageFormat . format ( res . getString ( "KeyStoreExplorerAction.NoCertsFound.message" ) , name ) , res . getString ( "KeyStoreExplorerAction.OpenCertificate.Title" ) , JOptionPane . WARNING_MESSAGE ) ; } return certs ; } catch ( Exception ex ) { String problemStr = MessageFormat . format ( res . getString ( "KeyStoreExplorerAction.NoOpenCert.Problem" ) , name ) ; String [ ] causes = new String [ ] { res . getString ( "KeyStoreExplorerAction.NotCert.Cause" ) , res . getString ( "KeyStoreExplorerAction.CorruptedCert.Cause" ) } ; Problem problem = new Problem ( problemStr , causes , ex ) ; DProblem dProblem = new DProblem ( frame , res . getString ( "KeyStoreExplorerAction.ProblemOpeningCert.Title" ) , problem ) ; dProblem . setLocationRelativeTo ( frame ) ; dProblem . setVisible ( true ) ; return null ; } }
open a certificate input stream .
