diff --git a/include/ccnx-wrapper.h b/include/ccnx-wrapper.h
index 42466eb..12a5bc7 100644
--- a/include/ccnx-wrapper.h
+++ b/include/ccnx-wrapper.h
@@ -60,21 +60,6 @@
 
   /// @cond include_hidden
   void
-  createKeyLocator ();
-
-  void
-  initKeyStore ();
-
-  const ccn_pkey *
-  getPrivateKey ();
-
-  const unsigned char *
-  getPublicKeyDigest ();
-
-  ssize_t
-  getPublicKeyDigestLength ();
-
-  void
   ccnLoop ();
 
   /// @endcond
diff --git a/src/ccnx-wrapper.cpp b/src/ccnx-wrapper.cpp
index 5f1ffc9..981fdd4 100644
--- a/src/ccnx-wrapper.cpp
+++ b/src/ccnx-wrapper.cpp
@@ -40,8 +40,6 @@
   , m_connected (false)
 {
   connectCcnd();
-  initKeyStore ();
-  createKeyLocator ();
   m_thread = thread (&CcnxWrapper::ccnLoop, this);
 }
 
@@ -86,47 +84,6 @@
 }
 
 void
-CcnxWrapper::createKeyLocator ()
-{
-  m_keyLoactor = ccn_charbuf_create();
-  ccn_charbuf_append_tt (m_keyLoactor, CCN_DTAG_KeyLocator, CCN_DTAG);
-  ccn_charbuf_append_tt (m_keyLoactor, CCN_DTAG_Key, CCN_DTAG);
-  int res = ccn_append_pubkey_blob (m_keyLoactor, ccn_keystore_public_key(m_keyStore));
-  if (res >= 0)
-    {
-      ccn_charbuf_append_closer (m_keyLoactor); /* </Key> */
-      ccn_charbuf_append_closer (m_keyLoactor); /* </KeyLocator> */
-    }
-}
-
-const ccn_pkey*
-CcnxWrapper::getPrivateKey ()
-{
-  return ccn_keystore_private_key (m_keyStore);
-}
-
-const unsigned char*
-CcnxWrapper::getPublicKeyDigest ()
-{
-  return ccn_keystore_public_key_digest(m_keyStore);
-}
-
-ssize_t
-CcnxWrapper::getPublicKeyDigestLength ()
-{
-  return ccn_keystore_public_key_digest_length(m_keyStore);
-}
-
-void
-CcnxWrapper::initKeyStore ()
-{
-  m_keyStore = ccn_keystore_create ();
-  string keyStoreFile = string(getenv("HOME")) + string("/.ccnx/.ccnx_keystore");
-  if (ccn_keystore_init (m_keyStore, (char *)keyStoreFile.c_str(), (char*)"Th1s1sn0t8g00dp8ssw0rd.") < 0)
-    BOOST_THROW_EXCEPTION(CcnxOperationException() << errmsg_info_str(keyStoreFile.c_str()));
-}
-
-void
 CcnxWrapper::ccnLoop ()
 {
   static boost::mt19937 randomGenerator (static_cast<unsigned int> (std::time (0)));
@@ -215,28 +172,19 @@
 {
   CcnxCharbufPtr ptr = name.toCcnxCharbuf();
   ccn_charbuf *pname = ptr->getBuf();
-  ccn_charbuf *signed_info = ccn_charbuf_create();
   ccn_charbuf *content = ccn_charbuf_create();
 
-  ccn_signed_info_create(signed_info,
-			 getPublicKeyDigest(),
-			 getPublicKeyDigestLength(),
-			 NULL,
-			 CCN_CONTENT_DATA,
-			 freshness,
-			 NULL,
-			 m_keyLoactor);
-  if(ccn_encode_ContentObject(content, pname, signed_info,
-			   buf, len,
-			   NULL, getPrivateKey()) < 0)
+  struct ccn_signing_params sp = CCN_SIGNING_PARAMS_INIT;
+  sp.freshness = freshness;
+
+  if (ccn_sign_content(m_handle, content, pname, &sp, buf, len) != 0)
   {
-    // BOOST_THROW_EXCEPTION(CcnxOperationException() << errmsg_info_str("encode content failed"));
+    BOOST_THROW_EXCEPTION(CcnxOperationException() << errmsg_info_str("sign content failed"));
   }
 
   Bytes bytes;
   readRaw(bytes, content->buf, content->length);
 
-  ccn_charbuf_destroy (&signed_info);
   ccn_charbuf_destroy (&content);
 
   return bytes;
