Index: java/net/deterlab/abac/Credential.java
===================================================================
--- java/net/deterlab/abac/Credential.java	(revision 84f0e7a4da6df1ae9c533c9c8958bce33f2144ca)
+++ java/net/deterlab/abac/Credential.java	(revision 05953726ec721137e596dd936e8ee15f70ba66a9)
@@ -26,4 +26,9 @@
     protected static String authKeyOID = "2.5.29.35";
 
+    private Role m_head;
+    private Role m_tail;
+    private X509V2AttributeCertificate ac;
+    private Identity id;
+
     /**
      * A dummy credential.
@@ -31,6 +36,6 @@
     public Credential() {
 	m_head = m_tail = null;
-	m_ac = null;
-	m_id = null;
+	ac = null;
+	id = null;
     }
     /**
@@ -42,6 +47,6 @@
         m_head = head;
         m_tail = tail;
-	m_ac = null; 
-	m_id = null;
+	ac = null; 
+	id = null;
     }
 
@@ -53,5 +58,5 @@
         X509AttrCertParser parser = new X509AttrCertParser();
         parser.engineInit(stream);
-        m_ac = (X509V2AttributeCertificate)parser.engineRead();
+        ac = (X509V2AttributeCertificate)parser.engineRead();
     }
 
@@ -60,23 +65,25 @@
 	    throws Exception {
 	read_certificate(stream);
-	if (m_ac == null) throw new IOException("Unknown Format");
+	if (ac == null) throw new IOException("Unknown Format");
 	init(ids);
     }
 
     protected void init(Collection<Identity> ids) 
-	    throws CertificateException, InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException,SignatureException {
-	for (Identity id: ids) {
+	    throws CertificateException, InvalidKeyException, 
+		NoSuchAlgorithmException, NoSuchProviderException,
+		SignatureException {
+	for (Identity i: ids) {
 	    try {
-		m_ac.verify(id.getCertificate().getPublicKey(), "BC");
-		m_id = id;
+		ac.verify(i.getCertificate().getPublicKey(), "BC");
+		id = i;
 		break;
 	    }
 	    catch (InvalidKeyException e) { }
 	}
-	if (m_id == null) throw new InvalidKeyException("Unknown identity");
+	if (id == null) throw new InvalidKeyException("Unknown identity");
 
         load_roles();
 
-	if (!m_id.getKeyID().equals(m_head.issuer_part()))
+	if (!id.getKeyID().equals(m_head.issuer_part()))
 	    throw new InvalidKeyException("Unknown identity");
     }
@@ -103,5 +110,5 @@
     public Credential(X509V2AttributeCertificate c, Collection<Identity> ids) 
 	throws Exception {
-	m_ac = c;
+	ac = c;
 	init(ids);
     }
@@ -114,5 +121,5 @@
     public void make_cert(Identity i) {
 	PrivateKey key = i.getKeyPair().getPrivate();
-	SubjectPublicKeyInfo pki = Identity.extractSubjectPublicKeyInfo(
+	SubjectPublicKeyInfo pki = Context.extractSubjectPublicKeyInfo(
 		i.getKeyPair().getPublic());
 	X509V2AttributeCertificateGenerator gen = 
@@ -138,5 +145,5 @@
 		    new AuthorityKeyIdentifier(pki));
 	    // Create the cert.
-	    m_ac = (X509V2AttributeCertificate) gen.generate(key, "BC");
+	    ac = (X509V2AttributeCertificate) gen.generate(key, "BC");
 	}
 	catch (Exception e) { 
@@ -152,5 +159,5 @@
         String roles = null;
         try {
-            X509Attribute attr = m_ac.getAttributes()[0];
+            X509Attribute attr = ac.getAttributes()[0];
 
             DERSequence    java     = (DERSequence)attr.getValues()[0];
@@ -161,5 +168,5 @@
         }
         catch (Exception e) {
-            throw new RuntimeException("Your attribute certificate is funky and I'm not gonna debug it", e);
+            throw new RuntimeException("Badly formatted certificate");
         }
 
@@ -199,21 +206,15 @@
      * Get the head role from the credential.
      */
-    public Role head() {
-        return m_head;
-    }
+    public Role head() { return m_head; }
 
     /**
      * Get the tail role from the credential
      */
-    public Role tail() {
-        return m_tail;
-    }
+    public Role tail() { return m_tail; }
 
     /**
      * Gets the cert associated with this credential (if any).
      */
-    public X509V2AttributeCertificate cert() {
-        return m_ac;
-    }
+    public X509V2AttributeCertificate cert() { return ac; }
 
     /**
@@ -230,5 +231,5 @@
 
     public void write(OutputStream s) throws IOException {
-	s.write(m_ac.getEncoded());
+	s.write(ac.getEncoded());
 	s.flush();
     }
@@ -238,12 +239,8 @@
     }
 
-    public boolean hasCertificate() { return m_ac != null; }
-
-    public Identity getID() { return m_id; }
-
-private Role m_head, m_tail;
-
-private X509V2AttributeCertificate m_ac;
-private Identity m_id;
+    public boolean hasCertificate() { return ac != null; }
+
+    public Identity getID() { return id; }
+
 
 }
