diff --git a/ndn-cpp/ContentObject.cpp b/ndn-cpp/ContentObject.cpp
new file mode 100644
index 0000000..e675e5a
--- /dev/null
+++ b/ndn-cpp/ContentObject.cpp
@@ -0,0 +1,88 @@
+/**
+ * @author: Jeff Thompson
+ * See COPYING for copyright and distribution information.
+ */
+
+#include "common.hpp"
+#include "ContentObject.hpp"
+
+using namespace std;
+
+namespace ndn {
+
+void Signature::get(struct ndn_Signature &signatureStruct) const 
+{
+  signatureStruct.digestAlgorithmLength = digestAlgorithm_.size();
+  if (digestAlgorithm_.size() > 0)
+    signatureStruct.digestAlgorithm = (unsigned char *)&digestAlgorithm_[0];
+  else
+    signatureStruct.digestAlgorithm = 0;
+
+  signatureStruct.witnessLength = witness_.size();
+  if (witness_.size() > 0)
+    signatureStruct.witness = (unsigned char *)&witness_[0];
+  else
+    signatureStruct.witness = 0;
+
+  signatureStruct.signatureLength = signature_.size();
+  if (signature_.size() > 0)
+    signatureStruct.signature = (unsigned char *)&signature_[0];
+  else
+    signatureStruct.signature = 0;
+}
+
+void Signature::set(const struct ndn_Signature &signatureStruct)
+{
+  setVector(digestAlgorithm_, signatureStruct.digestAlgorithm, signatureStruct.digestAlgorithmLength);
+  setVector(witness_, signatureStruct.witness, signatureStruct.witnessLength);
+  setVector(signature_, signatureStruct.signature, signatureStruct.signatureLength);
+}
+
+void SignedInfo::get(struct ndn_SignedInfo &signedInfoStruct) const 
+{
+  publisherPublicKeyDigest_.get(signedInfoStruct.publisherPublicKeyDigest);
+  // TODO: Implement timestamp
+  signedInfoStruct.type = type_;
+  signedInfoStruct.freshnessSeconds = freshnessSeconds_;
+  
+  signedInfoStruct.finalBlockIDLength = finalBlockID_.size();
+  if (finalBlockID_.size() > 0)
+    signedInfoStruct.finalBlockID = (unsigned char *)&finalBlockID_[0];
+  else
+    signedInfoStruct.finalBlockID = 0;
+
+  keyLocator_.get(signedInfoStruct.keyLocator);
+}
+
+void SignedInfo::set(const struct ndn_SignedInfo &signedInfoStruct)
+{
+  publisherPublicKeyDigest_.set(signedInfoStruct.publisherPublicKeyDigest);
+  // TODO: Implement timestamp
+  type_ = signedInfoStruct.type;
+  freshnessSeconds_ = signedInfoStruct.freshnessSeconds;
+  setVector(finalBlockID_, signedInfoStruct.finalBlockID, signedInfoStruct.finalBlockIDLength);
+  keyLocator_.set(signedInfoStruct.keyLocator);
+}
+
+void ContentObject::get(struct ndn_ContentObject &contentObjectStruct) const 
+{
+  signature_.get(contentObjectStruct.signature);
+  name_.get(contentObjectStruct.name);
+  signedInfo_.get(contentObjectStruct.signedInfo);
+  
+  contentObjectStruct.contentLength = content_.size();
+  if (content_.size() > 0)
+    contentObjectStruct.content = (unsigned char *)&content_[0];
+  else
+    contentObjectStruct.content = 0;
+}
+
+void ContentObject::set(const struct ndn_ContentObject &contentObjectStruct)
+{
+  signature_.set(contentObjectStruct.signature);
+  name_.set(contentObjectStruct.name);
+  signedInfo_.set(contentObjectStruct.signedInfo);
+  setVector(content_, contentObjectStruct.content, contentObjectStruct.contentLength);
+}
+
+}
diff --git a/ndn-cpp/ContentObject.hpp b/ndn-cpp/ContentObject.hpp
new file mode 100644
index 0000000..9cf1c3d
--- /dev/null
+++ b/ndn-cpp/ContentObject.hpp
@@ -0,0 +1,142 @@
+/**
+ * @author: Jeff Thompson
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_CONTENTOBJECT_HPP
+#define	NDN_CONTENTOBJECT_HPP
+
+#include "Name.hpp"
+#include "PublisherPublicKeyDigest.hpp"
+#include "Key.hpp"
+#include "c/ContentObject.h"
+
+namespace ndn {
+
+class Signature {
+public:
+  /**
+   * Set the signatureStruct to point to the values in this signature object, without copying any memory.
+   * WARNING: The resulting pointers in signatureStruct are invalid after a further use of this object which could reallocate memory.
+   * @param signatureStruct a C ndn_Signature struct where the name components array is already allocated.
+   */
+  void get(struct ndn_Signature &signatureStruct) const;
+
+  /**
+   * Clear this signature, and set the values by copying from the ndn_Signature struct.
+   * @param signatureStruct a C ndn_Signature struct
+   */
+  void set(const struct ndn_Signature &signatureStruct);
+
+  const std::vector<unsigned char> getDigestAlgorithm() const { return digestAlgorithm_; }
+
+  const std::vector<unsigned char> getWitness() const { return witness_; }
+
+  const std::vector<unsigned char> getSignature() const { return signature_; }
+  
+private:
+  std::vector<unsigned char> digestAlgorithm_; /**< if empty, the default is 2.16.840.1.101.3.4.2.1 (sha-256) */
+  std::vector<unsigned char> witness_;
+  std::vector<unsigned char> signature_;
+};
+
+class SignedInfo {
+public:
+  SignedInfo() 
+  {   
+    type_ = ndn_ContentType_DATA;
+    freshnessSeconds_ = -1;
+  }
+
+  /**
+   * Set the signedInfoStruct to point to the values in this signed info object, without copying any memory.
+   * WARNING: The resulting pointers in signedInfoStruct are invalid after a further use of this object which could reallocate memory.
+   * @param signedInfoStruct a C ndn_SignedInfo struct where the name components array is already allocated.
+   */
+  void get(struct ndn_SignedInfo &signedInfoStruct) const;
+
+  /**
+   * Clear this signed info, and set the values by copying from the ndn_SignedInfo struct.
+   * @param signedInfoStruct a C ndn_SignedInfo struct
+   */
+  void set(const struct ndn_SignedInfo &signedInfoStruct);
+
+  const PublisherPublicKeyDigest &getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
+  
+  // TODO: Implement timestamp
+  
+  int getType() const { return type_; }
+  
+  int getFreshnessSeconds() const { return freshnessSeconds_; }
+  
+  const std::vector<unsigned char> getFinalBlockID() const { return finalBlockID_; }
+  
+  const KeyLocator &getKeyLocator() const { return keyLocator_; }
+  
+private:
+  PublisherPublicKeyDigest publisherPublicKeyDigest_;
+  // TODO: Implement timestamp
+  int type_;
+  int freshnessSeconds_;
+  std::vector<unsigned char> finalBlockID_;
+  KeyLocator keyLocator_;
+};
+  
+class ContentObject {
+public:
+  void encode(std::vector<unsigned char> &output, WireFormat &wireFormat) const 
+  {
+    wireFormat.encodeContentObject(*this, output);
+  }
+  void encode(std::vector<unsigned char> &output) const 
+  {
+    encode(output, BinaryXMLWireFormat::instance());
+  }
+  void decode(const unsigned char *input, unsigned int inputLength, WireFormat &wireFormat) 
+  {
+    wireFormat.decodeContentObject(*this, input, inputLength);
+  }
+  void decode(const unsigned char *input, unsigned int inputLength) 
+  {
+    decode(input, inputLength, BinaryXMLWireFormat::instance());
+  }
+  void decode(const std::vector<unsigned char> &input, WireFormat &wireFormat) 
+  {
+    decode(&input[0], input.size(), wireFormat);
+  }
+  void decode(const std::vector<unsigned char> &input) 
+  {
+    decode(&input[0], input.size());
+  }
+  
+  /**
+   * Set the contentObjectStruct to point to the values in this interest, without copying any memory.
+   * WARNING: The resulting pointers in contentObjectStruct are invalid after a further use of this object which could reallocate memory.
+   * @param contentObjectStruct a C ndn_ContentObject struct where the name components array is already allocated.
+   */
+  void get(struct ndn_ContentObject &contentObjectStruct) const;
+
+  /**
+   * Clear this content object, and set the values by copying from the ndn_ContentObject struct.
+   * @param contentObjectStruct a C ndn_ContentObject struct
+   */
+  void set(const struct ndn_ContentObject &contentObjectStruct);
+
+  const Signature &getSignature() const { return signature_; }
+  
+  const Name &getName() const { return name_; }
+  
+  const SignedInfo &getSignedInfo() const { return signedInfo_; }
+  
+  const std::vector<unsigned char> getContent() const { return content_; }
+  
+private:
+  Signature signature_;
+  Name name_;
+  SignedInfo signedInfo_;
+  std::vector<unsigned char> content_;
+};
+  
+}
+
+#endif
diff --git a/ndn-cpp/Key.cpp b/ndn-cpp/Key.cpp
new file mode 100644
index 0000000..45425f2
--- /dev/null
+++ b/ndn-cpp/Key.cpp
@@ -0,0 +1,34 @@
+/**
+ * @author: Jeff Thompson
+ * See COPYING for copyright and distribution information.
+ */
+
+#include "common.hpp"
+#include "Key.hpp"
+
+using namespace std;
+
+namespace ndn {
+
+void KeyLocator::get(struct ndn_KeyLocator &keyLocatorStruct) const 
+{
+  keyLocatorStruct.type = type_;
+  
+  keyLocatorStruct.keyOrCertificateLength = keyOrCertificate_.size();
+  if (keyOrCertificate_.size() > 0)
+    keyLocatorStruct.keyOrCertificate = (unsigned char *)&keyOrCertificate_[0];
+  else
+    keyLocatorStruct.keyOrCertificate = 0;
+
+  // TODO: Implement keyName.
+}
+
+void KeyLocator::set(const struct ndn_KeyLocator &keyLocatorStruct)
+{
+  type_ = keyLocatorStruct.type;
+  setVector(keyOrCertificate_, keyLocatorStruct.keyOrCertificate, keyLocatorStruct.keyOrCertificateLength);
+  // TODO: Implement keyName.
+}
+
+}
+
diff --git a/ndn-cpp/Key.hpp b/ndn-cpp/Key.hpp
new file mode 100644
index 0000000..aa2f01b
--- /dev/null
+++ b/ndn-cpp/Key.hpp
@@ -0,0 +1,48 @@
+/**
+ * @author: Jeff Thompson
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_KEY_HPP
+#define	NDN_KEY_HPP
+
+#include <vector>
+#include "c/Key.h"
+
+namespace ndn {
+  
+class KeyLocator {
+public:
+  KeyLocator()
+  {
+    type_ = (ndn_KeyLocatorType)-1;
+  }
+  
+  /**
+   * Set the keyLocatorStruct to point to the values in this key locator, without copying any memory.
+   * WARNING: The resulting pointers in keyLocatorStruct are invalid after a further use of this object which could reallocate memory.
+   * @param keyLocatorStruct a C ndn_KeyLocator struct where the name components array is already allocated.
+   */
+  void get(struct ndn_KeyLocator &keyLocatorStruct) const;
+  
+  /**
+   * Clear this key locator, and set the values by copying from the ndn_KeyLocator struct.
+   * @param keyLocatorStruct a C ndn_KeyLocator struct
+   */
+  void set(const struct ndn_KeyLocator &keyLocatorStruct);
+
+  ndn_KeyLocatorType getType() const { return type_; }
+  
+  const std::vector<unsigned char> getKeyOrCertificate() const { return keyOrCertificate_; }
+
+  // TODO: Implement keyName.
+
+private:
+  ndn_KeyLocatorType type_;
+  std::vector<unsigned char> keyOrCertificate_; /**< used if type_ is ndn_KeyLocatorType_KEY or ndn_KeyLocatorType_CERTIFICATE */
+  // TODO: Implement keyName.
+};
+  
+}
+
+#endif
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
diff --git a/ndn-cpp/encoding/BinaryXMLWireFormat.cpp b/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
index f3af9c8..83261de 100644
--- a/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
+++ b/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
@@ -6,7 +6,9 @@
 #include <stdexcept>
 #include "../c/encoding/BinaryXMLName.h"
 #include "../c/encoding/BinaryXMLInterest.h"
