Index: creddy/attribute.c
===================================================================
--- creddy/attribute.c	(revision 3a3381224bdace46ef293444327474f643d08d67)
+++ creddy/attribute.c	(revision 04f5da17f2be6ba1952dc3780a1cc4ede5755112)
@@ -6,6 +6,7 @@
 #include <credentials/keys/private_key.h>
 
-#include "creddy.h"
-#include "libcreddy.h"
+#include <creddy.h>
+
+#include "creddy_common.h"
 
 void attribute_main(options_t *opts) {
Index: creddy/creddy.c
===================================================================
--- creddy/creddy.c	(revision 3a3381224bdace46ef293444327474f643d08d67)
+++ creddy/creddy.c	(revision 04f5da17f2be6ba1952dc3780a1cc4ede5755112)
@@ -5,5 +5,5 @@
 #include <string.h>
 
-#include "creddy.h"
+#include "creddy_common.h"
 
 #define OPT_CN              1
Index: creddy/creddy.h
===================================================================
--- creddy/creddy.h	(revision 3a3381224bdace46ef293444327474f643d08d67)
+++ creddy/creddy.h	(revision 04f5da17f2be6ba1952dc3780a1cc4ede5755112)
@@ -1,64 +1,86 @@
-#ifndef __CREDDY_H__
-#define __CREDDY_H__
+#ifndef __LIBCREDDY_H__
+#define __LIBCREDDY_H__
 
-#include <library.h>
-#include <credentials/certificates/certificate.h>
-#include <credentials/certificates/x509.h>
+#include <stdio.h>
 
-typedef struct _subject_t {
-    char *cert;
-    char *id;
-    char *role;
-} subject_t;
+#define CREDDY_SUCCESS                      0
+#define CREDDY_GENERATE_INVALID_CN          -1
+#define CREDDY_GENERATE_INVALID_VALIDITY    -2
+#define CREDDY_ATTRIBUTE_ISSUER_NOKEY       -3
+#define CREDDY_ATTRIBUTE_INVALID_ROLE       -4
+#define CREDDY_ATTRIBUTE_INVALID_VALIDITY   -5
 
-typedef struct _options_t {
-    int help;
-    int mode;
+/**
+ * Creddy identifiers.
+ */
 
-    char *cert;
+typedef struct _creddy_id_t creddy_id_t;
 
-    // generate options
-    char *cn;
-    int validity;
+// create an ID from an X.509 certificate
+creddy_id_t *creddy_id_from_file(char *filename);
 
-    // attribute options
-    char *issuer;
-    char *key;
-    char *role;
-    subject_t *subjects;
-    int num_subjects;
-    char *out;
+// load an X.509 private key for an from a file
+// handles keys with a password
+int creddy_id_load_privkey(creddy_id_t *id, char *filename);
 
-    // verify options
-    char *attrcert;
-} options_t;
+// generate an ID
+// returns one of CREDDY_SUCCESS or CREDDY_GENERATE_* (see top)
+int creddy_id_generate(creddy_id_t **ret, char *cn, int validity);
 
-#define MODE_GENERATE   1
-#define MODE_VERIFY     2
-#define MODE_KEYID      3
-#define MODE_ATTRIBUTE  4
-#define MODE_ROLES      5
-#define MODE_VERSION    6
+// get the SHA1 keyid, pointer is valid for the lifetime of the object
+char *creddy_id_keyid(creddy_id_t *id);
 
-// returns true if a name starts with a letter and is otherwise alphanumeric
-int clean_name(char *string);
+// default filename for the cert: ${CN}_ID.pem
+// caller must free the returned string
+char *creddy_id_cert_filename(creddy_id_t *id);
 
-// load an attr cert from file (aborts on fail)
-certificate_t *cert_from_file(char *filename);
+// write the cert fo an open file pointer
+void creddy_id_write_cert(creddy_id_t *id, FILE *out);
 
-// generate a random serial
-chunk_t creddy_generate_serial();
+// default filename for the private key: ${CN}_key.pem
+// caller must free the return value
+char *creddy_id_privkey_filename(creddy_id_t *id);
 
-void usage(options_t *opts);
-void *xmalloc(size_t len);
-void *xrealloc(void *ptr, size_t size);
-char *xstrdup(char *string);
+// write the private key to a file
+// it is recommended that you open this file mode 0600
+void creddy_id_write_privkey(creddy_id_t *id, FILE *out);
 
-// sub programs
-void generate_main(options_t *opts);
-void keyid_main(options_t *opts);
-void attribute_main(options_t *opts);
-void roles_main(options_t *opts);
-void verify_main(options_t *opts);
+// destroy the id
+void creddy_id_free(creddy_id_t *id);
 
-#endif /* __CREDDY_H__ */
+/**
+ * Attribute cert
+ */
+typedef struct _creddy_attribute_t creddy_attribute_t;
+
+//
+// Here's the skinny:
+//  Attribute cert objects don't contain an actual cert until they're baked.
+//  First you construct the object using creddy_attribute_create, then you add
+//  subjects to it using creddy_attribute_{principal,role,linking_role}.
+//  Finally you bake it. Once you've done that, you can access the DER encoding
+//  or write it to a file.
+//
+
+// create an attribute cert
+// validity is in days
+// returns one of CREDDY_SUCCESS or CREDDY_ATTRIBUTE_* (see top)
+int creddy_attribute_create(creddy_attribute_t **attr, creddy_id_t *issuer, char *role, int validity);
+
+// add a principal subject to the cert
+int creddy_attribute_principal(creddy_attribute_t *attr, char *keyid);
+
+// add a role subject
+int creddy_attribute_role(creddy_attribute_t *attr, char *keyid, char *role);
+
+// add a linking role subject
+int creddy_attribute_linking_role(creddy_attribute_t *attr, char *keyid, char *role, char *linked);
+
+// create the attribute cert once all the subjects have been added
+// can return 0 if there are no subjects or there's a problem building the cert
+int creddy_attribute_bake(creddy_attribute_t *attr);
+
+// destroy the cert
+void creddy_attribute_free(creddy_attribute_t *attr);
+
+#endif /* __LIBCREDDY_H__ */
Index: creddy/creddy_common.h
===================================================================
--- creddy/creddy_common.h	(revision 04f5da17f2be6ba1952dc3780a1cc4ede5755112)
+++ creddy/creddy_common.h	(revision 04f5da17f2be6ba1952dc3780a1cc4ede5755112)
@@ -0,0 +1,64 @@
+#ifndef __CREDDY_H__
+#define __CREDDY_H__
+
+#include <library.h>
+#include <credentials/certificates/certificate.h>
+#include <credentials/certificates/x509.h>
+
+typedef struct _subject_t {
+    char *cert;
+    char *id;
+    char *role;
+} subject_t;
+
+typedef struct _options_t {
+    int help;
+    int mode;
+
+    char *cert;
+
+    // generate options
+    char *cn;
+    int validity;
+
+    // attribute options
+    char *issuer;
+    char *key;
+    char *role;
+    subject_t *subjects;
+    int num_subjects;
+    char *out;
+
+    // verify options
+    char *attrcert;
+} options_t;
+
+#define MODE_GENERATE   1
+#define MODE_VERIFY     2
+#define MODE_KEYID      3
+#define MODE_ATTRIBUTE  4
+#define MODE_ROLES      5
+#define MODE_VERSION    6
+
+// returns true if a name starts with a letter and is otherwise alphanumeric
+int clean_name(char *string);
+
+// load an attr cert from file (aborts on fail)
+certificate_t *cert_from_file(char *filename);
+
+// generate a random serial
+chunk_t creddy_generate_serial();
+
+void usage(options_t *opts);
+void *xmalloc(size_t len);
+void *xrealloc(void *ptr, size_t size);
+char *xstrdup(char *string);
+
+// sub programs
+void generate_main(options_t *opts);
+void keyid_main(options_t *opts);
+void attribute_main(options_t *opts);
+void roles_main(options_t *opts);
+void verify_main(options_t *opts);
+
+#endif /* __CREDDY_H__ */
Index: creddy/generate.c
===================================================================
--- creddy/generate.c	(revision 3a3381224bdace46ef293444327474f643d08d67)
+++ creddy/generate.c	(revision 04f5da17f2be6ba1952dc3780a1cc4ede5755112)
@@ -3,6 +3,7 @@
 #include <credentials/keys/private_key.h>
 
-#include "creddy.h"
-#include "libcreddy.h"
+#include <creddy.h>
+
+#include "creddy_common.h"
 
 void generate_main(options_t *opts) {
Index: creddy/keyid.c
===================================================================
--- creddy/keyid.c	(revision 3a3381224bdace46ef293444327474f643d08d67)
+++ creddy/keyid.c	(revision 04f5da17f2be6ba1952dc3780a1cc4ede5755112)
@@ -1,4 +1,5 @@
-#include "creddy.h"
-#include "libcreddy.h"
+#include <creddy.h>
+
+#include "creddy_common.h"
 
 void keyid_main(options_t *opts) {
Index: creddy/libcreddy.h
===================================================================
--- creddy/libcreddy.h	(revision 3a3381224bdace46ef293444327474f643d08d67)
+++ 	(revision )
@@ -1,86 +1,0 @@
-#ifndef __LIBCREDDY_H__
-#define __LIBCREDDY_H__
-
-#include <stdio.h>
-
-#define CREDDY_SUCCESS                      0
-#define CREDDY_GENERATE_INVALID_CN          -1
-#define CREDDY_GENERATE_INVALID_VALIDITY    -2
-#define CREDDY_ATTRIBUTE_ISSUER_NOKEY       -3
-#define CREDDY_ATTRIBUTE_INVALID_ROLE       -4
-#define CREDDY_ATTRIBUTE_INVALID_VALIDITY   -5
-
-/**
- * Creddy identifiers.
- */
-
-typedef struct _creddy_id_t creddy_id_t;
-
-// create an ID from an X.509 certificate
-creddy_id_t *creddy_id_from_file(char *filename);
-
-// load an X.509 private key for an from a file
-// handles keys with a password
-int creddy_id_load_privkey(creddy_id_t *id, char *filename);
-
-// generate an ID
-// returns one of CREDDY_SUCCESS or CREDDY_GENERATE_* (see top)
-int creddy_id_generate(creddy_id_t **ret, char *cn, int validity);
-
-// get the SHA1 keyid, pointer is valid for the lifetime of the object
-char *creddy_id_keyid(creddy_id_t *id);
-
-// default filename for the cert: ${CN}_ID.pem
-// caller must free the returned string
-char *creddy_id_cert_filename(creddy_id_t *id);
-
-// write the cert fo an open file pointer
-void creddy_id_write_cert(creddy_id_t *id, FILE *out);
-
-// default filename for the private key: ${CN}_key.pem
-// caller must free the return value
-char *creddy_id_privkey_filename(creddy_id_t *id);
-
-// write the private key to a file
-// it is recommended that you open this file mode 0600
-void creddy_id_write_privkey(creddy_id_t *id, FILE *out);
-
-// destroy the id
-void creddy_id_free(creddy_id_t *id);
-
-/**
- * Attribute cert
- */
-typedef struct _creddy_attribute_t creddy_attribute_t;
-
-//
-// Here's the skinny:
-//  Attribute cert objects don't contain an actual cert until they're baked.
-//  First you construct the object using creddy_attribute_create, then you add
-//  subjects to it using creddy_attribute_{principal,role,linking_role}.
-//  Finally you bake it. Once you've done that, you can access the DER encoding
-//  or write it to a file.
-//
-
-// create an attribute cert
-// validity is in days
-// returns one of CREDDY_SUCCESS or CREDDY_ATTRIBUTE_* (see top)
-int creddy_attribute_create(creddy_attribute_t **attr, creddy_id_t *issuer, char *role, int validity);
-
-// add a principal subject to the cert
-int creddy_attribute_principal(creddy_attribute_t *attr, char *keyid);
-
-// add a role subject
-int creddy_attribute_role(creddy_attribute_t *attr, char *keyid, char *role);
-
-// add a linking role subject
-int creddy_attribute_linking_role(creddy_attribute_t *attr, char *keyid, char *role, char *linked);
-
-// create the attribute cert once all the subjects have been added
-// can return 0 if there are no subjects or there's a problem building the cert
-int creddy_attribute_bake(creddy_attribute_t *attr);
-
-// destroy the cert
-void creddy_attribute_free(creddy_attribute_t *attr);
-
-#endif /* __LIBCREDDY_H__ */
Index: creddy/libcreddy_common.h
===================================================================
--- creddy/libcreddy_common.h	(revision 3a3381224bdace46ef293444327474f643d08d67)
+++ creddy/libcreddy_common.h	(revision 04f5da17f2be6ba1952dc3780a1cc4ede5755112)
@@ -6,5 +6,5 @@
 #include <credentials/keys/private_key.h>
 
-#include "libcreddy.h"
+#include <creddy.h>
 
 void *creddy_xmalloc(size_t len);
Index: creddy/roles.c
===================================================================
--- creddy/roles.c	(revision 3a3381224bdace46ef293444327474f643d08d67)
+++ creddy/roles.c	(revision 04f5da17f2be6ba1952dc3780a1cc4ede5755112)
@@ -1,3 +1,3 @@
-#include "creddy.h"
+#include "creddy_common.h"
 
 #include <credentials/certificates/ac.h>
Index: creddy/verify.c
===================================================================
--- creddy/verify.c	(revision 3a3381224bdace46ef293444327474f643d08d67)
+++ creddy/verify.c	(revision 04f5da17f2be6ba1952dc3780a1cc4ede5755112)
@@ -1,4 +1,9 @@
-#include "creddy.h"
-#include "libcreddy.h"
+#include <creddy.h>
+
+#include "creddy_common.h"
+
+// ugh, this needs to go away
+// do so by replacing this with a call into libabac
+#include "libcreddy_common.h"
 
 void verify_main(options_t *opts) {
@@ -11,5 +16,5 @@
     if (issuer == NULL)
         errx(1, "Can't load issuer cert from %s", opts->cert);
-    certificate_t *cert = creddy_id_cert(issuer);
+    certificate_t *cert = creddy_id_cert(issuer); // replace this with a call into libabac
 
     if (opts->attrcert != NULL)
