Index: TibisayMovil/AndroidManifest.xml
===================================================================
--- TibisayMovil/AndroidManifest.xml	(revision 4528953bef110cd13331d164bc3f6c13097c4b0e)
+++ TibisayMovil/AndroidManifest.xml	(revision d5ab40f3baaaa44a8bff997e091c8be2b60055c0)
@@ -146,4 +146,8 @@
             android:label="@string/title_activity_encryption_certificates" >
         </activity>
+        <activity
+            android:name="ve.gob.cenditel.tibisaymovil.CertificateToLoadActivity"
+            android:label="@string/title_activity_certificate_to_load" >
+        </activity>
     </application>
 
Index: TibisayMovil/gen/net/neiti/droidtext/R.java
===================================================================
--- TibisayMovil/gen/net/neiti/droidtext/R.java	(revision 4528953bef110cd13331d164bc3f6c13097c4b0e)
+++ TibisayMovil/gen/net/neiti/droidtext/R.java	(revision d5ab40f3baaaa44a8bff997e091c8be2b60055c0)
@@ -16,5 +16,5 @@
 	}
 	public static final class layout {
-		public static final int main = 0x7f03001a;
+		public static final int main = 0x7f03001b;
 	}
 	public static final class string {
Index: TibisayMovil/gen/ve/gob/cenditel/tibisaymovil/R.java
===================================================================
--- TibisayMovil/gen/ve/gob/cenditel/tibisaymovil/R.java	(revision 4528953bef110cd13331d164bc3f6c13097c4b0e)
+++ TibisayMovil/gen/ve/gob/cenditel/tibisaymovil/R.java	(revision d5ab40f3baaaa44a8bff997e091c8be2b60055c0)
@@ -137,6 +137,7 @@
         public static final int cert_description=0x7f0b004f;
         public static final int certificate_issuer=0x7f0b0046;
-        public static final int certificate_list=0x7f0b0018;
+        public static final int certificate_list=0x7f0b001c;
         public static final int certificate_serial=0x7f0b0041;
+        public static final int certificate_to_load_description=0x7f0b0016;
         public static final int certificate_valid_from=0x7f0b0011;
         public static final int certificate_valid_until=0x7f0b0044;
@@ -144,9 +145,9 @@
         public static final int documents_list=0x7f0b0048;
         public static final int file_checkbox=0x7f0b0051;
-        public static final int file_list=0x7f0b0021;
+        public static final int file_list=0x7f0b0019;
         public static final int file_radio=0x7f0b0057;
-        public static final int filename_data=0x7f0b001c;
+        public static final int filename_data=0x7f0b0020;
         public static final int filename_modified=0x7f0b0052;
-        public static final int filename_text=0x7f0b001d;
+        public static final int filename_text=0x7f0b0021;
         public static final int generalView=0x7f0b004e;
         public static final int imageListMainMenu=0x7f0b0058;
@@ -155,10 +156,10 @@
         public static final int label_certificate_issuer=0x7f0b0045;
         public static final int label_certificate_serial=0x7f0b0040;
-        public static final int label_certificate_to_remove=0x7f0b0019;
+        public static final int label_certificate_to_remove=0x7f0b001d;
         public static final int label_certificate_valid_from=0x7f0b0042;
         public static final int label_certificate_valid_until=0x7f0b0043;
-        public static final int label_recipient_certificate=0x7f0b0017;
+        public static final int label_recipient_certificate=0x7f0b001b;
         public static final int layoutSignatureErrors=0x7f0b003b;
-        public static final int layout_certificate_to_remove=0x7f0b001a;
+        public static final int layout_certificate_to_remove=0x7f0b001e;
         public static final int linearLayout=0x7f0b0013;
         public static final int linearLayout1=0x7f0b000f;
@@ -170,8 +171,7 @@
         public static final int page_container=0x7f0b0031;
         public static final int pages_spinner=0x7f0b0032;
-        public static final int path=0x7f0b0020;
-        public static final int pathstring=0x7f0b001f;
-        public static final int recipient_certificate_layout=0x7f0b0016;
-        public static final int share_description=0x7f0b001e;
+        public static final int path=0x7f0b0018;
+        public static final int pathstring=0x7f0b0017;
+        public static final int recipient_certificate_layout=0x7f0b001a;
         public static final int sign_description=0x7f0b0022;
         public static final int signature_date=0x7f0b0024;
@@ -201,5 +201,5 @@
         public static final int title_signature_date_info=0x7f0b003e;
         public static final int title_signature_errors=0x7f0b0039;
-        public static final int type_image=0x7f0b001b;
+        public static final int type_image=0x7f0b001f;
     }
     public static final class layout {
@@ -211,29 +211,30 @@
         public static final int activity_bdocverify_result=0x7f030005;
         public static final int activity_capture_img_handwritten_signature=0x7f030006;
-        public static final int activity_downloader=0x7f030007;
-        public static final int activity_encryption_certificates=0x7f030008;
-        public static final int activity_file_to_share=0x7f030009;
-        public static final int activity_file_to_sign_handwritten_signature=0x7f03000a;
-        public static final int activity_file_to_verify_bdoc=0x7f03000b;
-        public static final int activity_main=0x7f03000c;
-        public static final int activity_select_sign_ubication_handwritten_signature=0x7f03000d;
-        public static final int activity_sign_result_handwritten_signature=0x7f03000e;
-        public static final int activity_signature_errors=0x7f03000f;
-        public static final int activity_signer_info=0x7f030010;
-        public static final int activity_verify_result_bdoc=0x7f030011;
-        public static final int cert_browser_item=0x7f030012;
-        public static final int certificate_buttons=0x7f030013;
-        public static final int certificate_chooser=0x7f030014;
-        public static final int document_inside_bdoc_item=0x7f030015;
-        public static final int error_inside_signature_item=0x7f030016;
-        public static final int file_to_sign_handwritten_signature_item=0x7f030017;
-        public static final int file_to_verify_bdoc_signature_item=0x7f030018;
-        public static final int list_item=0x7f030019;
-        public static final int main=0x7f03001a;
-        public static final int progress_dialog=0x7f03001b;
-        public static final int recipient_certificate_info=0x7f03001c;
-        public static final int signer_inside_bdoc_item=0x7f03001d;
-        public static final int single_file_browser=0x7f03001e;
-        public static final int title_bar=0x7f03001f;
+        public static final int activity_certificate_to_load=0x7f030007;
+        public static final int activity_downloader=0x7f030008;
+        public static final int activity_encryption_certificates=0x7f030009;
+        public static final int activity_file_to_share=0x7f03000a;
+        public static final int activity_file_to_sign_handwritten_signature=0x7f03000b;
+        public static final int activity_file_to_verify_bdoc=0x7f03000c;
+        public static final int activity_main=0x7f03000d;
+        public static final int activity_select_sign_ubication_handwritten_signature=0x7f03000e;
+        public static final int activity_sign_result_handwritten_signature=0x7f03000f;
+        public static final int activity_signature_errors=0x7f030010;
+        public static final int activity_signer_info=0x7f030011;
+        public static final int activity_verify_result_bdoc=0x7f030012;
+        public static final int cert_browser_item=0x7f030013;
+        public static final int certificate_buttons=0x7f030014;
+        public static final int certificate_chooser=0x7f030015;
+        public static final int document_inside_bdoc_item=0x7f030016;
+        public static final int error_inside_signature_item=0x7f030017;
+        public static final int file_to_sign_handwritten_signature_item=0x7f030018;
+        public static final int file_to_verify_bdoc_signature_item=0x7f030019;
+        public static final int list_item=0x7f03001a;
+        public static final int main=0x7f03001b;
+        public static final int progress_dialog=0x7f03001c;
+        public static final int recipient_certificate_info=0x7f03001d;
+        public static final int signer_inside_bdoc_item=0x7f03001e;
+        public static final int single_file_browser=0x7f03001f;
+        public static final int title_bar=0x7f030020;
     }
     public static final class menu {
@@ -241,9 +242,10 @@
         public static final int activity_signer_info=0x7f0a0001;
         public static final int bdocverify_result=0x7f0a0002;
-        public static final int downloader=0x7f0a0003;
-        public static final int encryption_certificates=0x7f0a0004;
-        public static final int file_to_share=0x7f0a0005;
-        public static final int main=0x7f0a0006;
-        public static final int tibisay_movil=0x7f0a0007;
+        public static final int certificate_to_load=0x7f0a0003;
+        public static final int downloader=0x7f0a0004;
+        public static final int encryption_certificates=0x7f0a0005;
+        public static final int file_to_share=0x7f0a0006;
+        public static final int main=0x7f0a0007;
+        public static final int tibisay_movil=0x7f0a0008;
     }
     public static final class plurals {
@@ -261,4 +263,5 @@
         public static final int certificados=0x7f050044;
         public static final int certificate_password=0x7f050010;
+        public static final int certificate_to_load_description=0x7f05006a;
         public static final int certificatedescription=0x7f050015;
         public static final int certificates_dir=0x7f05004c;
@@ -351,4 +354,5 @@
         public static final int title_activity_activity_signer_info=0x7f050052;
         public static final int title_activity_bdocverify_result=0x7f050049;
+        public static final int title_activity_certificate_to_load=0x7f050069;
         public static final int title_activity_downloader=0x7f05005c;
         public static final int title_activity_encryption_certificates=0x7f050064;
Index: TibisayMovil/res/layout/activity_certificate_to_load.xml
===================================================================
--- TibisayMovil/res/layout/activity_certificate_to_load.xml	(revision d5ab40f3baaaa44a8bff997e091c8be2b60055c0)
+++ TibisayMovil/res/layout/activity_certificate_to_load.xml	(revision d5ab40f3baaaa44a8bff997e091c8be2b60055c0)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical" >
+ 
+    
+    
+    <TextView
+        android:id="@+id/certificate_to_load_description"
+        style="@style/style_description"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/certificate_to_load_description" />
+    
+    
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingLeft="5dp"
+        android:orientation="horizontal"
+        style="@style/style_path_file_browser">
+    <TextView
+        android:id="@+id/pathstring"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" 
+        style="@style/style_font_section" 
+        />
+       <TextView
+        android:id="@+id/path"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" 
+        style="@style/style_font_section"
+        />
+    
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="0.40" >
+
+        <ListView
+            android:id="@+id/file_list"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:choiceMode="singleChoice"
+  	 		style="@style/style_listviews"
+				  />         
+
+ 
+            
+    </LinearLayout>
+  
+   <LinearLayout 
+       
+        android:layout_width="match_parent"
+        android:layout_height="3dp"
+        android:background="#777777"></LinearLayout>
+  
+    <include
+        android:id="@+id/button_bar"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        layout="@layout/actionbar_main" />
+
+</LinearLayout>
Index: TibisayMovil/res/layout/activity_file_to_share.xml
===================================================================
--- TibisayMovil/res/layout/activity_file_to_share.xml	(revision 6b383b31431d186a217999400c0025f006d4f9ab)
+++ TibisayMovil/res/layout/activity_file_to_share.xml	(revision d5ab40f3baaaa44a8bff997e091c8be2b60055c0)
@@ -8,5 +8,5 @@
     
     <TextView
-        android:id="@+id/share_description"
+        android:id="@+id/certificate_to_load_description"
         style="@style/style_description"
         android:layout_width="fill_parent"
Index: TibisayMovil/res/menu/certificate_to_load.xml
===================================================================
--- TibisayMovil/res/menu/certificate_to_load.xml	(revision d5ab40f3baaaa44a8bff997e091c8be2b60055c0)
+++ TibisayMovil/res/menu/certificate_to_load.xml	(revision d5ab40f3baaaa44a8bff997e091c8be2b60055c0)
@@ -0,0 +1,9 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+
+    <item
+        android:id="@+id/action_settings"
+        android:orderInCategory="100"
+        android:showAsAction="never"
+        android:title="@string/action_settings"/>
+
+</menu>
Index: TibisayMovil/res/values/strings.xml
===================================================================
--- TibisayMovil/res/values/strings.xml	(revision 4528953bef110cd13331d164bc3f6c13097c4b0e)
+++ TibisayMovil/res/values/strings.xml	(revision d5ab40f3baaaa44a8bff997e091c8be2b60055c0)
@@ -112,13 +112,12 @@
     <string name="manage_certificates_for_encryption">Gestionar certificados para cifrado</string>
     <string name="title_activity_encryption_certificates">EncryptionCertificatesActivity</string>
-    
-    
     <string name="label_recipient_certificate">Certificados de destinatarios</string>
     <string name="label_certificate_to_remove">Certificado a eliminar:</string>
-    
     <string name="label_add_recipient_certificate">Agregar</string>
     <string name="label_remove_recipient_certificate">Eliminar</string>
+    <string name="title_activity_certificate_to_load">CertificateToLoadActivity</string>
+
     
+    <string name="certificate_to_load_description">Seleccione el certificado a cargar</string>
     
-
 </resources>
Index: TibisayMovil/src/ve/gob/cenditel/tibisaymovil/CertificateToLoadActivity.java
===================================================================
--- TibisayMovil/src/ve/gob/cenditel/tibisaymovil/CertificateToLoadActivity.java	(revision d5ab40f3baaaa44a8bff997e091c8be2b60055c0)
+++ TibisayMovil/src/ve/gob/cenditel/tibisaymovil/CertificateToLoadActivity.java	(revision d5ab40f3baaaa44a8bff997e091c8be2b60055c0)
@@ -0,0 +1,713 @@
+package ve.gob.cenditel.tibisaymovil;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.cert.X509Certificate;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+
+import ee.sk.digidoc.DigiDocException;
+import ee.sk.digidoc.SignedDoc;
+
+import ve.gob.cenditel.tibisaymovil.R;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.graphics.drawable.Drawable;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.Environment;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.View.OnClickListener;
+import android.view.Window;
+import android.webkit.MimeTypeMap;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.RadioButton;
+import android.widget.TextView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.Toast;
+
+public class CertificateToLoadActivity extends Activity implements OnItemClickListener, OnClickListener {
+
+	private File cwd;
+    private File selected;
+    private FileBrowserView viewHolder;
+    private FileListAdapter listAdapter;
+    private String filterMImeType = "application/pdf";
+    
+    // cadena que mantiene la ruta del archivo a compartir
+    private String fileToLoad = null;
+
+    
+    //ruta del directorio que almancena los certificados de destinatarios
+    String certificatesDir;
+    
+	@Override
+	protected void onCreate(Bundle savedInstanceState) {
+		//Estilando la barra de titulo
+		final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
+
+		super.onCreate(savedInstanceState);
+		
+		this.viewHolder = new FileBrowserView();	
+
+        if (savedInstanceState != null) {
+        	if(savedInstanceState.getString("selected") != null)
+        		this.selected = new File(savedInstanceState.getString("selected"));
+
+            if (this.selected != null) {
+            	
+            	CertificateToLoadActivity.this.updateButton
+            	(CertificateToLoadActivity.this.viewHolder.accept,true);
+
+            }
+            
+            this.cwd = new File(savedInstanceState.getString("cwd"));
+            this.viewHolder.fileList.setAdapter(this.listAdapter = new FileListAdapter(this.cwd.getAbsolutePath(), filterMImeType));
+            
+        } else {
+            this.selected = null;
+            this.viewHolder.fileList.setAdapter(this.listAdapter = new FileListAdapter());
+        }
+        
+        
+        boolean enabled = false;
+        if (this.selected != null)
+        	enabled = this.viewHolder.accept.isEnabled();
+        
+        CertificateToLoadActivity.this.updateButton
+        (CertificateToLoadActivity.this.viewHolder.accept,enabled);
+        
+        //Estilando Barra de titulo
+		if(customTitleSupported)
+			getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_bar);
+		
+	    // asignar ruta de certificados de destinatarios
+		certificatesDir = Environment.getExternalStorageDirectory().getAbsolutePath() + "/" +
+		getResources().getString(R.string.app_name) + "/" +
+		getResources().getString(R.string.certificates_dir) + "/";
+		//Toast.makeText(getApplicationContext(), "certificatesDir: "+ certificatesDir, Toast.LENGTH_SHORT).show();
+
+	}
+
+	
+    /**
+     * Provides the data to be shown in the file browser ListView.
+     *
+     * @author José M. Prieto (jmprieto@emergya.com)
+     */
+    private class FileListAdapter extends BaseAdapter {
+
+        private final ArrayList<File> directories;
+        private final ArrayList<File> files;
+
+        private FileListAdapter() {
+            this("/",filterMImeType);
+        }
+
+        private FileListAdapter(String location) {
+            this(location, "");
+        }
+        
+        private FileListAdapter(String location, String filterMimeType) {
+        	
+            directories = new ArrayList<File>();
+            files = new ArrayList<File>();
+            
+            //Obtiene etiqueta que se colocará antes del path que visualizará el usuario
+        	String toPathText = CertificateToLoadActivity.this.getString(R.string.pathstring)+":   ";
+        	//Coloca el texto de la etiqueta en la vista
+        	CertificateToLoadActivity.this.viewHolder.pathString.setText(toPathText);
+        	//Coloca el texto con el path actual
+        	CertificateToLoadActivity.this.viewHolder.path.setText(location);
+        	//Crea un objeto file cwd con la ubicacion dada en location
+            CertificateToLoadActivity.this.cwd = new File(location);
+            //Obtiene el directorio padre del objeto file cwd
+            File parent = CertificateToLoadActivity.this.cwd.getParentFile();
+            //Si tiene un padre, lo agrega en la posición cero de la lista de directorios  
+            
+            if (parent != null) {
+                directories.add(0, parent);
+            }
+            
+            //Crea un arreglo con las lista de archivos contenidos en el directorio cwd
+            File[] ls = CertificateToLoadActivity.this.cwd.listFiles();
+            if (ls != null) {
+                for (File f : ls) { //recorre todos los archivos contenidos en el directorio
+                	
+                    if (FsUtils.isHiddenOrNotReadable(f)) { // Si son ocultos no hace nada
+                        continue;
+                    }
+                  // Si son directorios los agrega a la lista de directorios a partir de la posición 1
+                  // En la posición 0 se encuentra el directorio padre  
+                    if (f.isDirectory()) {
+                        directories.add(f);
+                    } else // De lo contrario lo agrega a la lista de archivos 
+                    	{
+                    	//Valida tipo de archivo a mostrar
+                        Uri selectedUri = Uri.fromFile(f);
+                        String fileExtension = MimeTypeMap.getFileExtensionFromUrl(selectedUri.toString());
+                        String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension);
+                          
+//                          Toast.makeText(CertificateToLoadActivity.this,
+//                          "FileExtension: " + fileExtension + "\n" +
+//                          "MimeType: " + mimeType,
+//                          Toast.LENGTH_LONG).show();
+                        
+                                                  
+                        //Filtra por mimeType: se consideran los .pem .crt .cer
+                        if(filterMimeType.isEmpty() || /*filterMimeType == mimeType*/ fileExtension.equals("pem")
+                        		|| fileExtension.equals("crt") || fileExtension.equals("cer"))                        
+                            files.add(f);
+                        	
+                    }
+                }
+            }
+
+            Collections.sort(directories); // Ordena los directorios alfabeticamente
+            Collections.sort(files); // Ordena los archivos alfabeticamente
+        }
+       
+        /**
+         * Retorna cantidad total de elementos que se listarán en el directorio.
+         */
+        @Override 
+        public int getCount() {
+        	
+            return directories.size() + files.size();
+            
+        }
+
+        /**
+         * Dada una posición en el listado del directorio, retorna un archivo o directorio
+         * según corresponda.
+         */
+        @Override
+        public File getItem(int position) {
+
+            if (position < directories.size()) {
+                return directories.get(position);
+            } else {
+                return files.get(position - directories.size());
+            }
+        }
+
+        /**
+         * Retorna un código hash para el archivo, permite comparar si dos archivos son los mismos
+         */
+        @Override
+        public long getItemId(int position) {
+
+            return getItem(position).hashCode();
+        }
+        
+        /**
+         * Crea la visualización de cada item del fileBrowser
+         */
+        @Override
+        public View getView(int position, View convertView, ViewGroup parent) {
+
+        	//Crea la vista de cada fila del filebrowser a partir del layout
+            if (convertView == null) {
+                LayoutInflater inflater = LayoutInflater.from(CertificateToLoadActivity.this);
+                convertView = inflater.inflate(R.layout.file_to_verify_bdoc_signature_item, parent, false); 
+            }
+            
+            // Se enlaza a cada componente del layout 
+            ImageView image = (ImageView) convertView.findViewById(R.id.type_image);
+            TextView fileName = (TextView) convertView.findViewById(R.id.filename_text);
+            TextView modified = (TextView) convertView.findViewById(R.id.filename_modified);
+            
+            // Se obtiene el archivo ubicado en position
+        	File file = getItem(position);
+        	
+        	//RadioButton
+            RadioButton radio = (RadioButton) convertView.findViewById(R.id.file_radio);
+            radio.setFocusable(false);
+            
+            // Se asignan los iconos según el tipo de archivo y se oculta el radio en los directorios
+            if (file.isDirectory()) {
+                image.setImageResource(R.drawable.ic_carpeta);
+                radio.setVisibility(View.INVISIBLE);
+                radio.setChecked(false);
+            } else {
+                image.setImageResource(R.drawable.ic_archivo);
+                radio.setVisibility(View.VISIBLE);
+                
+                if (CertificateToLoadActivity.this.selected == null ||
+	            	CertificateToLoadActivity.this.selected.hashCode() != file.hashCode()){
+	            		radio.setChecked(false);
+            	} else{
+            		radio.setChecked(true);
+            	}         
+            }
+
+            // Si es el directorio que hace referencia al padre le coloca como nombre ".."
+            if (file.isDirectory() && position == 0 && ! "/".equals(CertificateToLoadActivity.this.cwd.getAbsolutePath())) {
+                fileName.setText("..");
+            } else {
+                fileName.setText(file.getName());
+            }
+ 
+            
+            //Datos de modificación del archivo
+            SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
+            Date date = new Date(file.lastModified());
+            
+            String dateString = CertificateToLoadActivity.this.getString(R.string.modified)+": ";
+            if (file.lastModified()>0)
+            	modified.setText(dateString+sdf.format(date));
+            else
+            	modified.setText(dateString+"-");
+            
+            return convertView;
+        }
+        
+        /**
+         * Controla la selección de cada item del fileBrowser
+         */
+        public void select(ListView parent, int position) {
+
+            File item = getItem(position);
+            //Si es un directorio el seleccionado se hace un llamado del fileBrowser del directorio
+            if (item.isDirectory()) {
+                parent.setAdapter(CertificateToLoadActivity.this.listAdapter = new FileListAdapter(item.getAbsolutePath(), filterMImeType));
+            } else { // Si es un archivo
+            	
+        		//Se agrega el archivo a la lista de seleccionados si no se encuentra en la misma            	
+            	if (CertificateToLoadActivity.this.selected == null || 
+            		CertificateToLoadActivity.this.selected.hashCode() != item.hashCode()){
+            		
+            		CertificateToLoadActivity.this.selected = item;
+            		
+            		CertificateToLoadActivity.this.updateButton(CertificateToLoadActivity.this.viewHolder.accept,true);  		
+            		            		
+            	}
+            	else{ // De lo contrario se elimina de la lista de seleccionados
+                	
+            		CertificateToLoadActivity.this.selected = null;             		
+                	CertificateToLoadActivity.this.updateButton(CertificateToLoadActivity.this.viewHolder.accept,false);
+                	               	
+                }
+                notifyDataSetChanged();
+           }
+        }       
+    }    
+
+
+    
+    
+    @Override
+    protected void onSaveInstanceState(Bundle outState) {
+        super.onSaveInstanceState(outState);
+
+        outState.putParcelable("intent", this.getIntent());
+        outState.putString("cwd", this.cwd.getAbsolutePath());
+        if(this.selected != null)
+        	outState.putString("selected", this.selected.getAbsolutePath());
+        
+        }
+    
+    private void updateButton(View v, boolean bool) {
+    	try{
+
+        	v.setEnabled(bool);
+        	if (v instanceof TextView){
+        		Drawable icon = ((TextView)v).getCompoundDrawables()[1];
+        		if (icon!=null)
+        		if (bool)
+        	   		icon.setAlpha(255);
+        	   	else
+        	   		icon.setAlpha(127);	
+        	}
+        	if (v instanceof ImageView){
+        		ImageView result = (ImageView) v;
+        		if (bool)
+        			result.setAlpha(255);
+        	   	else
+        	   		result.setAlpha(127);	
+        	}
+        
+    	}catch(NullPointerException e){}
+	   		
+	}
+    
+    private void updateButton(LinearLayout layout, boolean bool) {
+    	try{
+    	layout.setEnabled(bool);
+        for (int i=0; i<layout.getChildCount();i++){
+        	this.updateButton(layout.getChildAt(i), bool);
+        }
+    	}catch(NullPointerException e){}
+	   		
+	}
+
+	
+	
+	/**
+     * Holds references to view objects.
+     *
+     * @author José M. Prieto (jmprieto@emergya.com)
+     */
+    private class FileBrowserView {
+
+        public ListView fileList;
+        public TextView path;
+        public LinearLayout accept;
+		public LinearLayout clear;
+        public TextView pathString;
+
+        public FileBrowserView() {
+
+            setContentView(R.layout.activity_certificate_to_load);
+            this.path = (TextView) findViewById(R.id.path);
+            this.pathString = (TextView) findViewById(R.id.pathstring);
+
+            this.fileList = (ListView) findViewById(R.id.file_list);
+            this.fileList.setOnItemClickListener(CertificateToLoadActivity.this);
+            this.fileList.setItemsCanFocus(true);
+         
+            
+            this.clear = (LinearLayout) findViewById(R.id.button_clear_zone);
+            this.clear.setOnClickListener(CertificateToLoadActivity.this);
+            
+            this.accept = (LinearLayout) findViewById(R.id.button_accept_zone);
+            this.accept.setOnClickListener(CertificateToLoadActivity.this);
+
+        }
+    }
+    
+	@Override
+    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+    	
+    	
+        if (parent.getId() == R.id.file_list) { // user selects a file
+            this.listAdapter.select((ListView) parent, position);
+            
+        } else { // user de-selects a file
+            //this.listAdapter.addIfSameDirectory(selectedAdapter.doUnselect((ListView) parent, position));
+        	
+        }
+        //this.viewHolder.numSelected.setText(Integer.toString(this.selected.size()));
+    }
+
+    @Override
+    public void onClick(View v) {
+
+        switch (v.getId()) {
+
+        
+        case R.id.button_clear_zone:
+        	
+        	this.selected = null;
+        	this.listAdapter.notifyDataSetChanged();
+
+        	//this.viewHolder.numSelected.setText(""+this.selected.size());
+            this.updateButton(this.viewHolder.accept, false);
+        	break;        	
+        
+
+        
+	    case R.id.button_accept_zone:
+	    	
+	    	// lanzar intent para compartir el archivo seleccionado
+	    	fileToLoad = CertificateToLoadActivity.this.selected.getAbsolutePath();
+	    	
+	    	Toast.makeText(getApplicationContext(), "CertificateToLoadActivity: "+fileToLoad, Toast.LENGTH_SHORT).show();
+	    	
+	    	loadCertificate(fileToLoad);
+
+	    	break;        	
+    
+        }
+    } // fin de onClick
+    
+	
+	
+	
+	/**
+     * Chequea la disponibilidad del directorio de /TibisayMovil/CertificatesToEncrypt
+     * @return boolean
+     */
+    private boolean checkCertificatesDirectoryAvailability() {
+    	// verificar acceso al directorio /mnt/sdcard/TibisayMovil/CertificatesToEncrypt
+	    boolean mExternalStorageAvailable = false;
+	    boolean mExternalStorageWriteable = false;
+	    String state = Environment.getExternalStorageState();
+	    
+		AlertDialog.Builder builder = new AlertDialog.Builder(CertificateToLoadActivity.this);
+		
+	    
+	    if (Environment.MEDIA_MOUNTED.equals(state)) {
+	        // We can read and write the media
+	        mExternalStorageAvailable = mExternalStorageWriteable = true;
+	        Toast.makeText(getApplicationContext(), "We can read and write the media", Toast.LENGTH_SHORT).show();
+	        
+	        // Crear directorio CertificatesToEncrypt donde se almacenan los certificados de
+	        // destinatarios para cifrado
+	        /*
+			String certificatesDir = Environment.getExternalStorageDirectory() + "/" +
+  			getResources().getString(R.string.app_name) + "/" +
+  			getResources().getString(R.string.certificates_dir) + "/";
+  			*/			
+			if (prepareDirectory(certificatesDir)){				
+				return true;
+			}else{
+				builder.setMessage("No existe el directorio "+certificatesDir+" para almacenar certificados.").setTitle("Error:");
+        	
+			}
+			
+	    } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
+	        // We can only read the media
+	        mExternalStorageAvailable = true;
+	        mExternalStorageWriteable = false;
+	        Toast.makeText(getApplicationContext(), "We can only read the media", Toast.LENGTH_SHORT).show();
+	        
+	        builder.setMessage("Directorio "+certificatesDir+ " montado de solo lectura. No se pueden almancenar certificados.").setTitle("Error:");
+       	
+	        
+	    } else {
+	        // Something else is wrong. It may be one of many other states, but all we need
+	        //  to know is we can neither read nor write
+	        mExternalStorageAvailable = mExternalStorageWriteable = false;
+	        Toast.makeText(getApplicationContext(), "we can neither read nor write", Toast.LENGTH_SHORT).show();
+	        
+	        builder.setMessage("Directorio "+certificatesDir+ " no está disponible. No se pueden almancenar certificados.").setTitle("Error:");       		
+       	
+	    }
+	    
+	    
+    	builder.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() {
+    		public void onClick(DialogInterface dialog, int id) {
+               // User cancelled the dialog
+    			CertificateToLoadActivity.this.finish();
+            }
+    	});
+	    AlertDialog dialog = builder.create();
+	    dialog.show();
+	    return false;
+    } // fin de checkCertificatesDirectoryAvailability
+    
+    /**
+     * Prepara directorio
+     * @return boolean
+     */
+    boolean prepareDirectory(String dir) 
+    {
+        try
+        {
+            if (makedirs(dir)) 
+            {
+                return true;
+            } else {
+                return false;
+            }
+        } catch (Exception e) 
+        {
+            e.printStackTrace();
+            Toast.makeText(this, "Could not initiate File System.. Is Sdcard mounted properly?", Toast.LENGTH_LONG).show();
+            return false;
+        }
+    }
+    
+    /**
+     * Crea directorio utilizando la variable tmpDir
+     * @return boolean
+     */
+    private boolean makedirs(String dir) 
+    {
+        //File tempdir = new File(extractedDirFiles);
+        File tempdir = new File(dir);
+        if (!tempdir.exists())
+            tempdir.mkdirs();
+        return (tempdir.isDirectory());
+    }
+    
+    
+    public void launchEncryptionCertificatesActivity() {
+    	Intent intent = new Intent(this, EncryptionCertificatesActivity.class);
+		startActivity(intent);
+    }
+    
+    
+    
+    
+    
+    /**
+     * Carga un certificado desde un archivo en el directorio de certificados 
+     * para cifrado 
+     * @return void
+     */
+    public void loadCertificate(String fileToLoad){
+
+    	
+    	// chequear disponibilidad de directorio de certificados
+	    if (!checkCertificatesDirectoryAvailability()){
+	    	Toast.makeText(getApplicationContext(), "CertificateToLoadActivity: directorio no disponible", Toast.LENGTH_SHORT).show();
+	    	
+	    	finish();
+	    	// lanzar el activity EncryptionCertificatesActivity
+        	launchEncryptionCertificatesActivity();
+	    	return;
+	    }
+	    
+    
+	    // cargar el archivo y verificar que es un certificado bien formado		    
+	    try {
+			X509Certificate recipientCertificate = SignedDoc.readCertificate(new File(fileToLoad));
+			
+			boolean [] keyUsage = recipientCertificate.getKeyUsage();
+			
+			Toast.makeText(getApplicationContext(), "CertificateToLoadActivity: cerrificado leido", Toast.LENGTH_SHORT).show();
+			
+			if (keyUsage == null){
+				Toast.makeText(getApplicationContext(), "CertificateToLoadActivity: keyUsage == null", Toast.LENGTH_SHORT).show();
+
+				showDialog("Error:", "El certificado seleccionado no tiene la extensión \"Cifrado de Clave \" (KeyEncipherment) para cifrado. " +
+        				"Seleccione otro certificado.");
+        		return;
+			}
+			
+			if ( keyUsage[2] ){
+				Toast.makeText(getApplicationContext(), "CertificateToLoadActivity: CERTIFICADO SI TIENE KeyEncipherment", Toast.LENGTH_SHORT).show();
+				
+				
+				// TODO verificar que el certificado no exista 
+				if (compareCertificate(recipientCertificate)){
+					
+					Toast.makeText(getApplicationContext(), "CertificateToLoadActivity: El certificado ya existe en el repositorio", Toast.LENGTH_SHORT).show();
+					
+					showDialog("Información:", "El certificado ya existe en el repositorio. Se cancela la operación.");
+					
+					return;
+				}
+				
+				// copiar el certificado al directorio de certificados
+				File f = new File(fileToLoad);
+				FsUtils.copyTo(f, certificatesDir);
+
+				showDialog("Información:", "El certificado se cargó exitosamente.");
+        		
+        		return;					
+				
+			}else{
+
+				showDialog("Error:", "El certificado seleccionado no tiene la extensión \"Cifrado de Clave \" (KeyEncipherment) para cifrado. " +
+						"Seleccione otro certificado.");
+				
+        		return;
+			}
+
+
+		} catch (DigiDocException e1) {
+			e1.printStackTrace();
+			Toast.makeText(getApplicationContext(), "CertificateToLoadActivity: "+ e1.getMessage(), Toast.LENGTH_SHORT).show();
+			
+			showDialog("Error:", e1.getMessage());			
+    			
+    		return;
+			
+			
+		} catch (IOException e) {
+			
+			Toast.makeText(getApplicationContext(), "CertificateToLoadActivity: ERROR no se pudo corpiar el certificado al directorio de certificados", 
+					Toast.LENGTH_SHORT).show();
+			
+			showDialog("Error:", e.getMessage());
+					
+    		return;
+			
+		}
+    }
+    
+    /**
+     * Compara el certificado pasado como argumento con los certificados existentes en 
+     * el directorio de certificados.  
+     * 
+     * @return verdadero si ya existe el certificado en el directorio
+     */
+    public boolean compareCertificate(X509Certificate obj){
+    	
+    	// obtener lista de archivos del directorio de certificados
+    	
+    	File certificateDirectory = new File(certificatesDir);
+    	
+    	File[] ls = certificateDirectory.listFiles();
+        if (ls != null) {
+            for (File f : ls) { //recorre todos los archivos contenidos en el directorio
+            	
+            	if (FsUtils.isHiddenOrNotReadable(f)) { // Si son ocultos no hace nada
+                    continue;
+                }
+                
+                // iterar por cada archivo y verificar si certificado es igual a obj
+                
+            	X509Certificate certificateRead;
+				try {
+					certificateRead = SignedDoc.readCertificate(f);
+					if (obj.equals(certificateRead)){
+	                	return true;
+	                }
+				} catch (DigiDocException e) {
+					e.printStackTrace();
+					Toast.makeText(getApplicationContext(), "CertificateToLoadActivity: "+ e.getMessage(), Toast.LENGTH_SHORT).show();
+					
+					showDialog("Error:", e.getMessage());
+				}
+                                
+            
+            }
+            return false;
+        }
+    	
+    	return false;
+    }
+    
+    /**
+     * Crea un dialogo con el titulo y mensaje como argumentos y lo despliega  
+     * 
+     * @return void
+     */
+    public void showDialog(String title, String msg) {
+    	
+    	// 1. Instantiate an AlertDialog.Builder with its constructor
+		AlertDialog.Builder builder = new AlertDialog.Builder(CertificateToLoadActivity.this);
+
+		// 2. Chain together various setter methods to set the dialog characteristics
+		builder.setMessage(msg)
+	       	.setTitle(title);
+
+		builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
+            public void onClick(DialogInterface dialog, int id) {
+                // User clicked OK button                                            	
+            	Toast.makeText(getApplicationContext(), "User clicked OK button", Toast.LENGTH_LONG).show();
+            	finish();                        	
+            	
+            	// lanzar el activity EncryptionCertificatesActivity
+            	launchEncryptionCertificatesActivity();
+            }
+    		});
+		
+		// 3. Get the AlertDialog from create()            		
+		AlertDialog dialog = builder.create();
+		dialog.show();	
+    	
+    }
+    
+}
+
Index: TibisayMovil/src/ve/gob/cenditel/tibisaymovil/EncryptionCertificatesActivity.java
===================================================================
--- TibisayMovil/src/ve/gob/cenditel/tibisaymovil/EncryptionCertificatesActivity.java	(revision 4528953bef110cd13331d164bc3f6c13097c4b0e)
+++ TibisayMovil/src/ve/gob/cenditel/tibisaymovil/EncryptionCertificatesActivity.java	(revision d5ab40f3baaaa44a8bff997e091c8be2b60055c0)
@@ -74,4 +74,7 @@
 	protected void onCreate(Bundle savedInstanceState) {
 		
+		
+		
+		
 		//Estilando la barra de titulo
 		final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
@@ -83,8 +86,5 @@
 		if(customTitleSupported)
 			getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_bar);
