diff --git a/ndn-cpp/data.cpp b/ndn-cpp/data.cpp
index 387d291..0fb13d6 100644
--- a/ndn-cpp/data.cpp
+++ b/ndn-cpp/data.cpp
@@ -14,19 +14,19 @@
 {
   signatureStruct.digestAlgorithmLength = digestAlgorithm_.size();
   if (digestAlgorithm_.size() > 0)
-    signatureStruct.digestAlgorithm = (unsigned char *)&digestAlgorithm_[0];
+    signatureStruct.digestAlgorithm = (unsigned char *)digestAlgorithm_.buf();
   else
     signatureStruct.digestAlgorithm = 0;
 
   signatureStruct.witnessLength = witness_.size();
   if (witness_.size() > 0)
-    signatureStruct.witness = (unsigned char *)&witness_[0];
+    signatureStruct.witness = (unsigned char *)witness_.buf();
   else
     signatureStruct.witness = 0;
 
   signatureStruct.signatureLength = signature_.size();
   if (signature_.size() > 0)
-    signatureStruct.signature = (unsigned char *)&signature_[0];
+    signatureStruct.signature = (unsigned char *)signature_.buf();
   else
     signatureStruct.signature = 0;
   
@@ -36,9 +36,9 @@
 
 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);
+  digestAlgorithm_ = Blob(signatureStruct.digestAlgorithm, signatureStruct.digestAlgorithmLength);
+  witness_ = Blob(signatureStruct.witness, signatureStruct.witnessLength);
+  signature_ = Blob(signatureStruct.signature, signatureStruct.signatureLength);
   publisherPublicKeyDigest_.set(signatureStruct.publisherPublicKeyDigest);
   keyLocator_.set(signatureStruct.keyLocator);
 }
diff --git a/ndn-cpp/data.hpp b/ndn-cpp/data.hpp
index 59eb6a3..ad87674 100644
--- a/ndn-cpp/data.hpp
+++ b/ndn-cpp/data.hpp
@@ -32,14 +32,11 @@
    */
   void set(const struct ndn_Signature& signatureStruct);
 
-  const std::vector<unsigned char>& getDigestAlgorithm() const { return digestAlgorithm_; }
-  std::vector<unsigned char>& getDigestAlgorithm() { return digestAlgorithm_; }
+  const Blob& getDigestAlgorithm() const { return digestAlgorithm_; }
 
-  const std::vector<unsigned char>& getWitness() const { return witness_; }
-  std::vector<unsigned char>& getWitness() { return witness_; }
+  const Blob& getWitness() const { return witness_; }
 
-  const std::vector<unsigned char>& getSignature() const { return signature_; }
-  std::vector<unsigned char>& getSignature() { return signature_; }
+  const Blob& getSignature() const { return signature_; }
   
   const PublisherPublicKeyDigest& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
   PublisherPublicKeyDigest& getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
@@ -50,19 +47,19 @@
   void setDigestAlgorithm(const std::vector<unsigned char>& digestAlgorithm) { digestAlgorithm_ = digestAlgorithm; }
   void setDigestAlgorithm(const unsigned char *digestAlgorithm, unsigned int digestAlgorithmLength) 
   { 
-    setVector(digestAlgorithm_, digestAlgorithm, digestAlgorithmLength); 
+    digestAlgorithm_ = Blob(digestAlgorithm, digestAlgorithmLength); 
   }
 
   void setWitness(const std::vector<unsigned char>& witness) { witness_ = witness; }
   void setWitness(const unsigned char *witness, unsigned int witnessLength) 
   { 
-    setVector(witness_, witness, witnessLength); 
+    witness_ = Blob(witness, witnessLength); 
   }
 
   void setSignature(const std::vector<unsigned char>& signature) { signature_ = signature; }
   void setSignature(const unsigned char *signature, unsigned int signatureLength) 
   { 
-    setVector(signature_, signature, signatureLength); 
+    signature_ = Blob(signature, signatureLength); 
   }
 
   void setPublisherPublicKeyDigest(const PublisherPublicKeyDigest& publisherPublicKeyDigest) { publisherPublicKeyDigest_ = publisherPublicKeyDigest; }
@@ -74,17 +71,17 @@
    */
   void clear()
   {
-    digestAlgorithm_.clear();
-    witness_.clear();
-    signature_.clear();
+    digestAlgorithm_.reset();
+    witness_.reset();
+    signature_.reset();
     publisherPublicKeyDigest_.clear();
     keyLocator_.clear();
   }
 
 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_;
+  Blob digestAlgorithm_; /**< if empty, the default is 2.16.840.1.101.3.4.2.1 (sha-256) */
+  Blob witness_;
+  Blob signature_;
   PublisherPublicKeyDigest publisherPublicKeyDigest_;
   KeyLocator keyLocator_;
 };
diff --git a/ndn-cpp/security/key-chain.cpp b/ndn-cpp/security/key-chain.cpp
index de7399e..5ba46ba 100644
--- a/ndn-cpp/security/key-chain.cpp
+++ b/ndn-cpp/security/key-chain.cpp
@@ -140,7 +140,7 @@
   if (!publicKey)
     throw std::runtime_error("Error decoding public key in d2i_RSAPublicKey");
   int success = RSA_verify
-    (NID_sha256, dataFieldsDigest, sizeof(dataFieldsDigest), &data.getSignature().getSignature().front(), 
+    (NID_sha256, dataFieldsDigest, sizeof(dataFieldsDigest), (unsigned char *)data.getSignature().getSignature().buf(), 
      data.getSignature().getSignature().size(), publicKey);
   // Free the public key before checking for success.
   RSA_free(publicKey);
diff --git a/tests/test-encode-decode-data.cpp b/tests/test-encode-decode-data.cpp
index e8311cf..1e4c165 100644
--- a/tests/test-encode-decode-data.cpp
+++ b/tests/test-encode-decode-data.cpp
@@ -102,11 +102,11 @@
            toHex(*data.getMetaInfo().getFinalBlockID().getValue()).c_str() : "<none>") << endl;
     
   cout << "signature.digestAlgorithm: "
-       << (data.getSignature().getDigestAlgorithm().size() > 0 ? toHex(data.getSignature().getDigestAlgorithm()).c_str() : "default (sha-256)") << endl;
+       << (data.getSignature().getDigestAlgorithm().size() > 0 ? toHex(*data.getSignature().getDigestAlgorithm()).c_str() : "default (sha-256)") << endl;
   cout << "signature.witness: "
-       << (data.getSignature().getWitness().size() > 0 ? toHex(data.getSignature().getWitness()).c_str() : "<none>") << endl;
+       << (data.getSignature().getWitness().size() > 0 ? toHex(*data.getSignature().getWitness()).c_str() : "<none>") << endl;
   cout << "signature.signature: "
-       << (data.getSignature().getSignature().size() > 0 ? toHex(data.getSignature().getSignature()).c_str() : "<none>") << endl;
+       << (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;
