diff --git a/ndn-cpp/c/ContentObject.h b/ndn-cpp/c/ContentObject.h
new file mode 100644
index 0000000..4d46e53
--- /dev/null
+++ b/ndn-cpp/c/ContentObject.h
@@ -0,0 +1,96 @@
+/**
+ * @author: Jeff Thompson
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_CONTENTOBJECT_H
+#define	NDN_CONTENTOBJECT_H
+
+#include "Name.h"
+#include "PublisherPublicKeyDigest.h"
+#include "Key.h"
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+struct ndn_Signature {
+  unsigned char *digestAlgorithm;      /**< pointer to pre-allocated buffer.  0 for none.
+                                        *   If none, default is 2.16.840.1.101.3.4.2.1 (sha-256). */
+  unsigned int digestAlgorithmLength; /**< length of digestAlgorithm.  0 for none */
+  unsigned char *witness;              /**< pointer to pre-allocated buffer.  0 for none. */
+  unsigned int witnessLength;          /**< length of witness.  0 for none */
+  unsigned char *signature;
+  unsigned int signatureLength;
+};
+
+static inline void ndn_Signature_init(struct ndn_Signature *self) {
+  self->digestAlgorithm = 0;
+  self->digestAlgorithmLength = 0;
+  self->witness = 0;
+  self->witnessLength = 0;
+  self->signature = 0;
+  self->signatureLength = 0;
+}
+
+enum {
+  ndn_ContentType_DATA = 0,
+  ndn_ContentType_ENCR = 1,
+  ndn_ContentType_GONE = 2,
+  ndn_ContentType_KEY =  3,
+  ndn_ContentType_LINK = 4,
+  ndn_ContentType_NACK = 5
+};
+
+struct ndn_SignedInfo {
+  struct ndn_PublisherPublicKeyDigest publisherPublicKeyDigest;
+  // TODO: Implement timestamp
+  int type;              /**< default is ndn_ContentType_DATA. -1 for none */
+  int freshnessSeconds;  /**< -1 for none */
+	unsigned char *finalBlockID;	    /**< pointer to pre-allocated buffer.  0 for none */
+  unsigned int finalBlockIDLength;  /**< length of finalBlockID.  0 for none */
+  struct ndn_KeyLocator keyLocator;
+};
+
+/**
+ * Initialize the ndn_SignedInfo struct with values for none and the type to the default ndn_ContentType_DATA.
+ * @param self pointer to the ndn_SignedInfo struct.
+ */
+static inline void ndn_SignedInfo_init(struct ndn_SignedInfo *self) {
+  ndn_PublisherPublicKeyDigest_init(&self->publisherPublicKeyDigest);
+  self->type = ndn_ContentType_DATA;
+  self->freshnessSeconds = -1;
+  self->finalBlockID = 0;
+  self->finalBlockIDLength = 0;
+  ndn_KeyLocator_init(&self->keyLocator);
+}
+
+struct ndn_ContentObject {
+  struct ndn_Signature signature;
+  struct ndn_Name name;
+  struct ndn_SignedInfo signedInfo;
+  unsigned char *content;     /**< pointer to the content */
+  unsigned int contentLength; /**< length of content */
+};
+
+/**
+ * Initialize an ndn_ContentObject struct with the pre-allocated nameComponents,
+ * and defaults for all the values.
+ * @param self pointer to the ndn_ContentObject struct
+ * @param nameComponents the pre-allocated array of ndn_NameComponent
+ * @param maxNameComponents the number of elements in the allocated nameComponents array
+ */
+static inline void ndn_ContentObject_init(struct ndn_ContentObject *self, struct ndn_NameComponent *nameComponents, unsigned int maxNameComponents) 
+{
+  ndn_Signature_init(&self->signature);
+  ndn_Name_init(&self->name, nameComponents, maxNameComponents);
+  ndn_SignedInfo_init(&self->signedInfo);
+  self->content = 0;
+  self->contentLength = 0;
+}
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif
diff --git a/ndn-cpp/c/Key.h b/ndn-cpp/c/Key.h
new file mode 100644
index 0000000..1545a74
--- /dev/null
+++ b/ndn-cpp/c/Key.h
@@ -0,0 +1,38 @@
+/**
+ * @author: Jeff Thompson
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_KEY_H
+#define	NDN_KEY_H
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+  ndn_KeyLocatorType_KEY = 1,
+  ndn_KeyLocatorType_CERTIFICATE = 2,
+  ndn_KeyLocatorType_KEYNAME = 3
+} ndn_KeyLocatorType;
+  
+struct ndn_KeyLocator {
+  ndn_KeyLocatorType type;
+  unsigned char *keyOrCertificate; /**< if type is ndn_KeyLocatorType_KEY, pointer to the pre-allocated buffer for the key value.
+                                        if type is ndn_KeyLocatorType_CERTIFICATE, pointer to the pre-allocated buffer for the cetrificate value. */
+  unsigned int keyOrCertificateLength;
+  // TODO: Implement keyName.
+};
+
+static inline void ndn_KeyLocator_init(struct ndn_KeyLocator *self) {
+  self->type = (ndn_KeyLocatorType)-1;
+  self->keyOrCertificate = 0;
+  self->keyOrCertificateLength = 0;
+  // TODO: Implement keyName.
+}
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif
diff --git a/ndn-cpp/c/encoding/BinaryXMLContentObject.h b/ndn-cpp/c/encoding/BinaryXMLContentObject.h
new file mode 100644
index 0000000..b6444bb
--- /dev/null
+++ b/ndn-cpp/c/encoding/BinaryXMLContentObject.h
@@ -0,0 +1,26 @@
+/**
+ * @author: Jeff Thompson
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_BINARYXMLCONTENTOBJECT_H
+#define	NDN_BINARYXMLCONTENTOBJECT_H
+
+#include "../errors.h"
+#include "../ContentObject.h"
+#include "BinaryXMLEncoder.h"
+#include "BinaryXMLDecoder.h"
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+ndn_Error ndn_encodeBinaryXMLContentObject(struct ndn_ContentObject *contentObject, struct ndn_BinaryXMLEncoder *encoder);
+
+ndn_Error ndn_decodeBinaryXMLContentObject(struct ndn_ContentObject *contentObject, struct ndn_BinaryXMLDecoder *decoder);
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif
