Index: java/GraphTest.java
===================================================================
--- java/GraphTest.java	(revision 5cf72ccdd982c58a67aed1341c8007e5279554ed)
+++ java/GraphTest.java	(revision e1c49cea860ee98f83b868315f07306f51f915cf)
@@ -1,5 +1,4 @@
 import java.io.*;
 import java.util.*;
-import java.util.zip.*;
 
 import edu.uci.ics.jung.graph.*;
@@ -50,5 +49,5 @@
 		    graph.add_credential(new Credential(f));
 		else if (f.getPath().endsWith(".zip"))
-		    for (Credential c :Credential.readZipFile(new ZipFile(f), kp, errs)) 
+		    for (Credential c :Credential.readZipFile(f, kp, errs)) 
 			graph.add_credential(c);
 		else
Index: java/net/deterlab/abac/Credential.java
===================================================================
--- java/net/deterlab/abac/Credential.java	(revision 5cf72ccdd982c58a67aed1341c8007e5279554ed)
+++ java/net/deterlab/abac/Credential.java	(revision e1c49cea860ee98f83b868315f07306f51f915cf)
@@ -216,8 +216,11 @@
      * are added indexed by filename.
      */
-    static public Collection<Credential> readZipFile(ZipFile z, 
-	    Collection<KeyPair> keys, Map<String, Exception> errors) {
+    static public Collection<Credential> readZipFile(File zf, 
+	    Collection<KeyPair> keys, Map<String, Exception> errors) 
+		throws IOException {
 	Vector<Credential> creds = new Vector<Credential>();
 	Vector<ZipEntry> derFiles = new Vector<ZipEntry>();
+
+	ZipFile z = new ZipFile(zf);
 
 	for (Enumeration<? extends ZipEntry> ze = z.entries(); 
@@ -267,13 +270,14 @@
     }
 
-    static public Collection<Credential> readZipFile(ZipFile d) {
+    static public Collection<Credential> readZipFile(File d) 
+	    throws IOException {
 	return readZipFile(d, null, null);
     }
-    static public Collection<Credential> readZipFile(ZipFile d, 
-	    Map<String, Exception> errors) {
+    static public Collection<Credential> readZipFile(File d, 
+	    Map<String, Exception> errors) throws IOException {
 	return readZipFile(d, null, errors);
     }
-    static public Collection<Credential> readZipFile(ZipFile d, 
-	    Collection<KeyPair> keys) {
+    static public Collection<Credential> readZipFile(File d, 
+	    Collection<KeyPair> keys) throws IOException {
 	return readZipFile(d, keys, null);
     }
@@ -291,6 +295,13 @@
 	Vector<Credential> creds = new Vector<Credential>();
 	Vector<File> derFiles = new Vector<File>();
-
-	for (File f: d.listFiles() ) {
+	Collection<File> files = new Vector<File>();
+
+	if (d.isDirectory() ) 
+	    for (File f : d.listFiles()) 
+		files.add(f);
+	else files.add(d);
+
+	System.err.println(files);
+	for (File f: files ) {
 	    Object o = null;
 	    try {
@@ -375,9 +386,28 @@
 private Identity m_id;
 
+    /**
+     * Put the Identity into the set of ids used to validate certificates.
+     * Also put the keyID and name into the translation mappings used by Roles
+     * to pretty print.  In the role mapping, if multiple ids use the same
+     * common name they are disambiguated.  Only one entry for keyid is
+     * allowed.
+     */
     public static void addIdentity(Identity id) { 
 	s_ids.add(id);
-	if (id.getName() != null && id.getKeyID() != null) 
-	    Role.add_mapping(id.getName(), id.getKeyID());
+	if (id.getName() != null && id.getKeyID() != null) {
+	    if ( !Role.key_in_mapping(id.getKeyID()) ) {
+		String name = id.getName();
+		int n= 1;
+
+		while (Role.name_in_mapping(name)) {
+		    name = id.getName() + n++;
+		}
+		Role.add_mapping(name, id.getKeyID());
+	    }
+	}
     }
     public static Collection<Identity> identities() { return s_ids; }
+    public static void clearIdentities() {
+	s_ids.clear(); Role.clear_mapping();
+    }
 }
Index: java/net/deterlab/abac/Role.java
===================================================================
--- java/net/deterlab/abac/Role.java	(revision 5cf72ccdd982c58a67aed1341c8007e5279554ed)
+++ java/net/deterlab/abac/Role.java	(revision e1c49cea860ee98f83b868315f07306f51f915cf)
@@ -198,3 +198,13 @@
     }
 
+    public static boolean key_in_mapping(String key) {
+	return keys.containsKey(key);
+    }
+
+    public static boolean name_in_mapping(String name) {
+	return nicknames.containsKey(name);
+    }
+
+    public static void clear_mapping() { nicknames.clear(); keys.clear(); }
+
 }
