private void generateCertificate(byte[] data,Collection<Certificate> certCollection){
  try {
    ByteArrayInputStream bis=new ByteArrayInputStream(data);
    if (certificateFactory == null) {
      certificateFactory=CertificateFactory.getInstance("X.509","SUN");
    }
    Collection<? extends Certificate> c=certificateFactory.generateCertificates(bis);
    certCollection.addAll(c);
  }
 catch (  CertificateException e) {
  }
catch (  Throwable te) {
  }
}

private void generateCertificate ( byte [ ] data , Collection < Certificate > certCollection ) { try { ByteArrayInputStream bis = new ByteArrayInputStream ( data ) ; if ( certificateFactory == null ) { certificateFactory = CertificateFactory . getInstance ( "X.509" , "SUN" ) ; } Collection < ? extends Certificate > c = certificateFactory . generateCertificates ( bis ) ; certCollection . addAll ( c ) ; } catch ( CertificateException e ) { } catch ( Throwable te ) { } }
generates certificates from byte data and stores into cert collection .