-		
-		
-		
-		
+	
 		button_remove = (LinearLayout) this.findViewById(R.id.button_remove_certificate_zone);
         button_add = (LinearLayout) this.findViewById(R.id.button_add_certificate_zone);
@@ -102,4 +102,10 @@
 	    final ArrayList<RecipientCertificate> certificates = new ArrayList<RecipientCertificate>();
 
+	    // asignar ruta de certificados de destinatarios
+		certificatesDir = Environment.getExternalStorageDirectory().getAbsolutePath() + "/" +
+		getResources().getString(R.string.app_name) + "/" +
+		getResources().getString(R.string.certificates_dir) + "/";
+		//Toast.makeText(getApplicationContext(), "certificatesDir: "+ certificatesDir, Toast.LENGTH_SHORT).show();
+	    
 	    // chequear disponibilidad de directorio de certificados
 	    if (!checkCertificatesDirectoryAvailability()){
@@ -109,5 +115,5 @@
 	    // Leer el contenido del directorio de certificados
 	    // Crea un arreglo con las lista de archivos contenidos en el directorio cwd
-        File f = new File("/mnt/sdcard/TibisayMovil/CertificatesToEncrypt");
+        File f = new File(certificatesDir);
 	    File[] ls = f.listFiles();
 	    	    
@@ -160,21 +166,10 @@
 				
 				certificateToRemove.setText(c.getName());
-				
-				
-				Toast.makeText(getApplicationContext(), "click sobre certificado"+ c.getName(), Toast.LENGTH_SHORT).show();				
+								
+				//Toast.makeText(getApplicationContext(), "click sobre certificado"+ c.getName(), Toast.LENGTH_SHORT).show();				
 	            	
 			}			
 		});
 
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
         
         
@@ -192,5 +187,9 @@
 		        
 		        //finish();
