Index: java/net/deterlab/abac/Credential.java
===================================================================
--- java/net/deterlab/abac/Credential.java	(revision 5b277d6ee942bb7374163593c288b9c6ff35b4c6)
+++ java/net/deterlab/abac/Credential.java	(revision d31242cee9f54941e5f087c750472b262d42eff8)
@@ -34,4 +34,11 @@
     /** The expiration time of the credential */
     protected Date m_expiration;
+    /** 
+     * Suggested file suffix to save this format credential under.  Subclasses
+      should override it.
+     */
+    protected String suffix;
+    /** Default file suffix. */
+    private static final String defSuffix = ".cred";
 
     /**
@@ -42,4 +49,5 @@
 	id = null;
 	m_expiration = null;
+	suffix = defSuffix;
     }
     /**
@@ -56,4 +64,5 @@
 	id = null;
 	m_expiration = null;
+	suffix = defSuffix;
     }
 
@@ -88,7 +97,5 @@
      */
     Credential(File file, Collection<Identity> ids) 
-	    throws ABACException {
-	 this();
-    }
+	    throws ABACException { this(); }
 
     /**
@@ -105,7 +112,5 @@
      */
     Credential(InputStream s, Collection<Identity> ids) 
-	    throws ABACException {
-	 this();
-    }
+	    throws ABACException { this(); }
 
     /**
@@ -245,3 +250,17 @@
     public Identity issuer() { return id; }
 
+    /**
+     * Return an suggested suffix for output files (most start with a ".").
+     * @return a String, an optional suffix for output files.
+     */
+    public String getSuffix() { return suffix; } 
+
+    /**
+     * Set the suggested suffix for output files (most start with a ".").
+     * Available for subclasses to set the value without knowing the member
+     * name.
+     * @param suff a String, an optional suffix for output files.
+     */
+    protected void setSuffix(String suff) { suffix = suff; } 
+
 }
Index: java/net/deterlab/abac/GENICredential.java
===================================================================
--- java/net/deterlab/abac/GENICredential.java	(revision 5b277d6ee942bb7374163593c288b9c6ff35b4c6)
+++ java/net/deterlab/abac/GENICredential.java	(revision d31242cee9f54941e5f087c750472b262d42eff8)
@@ -32,4 +32,6 @@
     /** The signed XML representing this credential */
     protected Document doc;
+    /** The GENI credential suffix */
+    private static final String fileSuffix = ".xml";
 
     /**
@@ -90,4 +92,5 @@
 	super();
 	doc = null;
+	setSuffix(fileSuffix);
     }
     /**
@@ -102,4 +105,5 @@
 	super(head, tail);
 	doc = null; 
+	setSuffix(fileSuffix);
     }
 
@@ -342,4 +346,6 @@
     GENICredential(String filename, Collection<Identity> ids) 
 	throws ABACException { 
+	super();
+	setSuffix(fileSuffix);
 	try {
 	    init(new FileInputStream(filename), ids);
@@ -365,4 +371,6 @@
     GENICredential(File file, Collection<Identity> ids) 
 	    throws ABACException {
+	super();
+	setSuffix(fileSuffix);
 	try {
 	    init(new FileInputStream(file), ids);
@@ -386,5 +394,9 @@
      */
     GENICredential(InputStream s, Collection<Identity> ids) 
-	    throws ABACException { init(s, ids); }
+	    throws ABACException { 
+	super();
+	setSuffix(fileSuffix);
+	init(s, ids);
+    }
 
     /**
Index: java/net/deterlab/abac/X509Credential.java
===================================================================
--- java/net/deterlab/abac/X509Credential.java	(revision 5b277d6ee942bb7374163593c288b9c6ff35b4c6)
+++ java/net/deterlab/abac/X509Credential.java	(revision d31242cee9f54941e5f087c750472b262d42eff8)
@@ -30,4 +30,6 @@
     /** The certificate representing this credential */
     protected X509V2AttributeCertificate ac;
+    /** The X.509 credential suffix */
+    private static final String fileSuffix = ".der";
 
     /** Make sure BouncyCastle is loaded */
@@ -40,4 +42,5 @@
 	super();
 	ac = null;
+	setSuffix(fileSuffix);
     }
     /**
@@ -52,4 +55,5 @@
 	super(head, tail);
 	ac = null; 
+	setSuffix(fileSuffix);
     }
 
@@ -140,4 +144,6 @@
     X509Credential(String filename, Collection<Identity> ids) 
 	throws ABACException { 
+	super();
+	setSuffix(fileSuffix);
 	try {
 	    init(new FileInputStream(filename), ids); 
@@ -163,4 +169,6 @@
     X509Credential(File file, Collection<Identity> ids) 
 	    throws ABACException {
+	super();
+	setSuffix(fileSuffix);
 	try {
 	    init(new FileInputStream(file), ids);
@@ -184,5 +192,9 @@
      */
     X509Credential(InputStream s, Collection<Identity> ids) 
-	    throws ABACException { init(s, ids); }
+	    throws ABACException { 
+	super();
+	setSuffix(fileSuffix);
+	init(s, ids);
+    }
 
     /**
@@ -202,4 +214,6 @@
 	    Collection<Identity> ids) 
 	    throws ABACException {
+	super();
+	setSuffix(fileSuffix);
 	ac = c;
 	init(ids);
Index: java/net/deterlab/abac/regression/WriteCreds.java
===================================================================
--- java/net/deterlab/abac/regression/WriteCreds.java	(revision 5b277d6ee942bb7374163593c288b9c6ff35b4c6)
+++ java/net/deterlab/abac/regression/WriteCreds.java	(revision d31242cee9f54941e5f087c750472b262d42eff8)
@@ -23,5 +23,7 @@
     }
     /**
-     * Create a new GENI simple proof test
+     * Create a new Credential/Identity writing test for the given class of
+     * credentials.
+     * @param cn a String containing the binary name of the class to test
      */
      public WriteCreds(String cn) { 
@@ -52,18 +54,9 @@
 	    Collections.addAll(ids, acme, globotron, alice, bob);
 
-	    try {
-		ctxt.setCredentialFactory(new CredentialFactory(
-			    new String[] { className }));
-	    }
-	    catch (ABACException e) {
-		setReason(e.getMessage());
-		throw e;
-	    }
-
 	    for ( Identity i: ids) 
 		writeCombinedIdentity(i, scratch);
 
 	    ctxt.setCredentialFactory(new CredentialFactory(
-			new String[] {"net.deterlab.abac.GENICredential"}));
+			new String[] { className}));
 
 
@@ -96,6 +89,6 @@
 	    int i =0;
 	    for (Credential cc: creds) {
-		cc.write(new File(scratch, "e" + i + ".cred").toString());
-		i ++;
+		cc.write(new File(scratch,"e" + i + cc.getSuffix()).toString());
+		i++;
 	    }
 
