public static Collection<X509Certificate> getCAX509Certificates(String directoryPath) throws IllegalArgumentException, CertificateException, IOException{
    	
    	Collection<X509Certificate> certificates=new LinkedList<X509Certificate>();
    	
    	File certDirectory = new File(directoryPath);
    	File[] files = certDirectory.listFiles();
    	if (files != null) { // read all files
    		for (File file : files) {
    			String fileName=file.getName();
    			int index= fileName.lastIndexOf(".");
    			if(index!=-1){
    				//if files is filename.0 type 
    				if(fileName.substring(index+1).equals("0")){
    					try{
    					X509Certificate[] tempCerts=getX509Certificates(pemFileToString(file));
    					certificates.addAll(Arrays.asList(tempCerts));
    					}catch(IllegalArgumentException e){
    						 throw new IllegalArgumentException(e.getMessage()+". "
    					         +"Error reading X509 certificate from: "+ file.getAbsolutePath(),
    					         e.getCause());
    					}
    				}
    			}
    		}
    	}
    	return certificates;
    }