+#include "../c/encoding/BinaryXMLContentObject.h"
 #include "../Interest.hpp"
+#include "../ContentObject.hpp"
 #include "BinaryXMLEncoder.hpp"
 #include "../c/encoding/BinaryXMLDecoder.h"
 #include "BinaryXMLWireFormat.hpp"
@@ -81,4 +83,35 @@
   interest.set(interestStruct);
 }
 
+void BinaryXMLWireFormat::encodeContentObject(const ContentObject &contentObject, vector<unsigned char> &output) 
+{
+  struct ndn_NameComponent nameComponents[100];
+  struct ndn_ContentObject contentObjectStruct;
+  ndn_ContentObject_init
+    (&contentObjectStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]));
+  contentObject.get(contentObjectStruct);
+
+  BinaryXMLEncoder encoder;
+  ndn_encodeBinaryXMLContentObject(&contentObjectStruct, encoder.getEncoder());
+     
+  encoder.appendTo(output);
+}
+
+void BinaryXMLWireFormat::decodeContentObject(ContentObject &contentObject, const unsigned char *input, unsigned int inputLength)
+{
+  struct ndn_NameComponent nameComponents[100];
+  struct ndn_ContentObject contentObjectStruct;
+  ndn_ContentObject_init
+    (&contentObjectStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]));
+    
+  struct ndn_BinaryXMLDecoder decoder;
+  ndn_BinaryXMLDecoder_init(&decoder, (unsigned char *)input, inputLength);
+  
+  ndn_Error error;
+  if (error = ndn_decodeBinaryXMLContentObject(&contentObjectStruct, &decoder))
+    throw std::runtime_error(ndn_getErrorString(error));
+
+  contentObject.set(contentObjectStruct);
+}
+
 }
