diff --git a/ndn-cpp/key.hpp b/ndn-cpp/key.hpp
index 0717e1b..9f4f30e 100644
--- a/ndn-cpp/key.hpp
+++ b/ndn-cpp/key.hpp
@@ -26,7 +26,7 @@
   {
     type_ = (ndn_KeyLocatorType)-1;
     keyNameType_ = (ndn_KeyNameType)-1;
-    keyData_ = Blob(0, 0);
+    keyData_.reset();
   }
   
   /**
diff --git a/ndn-cpp/node.hpp b/ndn-cpp/node.hpp
index 9efb742..d9113d6 100644
--- a/ndn-cpp/node.hpp
+++ b/ndn-cpp/node.hpp
@@ -215,7 +215,7 @@
   std::vector<ptr_lib::shared_ptr<PitEntry> > pit_;
   std::vector<ptr_lib::shared_ptr<PrefixEntry> > registeredPrefixTable_;
   Interest ndndIdFetcherInterest_;
-  std::vector<unsigned char> ndndId_;
+  Blob ndndId_;
 };
 
 }
diff --git a/ndn-cpp/publisher-public-key-digest.hpp b/ndn-cpp/publisher-public-key-digest.hpp
index 0a5a2c5..4d02821 100644
--- a/ndn-cpp/publisher-public-key-digest.hpp
+++ b/ndn-cpp/publisher-public-key-digest.hpp
@@ -30,7 +30,7 @@
   {
     publisherPublicKeyDigestStruct.publisherPublicKeyDigestLength = publisherPublicKeyDigest_.size();
     if (publisherPublicKeyDigest_.size() > 0)
-      publisherPublicKeyDigestStruct.publisherPublicKeyDigest = (unsigned char *)&publisherPublicKeyDigest_[0];
+      publisherPublicKeyDigestStruct.publisherPublicKeyDigest = (unsigned char *)publisherPublicKeyDigest_.buf();
     else
       publisherPublicKeyDigestStruct.publisherPublicKeyDigest = 0;
   }
@@ -41,17 +41,16 @@
    */
   void set(const struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct) 
   {
-    setVector(publisherPublicKeyDigest_, publisherPublicKeyDigestStruct.publisherPublicKeyDigest, 
-              publisherPublicKeyDigestStruct.publisherPublicKeyDigestLength);
+    publisherPublicKeyDigest_ = 
+      Blob(publisherPublicKeyDigestStruct.publisherPublicKeyDigest, publisherPublicKeyDigestStruct.publisherPublicKeyDigestLength);
   }
 
-  const std::vector<unsigned char>& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
-  std::vector<unsigned char>& getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
+  const Blob& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
 
   void setPublisherPublicKeyDigest(const std::vector<unsigned char>& publisherPublicKeyDigest) { publisherPublicKeyDigest_ = publisherPublicKeyDigest; }
   void setPublisherPublicKeyDigest(const unsigned char *publisherPublicKeyDigest, unsigned int publisherPublicKeyDigestLength) 
   { 
-    setVector(publisherPublicKeyDigest_, publisherPublicKeyDigest, publisherPublicKeyDigestLength); 
+    publisherPublicKeyDigest_ = Blob(publisherPublicKeyDigest, publisherPublicKeyDigestLength); 
   }
   
   /**
@@ -59,11 +58,11 @@
    */
   void clear()
   {
-    publisherPublicKeyDigest_.clear();
+    publisherPublicKeyDigest_.reset();
   }
 
 private:
-  std::vector<unsigned char> publisherPublicKeyDigest_;
+  Blob publisherPublicKeyDigest_;
 };
   
 }
diff --git a/ndn-cpp/security/key-chain.cpp b/ndn-cpp/security/key-chain.cpp
index 4a19869..de7399e 100644
--- a/ndn-cpp/security/key-chain.cpp
+++ b/ndn-cpp/security/key-chain.cpp
@@ -60,19 +60,6 @@
 };
 
 /**
- * Call digestSha256 and set the digest vector to the result.
- * @param data
- * @param dataLength
- * @param digest
- */
-void setSha256(const unsigned char *data, unsigned int dataLength, vector<unsigned char>& digest)
-{
-  unsigned char digestBuffer[SHA256_DIGEST_LENGTH];
-  ndn_digestSha256(data, dataLength, digestBuffer);
-  setVector(digest, digestBuffer, sizeof(digestBuffer));
-}
-
-/**
  * Encode the fields of the Data object and set digest to the sha-256 digest.
  * @param data The Data object with the fields to digest.
  * @param digest A pointer to a buffer of size SHA256_DIGEST_LENGTH to receive the data.
@@ -92,7 +79,9 @@
   // Clear the signature so we don't encode it below.
   data.getSignature().clear();
   // Set the public key.
-  setSha256(publicKeyDer, publicKeyDerLength, data.getSignature().getPublisherPublicKeyDigest().getPublisherPublicKeyDigest());
+  unsigned char publicKeyDigest[SHA256_DIGEST_LENGTH];
+  ndn_digestSha256(publicKeyDer, publicKeyDerLength, publicKeyDigest);
+  data.getSignature().getPublisherPublicKeyDigest().setPublisherPublicKeyDigest(publicKeyDigest, sizeof(publicKeyDigest));
   data.getSignature().getKeyLocator().setType(ndn_KeyLocatorType_KEY);
   data.getSignature().getKeyLocator().setKeyData(publicKeyDer, publicKeyDerLength);
 
diff --git a/tests/test-encode-decode-data.cpp b/tests/test-encode-decode-data.cpp
index 6b10104..e8311cf 100644
--- a/tests/test-encode-decode-data.cpp
+++ b/tests/test-encode-decode-data.cpp
@@ -109,7 +109,7 @@
        << (data.getSignature().getSignature().size() > 0 ? toHex(data.getSignature().getSignature()).c_str() : "<none>") << endl;
   cout << "signature.publisherPublicKeyDigest: "
        << (data.getSignature().getPublisherPublicKeyDigest().getPublisherPublicKeyDigest().size() > 0 ? 
-           toHex(data.getSignature().getPublisherPublicKeyDigest().getPublisherPublicKeyDigest()).c_str() : "<none>") << endl;
+           toHex(*data.getSignature().getPublisherPublicKeyDigest().getPublisherPublicKeyDigest()).c_str() : "<none>") << endl;
   cout << "signature.keyLocator: ";
   if ((int)data.getSignature().getKeyLocator().getType() >= 0) {
     if (data.getSignature().getKeyLocator().getType() == ndn_KeyLocatorType_KEY)
