diff --git a/ccnx/ccnx-wrapper.cpp b/ccnx/ccnx-wrapper.cpp
index 54ca745..7a83fe1 100644
--- a/ccnx/ccnx-wrapper.cpp
+++ b/ccnx/ccnx-wrapper.cpp
@@ -261,7 +261,7 @@
 }
 
 Bytes
-CcnxWrapper::createContentObject(const Name  &name, const void *buf, size_t len, int freshness)
+CcnxWrapper::createContentObject(const Name  &name, const void *buf, size_t len, int freshness, const Name &keyName)
 {
   {
     UniqueRecLock lock(m_mutex);
@@ -279,6 +279,28 @@
   struct ccn_signing_params sp = CCN_SIGNING_PARAMS_INIT;
   sp.freshness = freshness;
 
+  if (keyName.size() > 0)
+  {
+    if (sp.template_ccnb == NULL)
+    {
+      sp.template_ccnb = ccn_charbuf_create();
+      ccn_charbuf_append_tt(sp.template_ccnb, CCN_DTAG_SignedInfo, CCN_DTAG);
+    }
+    // no idea what the following 3 lines do, but it was there
+    else if (sp.template_ccnb->length > 0) {
+        sp.template_ccnb->length--;
+    }
+    ccn_charbuf_append_tt(sp.template_ccnb, CCN_DTAG_KeyLocator, CCN_DTAG);
+    ccn_charbuf_append_tt(sp.template_ccnb, CCN_DTAG_KeyName, CCN_DTAG);
+    CcnxCharbufPtr keyPtr = keyName.toCcnxCharbuf();
+    ccn_charbuf *keyBuf = keyPtr->getBuf();
+    ccn_charbuf_append(sp.template_ccnb, keyBuf->buf, keyBuf->length);
+    ccn_charbuf_append_closer(sp.template_ccnb); // </KeyName>
+    ccn_charbuf_append_closer(sp.template_ccnb); // </KeyLocator>
+    sp.sp_flags |= CCN_SP_TEMPL_KEY_LOCATOR;
+    ccn_charbuf_append_closer(sp.template_ccnb); // </SignedInfo>
+  }
+
   if (ccn_sign_content(m_handle, content, pname, &sp, buf, len) != 0)
   {
     BOOST_THROW_EXCEPTION(CcnxOperationException() << errmsg_info_str("sign content failed"));
@@ -288,6 +310,10 @@
   readRaw(bytes, content->buf, content->length);
 
   ccn_charbuf_destroy (&content);
+  if (sp.template_ccnb != NULL)
+  {
+    ccn_charbuf_destroy (&sp.template_ccnb);
+  }
 
   return bytes;
 }
@@ -318,9 +344,9 @@
 }
 
 int
-CcnxWrapper::publishData (const Name &name, const unsigned char *buf, size_t len, int freshness)
+CcnxWrapper::publishData (const Name &name, const unsigned char *buf, size_t len, int freshness, const Name &keyName)
 {
-  Bytes co = createContentObject(name, buf, len, freshness);
+  Bytes co = createContentObject(name, buf, len, freshness, keyName);
   return putToCcnd(co);
 }
 
diff --git a/ccnx/ccnx-wrapper.h b/ccnx/ccnx-wrapper.h
index 3fd3c23..69bebbd 100644
--- a/ccnx/ccnx-wrapper.h
+++ b/ccnx/ccnx-wrapper.h
@@ -66,13 +66,13 @@
   sendInterest (const Name &interest, const Closure &closure, const Selectors &selector = Selectors());
 
   int
-  publishData (const Name &name, const unsigned char *buf, size_t len, int freshness = DEFAULT_FRESHNESS/* max value for ccnx*/);
+  publishData (const Name &name, const unsigned char *buf, size_t len, int freshness = DEFAULT_FRESHNESS, const Name &keyName=Name());
 
   inline int
-  publishData (const Name &name, const Bytes &content, int freshness = DEFAULT_FRESHNESS/* max value for ccnx*/);
+  publishData (const Name &name, const Bytes &content, int freshness = DEFAULT_FRESHNESS, const Name &keyName=Name());
 
   inline int
-  publishData (const Name &name, const std::string &content, int freshness = DEFAULT_FRESHNESS/* max value for ccnx*/);
+  publishData (const Name &name, const std::string &content, int freshness = DEFAULT_FRESHNESS, const Name &keyName=Name());
 
   int
   publishUnsignedData(const Name &name, const unsigned char *buf, size_t len, int freshness = DEFAULT_FRESHNESS);
@@ -87,7 +87,7 @@
   getLocalPrefix ();
 
   Bytes
-  createContentObject(const Name &name, const void *buf, size_t len, int freshness = DEFAULT_FRESHNESS/* max value for ccnx*/);
+  createContentObject(const Name &name, const void *buf, size_t len, int freshness = DEFAULT_FRESHNESS, const Name &keyName=Name());
 
   int
   putToCcnd (const Bytes &contentObject);
@@ -128,15 +128,15 @@
 typedef boost::shared_ptr<CcnxWrapper> CcnxWrapperPtr;
 
 inline int
-CcnxWrapper::publishData (const Name &name, const Bytes &content, int freshness)
+CcnxWrapper::publishData (const Name &name, const Bytes &content, int freshness, const Name &keyName)
 {
-  return publishData(name, head(content), content.size(), freshness);
+  return publishData(name, head(content), content.size(), freshness, keyName);
 }
 
 inline int
-CcnxWrapper::publishData (const Name &name, const std::string &content, int freshness)
+CcnxWrapper::publishData (const Name &name, const std::string &content, int freshness, const Name &keyName)
 {
-  return publishData(name, reinterpret_cast<const unsigned char *> (content.c_str ()), content.size (), freshness);
+  return publishData(name, reinterpret_cast<const unsigned char *> (content.c_str ()), content.size (), freshness, keyName);
 }
 
 inline int