diff --git a/ndn-cpp/encoding/BinaryXMLWireFormat.hpp b/ndn-cpp/encoding/BinaryXMLWireFormat.hpp
index ad3a88c..a1a5e6a 100644
--- a/ndn-cpp/encoding/BinaryXMLWireFormat.hpp
+++ b/ndn-cpp/encoding/BinaryXMLWireFormat.hpp
@@ -17,6 +17,9 @@
 
   virtual void encodeInterest(const Interest &interest, std::vector<unsigned char> &output);
   virtual void decodeInterest(Interest &interest, const unsigned char *input, unsigned int inputLength);
+
+  virtual void encodeContentObject(const ContentObject &contentObject, std::vector<unsigned char> &output);
+  virtual void decodeContentObject(ContentObject &contentObject, const unsigned char *input, unsigned int inputLength);
   
   static BinaryXMLWireFormat &instance() { return instance_; }
   
diff --git a/ndn-cpp/encoding/WireFormat.cpp b/ndn-cpp/encoding/WireFormat.cpp
index 3217fe1..7e784a3 100644
--- a/ndn-cpp/encoding/WireFormat.cpp
+++ b/ndn-cpp/encoding/WireFormat.cpp
@@ -28,4 +28,13 @@
   throw logic_error("unimplemented");
 }
 