-            	Toast.makeText(getApplicationContext(), "agregar un certificado", Toast.LENGTH_SHORT).show();
+            	Toast.makeText(getApplicationContext(), "Se debe agregar un certificado", Toast.LENGTH_SHORT).show();
+            	
+            	// llamar a función para cargar certificado
+            	loadNewCertificate();
+            	
             }
         });
@@ -283,4 +282,15 @@
 	}
 
+	
+	/**
+     * Carga un nuevo certificado al lanzar CertificateToLoadActivity. 
+     * @return void
+     */
+	public void loadNewCertificate() {
+		Intent intent = new Intent(this, CertificateToLoadActivity.class);
+		startActivity(intent);
+		finish(); 
+		
+	}
 	
 	
@@ -424,7 +434,9 @@
 	        // Crear directorio CertificatesToEncrypt donde se almacenan los certificados de
 	        // destinatarios para cifrado
-			String certificatesDir = Environment.getExternalStorageDirectory() + "/" +
+			/*
+	        String certificatesDir = Environment.getExternalStorageDirectory() + "/" +
   			getResources().getString(R.string.app_name) + "/" +
-  			getResources().getString(R.string.certificates_dir) + "/";			
+  			getResources().getString(R.string.certificates_dir) + "/";
+  			*/			
 			if (prepareDirectory(certificatesDir)){				
 				return true;
