Index: TibisayMovil/src/ve/gob/cenditel/tibisaymovil/DirectCertificateAdapter.java
===================================================================
--- TibisayMovil/src/ve/gob/cenditel/tibisaymovil/DirectCertificateAdapter.java	(revision 288126d7faf1d05b5222029383542ccbbb4d4a26)
+++ TibisayMovil/src/ve/gob/cenditel/tibisaymovil/DirectCertificateAdapter.java	(revision 288126d7faf1d05b5222029383542ccbbb4d4a26)
@@ -0,0 +1,118 @@
+package ve.gob.cenditel.tibisaymovil;
+
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import android.content.Context;
+import android.os.AsyncTask;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.CheckBox;
+import android.widget.ListView;
+import android.widget.TextView;
+
+
+
+public class DirectCertificateAdapter extends BaseAdapter {
+
+    private final List<String> aliases;
+    private final List<String> subjects = new ArrayList<String>();
+    private DirectKeyChain keyChain;
+	private Context context;
+
+    public DirectCertificateAdapter(DirectKeyChain keyChain, Context context)
+    throws KeystoreException {
+        this.context=context;
+        this.aliases = Collections.list(keyChain.getAliases());
+        this.subjects.addAll(Collections.nCopies(this.aliases.size(), (String) null));
+        this.keyChain = keyChain;
+    }
+
+    @Override public int getCount() {
+
+        return this.aliases.size();
+    }
+
+    @Override public String getItem(int adapterPosition) {
+
+        return this.aliases.get(adapterPosition);
+    }
+
+    @Override public long getItemId(int adapterPosition) {
+
+        return adapterPosition;
+    }
+
+    @Override public View getView(final int position, View convertView, ViewGroup parent) {
+
+        if (convertView == null) {
+            LayoutInflater inflater = LayoutInflater.from(this.context);
+            convertView = inflater.inflate(R.layout.cert_item, parent, false);
+        }
+
+        TextView aliasTextView = (TextView) convertView.findViewById(R.id.cert_item_alias);
+        TextView subjectTextView = (TextView) convertView.findViewById(R.id.cert_item_subject);
+        CheckBox checkBox = (CheckBox) convertView.findViewById(R.id.cert_item_selected);
+
+        String alias = this.aliases.get(position);
+        convertView.setTag(alias);
+        aliasTextView.setText(alias);
+
+        String subject = this.subjects.get(position);
+        if (subject == null) {
+            new CertLoader(position, subjectTextView, this.keyChain).execute();
+        } else {
+            subjectTextView.setText(subject);
+        }
+
+        
+        
+        ListView lv = (ListView)parent;
+        /*
+        //Old monochoice code.
+        int listViewCheckedItemPosition = lv.getCheckedItemPosition();
+        int adapterCheckedItemPosition = listViewCheckedItemPosition;
+        checkBox.setChecked(position == adapterCheckedItemPosition);
+        */
+        checkBox.setChecked(lv.getCheckedItemPositions().get(position));
+        
+        return convertView;
+    }
+
+    private class CertLoader extends AsyncTask<Void, Void, String> {
+
+        private final int adapterPosition;
+        private final TextView subjectView;
+        private DirectKeyChain keyChain;
+
+        private CertLoader(int adapterPosition, TextView subjectView, DirectKeyChain keyChain) {
+
+            this.adapterPosition = adapterPosition;
+            this.subjectView = subjectView;
+            this.keyChain = keyChain;
+        }
+
+        @Override protected String doInBackground(Void... params) {
+
+            String alias = DirectCertificateAdapter.this.aliases.get(this.adapterPosition);
+            X509Certificate cert;
+            try {
+                cert = this.keyChain.getCertificateChain(alias)[0];
+                // bouncycastle can handle the emailAddress OID of 1.2.840.113549.1.9.1
+                return cert.getSubjectDN().getName();
+            } catch (KeystoreException e) {
+                return "";
+            }
+        }
+
+        @Override protected void onPostExecute(String subjectString) {
+
+            DirectCertificateAdapter.this.subjects.set(this.adapterPosition, subjectString);
+            this.subjectView.setText(subjectString);
+        }
+    }
+}