+void WireFormat::encodeContentObject(const ContentObject &contentObject, vector<unsigned char> &output) 
+{
+  throw logic_error("unimplemented");
+}
+void WireFormat::decodeContentObject(ContentObject &contentObject, const unsigned char *input, unsigned int inputLength) 
+{
+  throw logic_error("unimplemented");
+}
+
 }
diff --git a/ndn-cpp/encoding/WireFormat.hpp b/ndn-cpp/encoding/WireFormat.hpp
index f09ae22..8458f94 100644
--- a/ndn-cpp/encoding/WireFormat.hpp
+++ b/ndn-cpp/encoding/WireFormat.hpp
@@ -12,6 +12,7 @@
   
 class Name;
 class Interest;
+class ContentObject;
   
 class WireFormat {
 public:
@@ -21,7 +22,8 @@
   virtual void encodeInterest(const Interest &interest, std::vector<unsigned char> &output);
   virtual void decodeInterest(Interest &interest, const unsigned char *input, unsigned int inputLength);
 
-  // etc. for each type of object.
+  virtual void encodeContentObject(const ContentObject &contentObject, std::vector<unsigned char> &output);
+  virtual void decodeContentObject(ContentObject &contentObject, const unsigned char *input, unsigned int inputLength);
 };
 
 }
