diff --git a/src/encoding/buffer.cpp b/src/encoding/buffer.cpp
index 0d9550b..9390079 100644
--- a/src/encoding/buffer.cpp
+++ b/src/encoding/buffer.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -35,14 +35,7 @@
               "Buffer must be MoveAssignable with noexcept");
 #endif // NDN_CXX_HAVE_IS_NOTHROW_MOVE_ASSIGNABLE
 
-Buffer::Buffer()
-{
-}
-
-Buffer::Buffer(size_t size)
-  : std::vector<uint8_t>(size, 0)
-{
-}
+Buffer::Buffer() = default;
 
 Buffer::Buffer(const void* buf, size_t length)
   : std::vector<uint8_t>(reinterpret_cast<const uint8_t*>(buf),
diff --git a/src/encoding/buffer.hpp b/src/encoding/buffer.hpp
index 994fbf8..70ffec8 100644
--- a/src/encoding/buffer.hpp
+++ b/src/encoding/buffer.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2014 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -30,104 +30,50 @@
 
 namespace ndn {
 
-class Buffer;
-typedef shared_ptr<const Buffer> ConstBufferPtr;
-typedef shared_ptr<Buffer> BufferPtr;
-
 /**
- * @brief Class representing a general-use automatically managed/resized buffer
+ * @brief General-purpose automatically managed/resized buffer
  *
- * In most respect, Buffer class is equivalent to std::vector<uint8_t> and is in fact
- * uses it as a base class.  In addition to that, it provides buf() and buf<T>() helper
- * method for easier access to the underlying data (buf<T>() casts pointer to the requested class)
+ * In most respect, the Buffer class is equivalent to a `std::vector<uint8_t>`, and it in fact
+ * uses the latter as a base class. In addition to that, it provides the get<T>() helper method
+ * that automatically casts the returned pointer to the requested type.
  */
 class Buffer : public std::vector<uint8_t>
 {
 public:
-  /** @brief Creates an empty buffer
+  using std::vector<uint8_t>::vector;
+
+  /** @brief Creates an empty Buffer
    */
   Buffer();
 
-  /** @brief Creates a buffer with pre-allocated size
-   *  @param size size of the buffer to be allocated
-   */
-  explicit
-  Buffer(size_t size);
-
-  /** @brief Create a buffer by copying contents from a buffer
-   *  @param buf const pointer to buffer
+  /** @brief Creates a Buffer by copying contents from a raw buffer
+   *  @param buf const pointer to buffer to copy
    *  @param length length of the buffer to copy
    */
   Buffer(const void* buf, size_t length);
 
-  /** @brief Create a buffer by copying contents of the range [first, last)
-   *  @tparam InputIterator an InputIterator compatible with std::vector<uint8_t> constructor
-   *  @param first iterator to the first element to copy
-   *  @param last  iterator to the element immediately following the last element to copy
-   */
-  template <class InputIterator>
-  Buffer(InputIterator first, InputIterator last)
-    : std::vector<uint8_t>(first, last)
-  {
-  }
-
-  /** @return pointer to the first byte of the buffer
-   */
-  uint8_t*
-  get()
-  {
-    return &front();
-  }
-
-  /** @return pointer to the first byte of the buffer
-   *
-   *  This is same as \p .get()
-   */
-  uint8_t*
-  buf()
-  {
-    return &front();
-  }
-
-  /** @return pointer to the first byte of the buffer and reinterpret_cast
-   *          it to the requested type T
+  /** @return pointer to the first byte of the buffer, cast to the requested type T
    */
   template<class T>
   T*
-  get()
+  get() noexcept
   {
-    return reinterpret_cast<T*>(&front());
+    return reinterpret_cast<T*>(data());
   }
 
-  /** @return pointer to the first byte of the buffer
-   *
-   *  This is same as \p .get()
-   */
-  const uint8_t*
-  buf() const
-  {
-    return &front();
-  }
-
-  /** @return pointer to the first byte of the buffer
-   */
-  const uint8_t*
-  get() const
-  {
-    return &front();
-  }
-
-  /** @return const pointer to the first byte of the buffer and reinterpret_cast
-   *          it to the requested type T
+  /** @return const pointer to the first byte of the buffer, cast to the requested type T
    */
   template<class T>
   const T*
-  get() const
+  get() const noexcept
   {
-    return reinterpret_cast<const T*>(&front());
+    return reinterpret_cast<const T*>(data());
   }
 };
 
+using BufferPtr = shared_ptr<Buffer>;
+using ConstBufferPtr = shared_ptr<const Buffer>;
+
 } // namespace ndn
 
 #endif // NDN_ENCODING_BUFFER_HPP
diff --git a/src/key-locator.cpp b/src/key-locator.cpp
index 50453d9..9692ecc 100644
--- a/src/key-locator.cpp
+++ b/src/key-locator.cpp
@@ -177,7 +177,7 @@
   // This function takes a constant reference of a shared pointer.
   // It MUST NOT change the reference count of that shared pointer.
 
-  return this->setKeyDigest(makeBinaryBlock(tlv::KeyDigest, keyDigest->get(), keyDigest->size()));
+  return this->setKeyDigest(makeBinaryBlock(tlv::KeyDigest, keyDigest->data(), keyDigest->size()));
 }
 
 bool
diff --git a/src/name-component.cpp b/src/name-component.cpp
index 1cdd8f9..5cf31aa 100644
--- a/src/name-component.cpp
+++ b/src/name-component.cpp
@@ -69,7 +69,7 @@
 }
 
 Component::Component(const Buffer& value)
-  : Block(makeBinaryBlock(tlv::NameComponent, value.buf(), value.size()))
+  : Block(makeBinaryBlock(tlv::NameComponent, value.data(), value.size()))
 {
 }
 
diff --git a/src/security/pib/detail/key-impl.cpp b/src/security/pib/detail/key-impl.cpp
index e88bdac..c4c65c2 100644
--- a/src/security/pib/detail/key-impl.cpp
+++ b/src/security/pib/detail/key-impl.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -63,7 +63,7 @@
   m_key = m_pib->getKeyBits(m_keyName);
 
   transform::PublicKey key;
-  key.loadPkcs8(m_key.buf(), m_key.size());
+  key.loadPkcs8(m_key.data(), m_key.size());
   m_keyType = key.getKeyType();
 }
 
diff --git a/src/security/safe-bag.cpp b/src/security/safe-bag.cpp
index 8315acf..4c8a82d 100644
--- a/src/security/safe-bag.cpp
+++ b/src/security/safe-bag.cpp
@@ -64,7 +64,7 @@
 
   // EncryptedKeyBag
   totalLength += encoder.prependByteArrayBlock(tlv::security::EncryptedKeyBag,
-                                               m_encryptedKeyBag.get(),
+                                               m_encryptedKeyBag.data(),
                                                m_encryptedKeyBag.size());
 
   // Certificate
diff --git a/src/security/transform/buffer-source.cpp b/src/security/transform/buffer-source.cpp
index b47e855..3f45c85 100644
--- a/src/security/transform/buffer-source.cpp
+++ b/src/security/transform/buffer-source.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -38,7 +38,7 @@
 }
 
 BufferSource::BufferSource(const Buffer& buffer)
-  : m_buf(buffer.buf())
+  : m_buf(buffer.data())
   , m_size(buffer.size())
 {
 }
diff --git a/src/security/transform/private-key.cpp b/src/security/transform/private-key.cpp
index 8139a0f..84a1875 100644
--- a/src/security/transform/private-key.cpp
+++ b/src/security/transform/private-key.cpp
@@ -115,7 +115,7 @@
 {
   OBufferStream os;
   streamSource(is) >> streamSink(os);
-  this->loadPkcs1(os.buf()->buf(), os.buf()->size());
+  this->loadPkcs1(os.buf()->data(), os.buf()->size());
 }
 
 void
@@ -123,7 +123,7 @@
 {
   OBufferStream os;
   bufferSource(buf, size) >> base64Decode() >> streamSink(os);
-  this->loadPkcs1(os.buf()->buf(), os.buf()->size());
+  this->loadPkcs1(os.buf()->data(), os.buf()->size());
 }
 
 void
@@ -131,7 +131,7 @@
 {
   OBufferStream os;
   streamSource(is) >> base64Decode() >> streamSink(os);
-  this->loadPkcs1(os.buf()->buf(), os.buf()->size());
+  this->loadPkcs1(os.buf()->data(), os.buf()->size());
 }
 
 void
@@ -181,7 +181,7 @@
 {
   OBufferStream os;
   streamSource(is) >> streamSink(os);
-  this->loadPkcs8(os.buf()->buf(), os.buf()->size(), pw, pwLen);
+  this->loadPkcs8(os.buf()->data(), os.buf()->size(), pw, pwLen);
 }
 
 void
@@ -189,7 +189,7 @@
 {
   OBufferStream os;
   streamSource(is) >> streamSink(os);
-  this->loadPkcs8(os.buf()->buf(), os.buf()->size(), pwCallback);
+  this->loadPkcs8(os.buf()->data(), os.buf()->size(), pwCallback);
 }
 
 void
@@ -197,7 +197,7 @@
 {
   OBufferStream os;
   bufferSource(buf, size) >> base64Decode() >> streamSink(os);
-  this->loadPkcs8(os.buf()->buf(), os.buf()->size(), pw, pwLen);
+  this->loadPkcs8(os.buf()->data(), os.buf()->size(), pw, pwLen);
 }
 
 void
@@ -205,7 +205,7 @@
 {
   OBufferStream os;
   bufferSource(buf, size) >> base64Decode() >> streamSink(os);
-  this->loadPkcs8(os.buf()->buf(), os.buf()->size(), pwCallback);
+  this->loadPkcs8(os.buf()->data(), os.buf()->size(), pwCallback);
 }
 
 void
@@ -213,7 +213,7 @@
 {
   OBufferStream os;
   streamSource(is) >> base64Decode() >> streamSink(os);
-  this->loadPkcs8(os.buf()->buf(), os.buf()->size(), pw, pwLen);
+  this->loadPkcs8(os.buf()->data(), os.buf()->size(), pw, pwLen);
 }
 
 void
@@ -221,7 +221,7 @@
 {
   OBufferStream os;
   streamSource(is) >> base64Decode() >> streamSink(os);
-  this->loadPkcs8(os.buf()->buf(), os.buf()->size(), pwCallback);
+  this->loadPkcs8(os.buf()->data(), os.buf()->size(), pwCallback);
 }
 
 void
@@ -309,7 +309,7 @@
     BOOST_THROW_EXCEPTION(Error("Cannot convert key to PKCS #1 format"));
 
   auto buffer = make_shared<Buffer>(BIO_pending(membio));
-  membio.read(buffer->buf(), buffer->size());
+  membio.read(buffer->data(), buffer->size());
 
   return buffer;
 }
@@ -327,7 +327,7 @@
     BOOST_THROW_EXCEPTION(Error("Cannot convert key to PKCS #8 format"));
 
   auto buffer = make_shared<Buffer>(BIO_pending(membio));
-  membio.read(buffer->buf(), buffer->size());
+  membio.read(buffer->data(), buffer->size());
 
   return buffer;
 }
@@ -344,7 +344,7 @@
     BOOST_THROW_EXCEPTION(Error("Cannot convert key to PKCS #8 format"));
 
   auto buffer = make_shared<Buffer>(BIO_pending(membio));
-  membio.read(buffer->buf(), buffer->size());
+  membio.read(buffer->data(), buffer->size());
 
   return buffer;
 }
@@ -366,7 +366,7 @@
     BOOST_THROW_EXCEPTION(Error("Failed to estimate output length"));
 
   auto out = make_shared<Buffer>(outlen);
-  if (EVP_PKEY_decrypt(ctx, out->buf(), &outlen, cipherText, cipherLen) <= 0)
+  if (EVP_PKEY_decrypt(ctx, out->data(), &outlen, cipherText, cipherLen) <= 0)
     BOOST_THROW_EXCEPTION(Error("Failed to decrypt ciphertext"));
 
   out->resize(outlen);
diff --git a/src/security/transform/public-key.cpp b/src/security/transform/public-key.cpp
index 16dd3d1..1cf7e2e 100644
--- a/src/security/transform/public-key.cpp
+++ b/src/security/transform/public-key.cpp
@@ -98,7 +98,7 @@
 {
   OBufferStream os;
   streamSource(is) >> streamSink(os);
-  this->loadPkcs8(os.buf()->buf(), os.buf()->size());
+  this->loadPkcs8(os.buf()->data(), os.buf()->size());
 }
 
 void
@@ -106,7 +106,7 @@
 {
   OBufferStream os;
   bufferSource(buf, size) >> base64Decode() >> streamSink(os);
-  this->loadPkcs8(os.buf()->buf(), os.buf()->size());
+  this->loadPkcs8(os.buf()->data(), os.buf()->size());
 }
 
 void
@@ -114,7 +114,7 @@
 {
   OBufferStream os;
   streamSource(is) >> base64Decode() >> streamSink(os);
-  this->loadPkcs8(os.buf()->buf(), os.buf()->size());
+  this->loadPkcs8(os.buf()->data(), os.buf()->size());
 }
 
 void
@@ -184,7 +184,7 @@
     BOOST_THROW_EXCEPTION(Error("Failed to estimate output length"));
 
   auto out = make_shared<Buffer>(outlen);
-  if (EVP_PKEY_encrypt(ctx, out->buf(), &outlen, plainText, plainLen) <= 0)
+  if (EVP_PKEY_encrypt(ctx, out->data(), &outlen, plainText, plainLen) <= 0)
     BOOST_THROW_EXCEPTION(Error("Failed to encrypt plaintext"));
 
   out->resize(outlen);
diff --git a/src/security/v2/certificate.cpp b/src/security/v2/certificate.cpp
index dcd6ae0..dc48c3e 100644
--- a/src/security/v2/certificate.cpp
+++ b/src/security/v2/certificate.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -159,9 +159,9 @@
 
   os << "Public key bits:\n";
   {
+    using namespace transform;
     util::IndentedStream os2(os, "  ");
-    namespace t = ndn::security::transform;
-    t::bufferSource(cert.getPublicKey().buf(), cert.getPublicKey().size()) >> t::base64Encode() >> t::streamSink(os2);
+    bufferSource(cert.getPublicKey().data(), cert.getPublicKey().size()) >> base64Encode() >> streamSink(os2);
   }
 
   os << "Signature Information:\n";
diff --git a/src/security/v2/key-chain.cpp b/src/security/v2/key-chain.cpp
index 9f14402..2d0820d 100644
--- a/src/security/v2/key-chain.cpp
+++ b/src/security/v2/key-chain.cpp
@@ -273,7 +273,7 @@
 
   // set up key info in PIB
   ConstBufferPtr pubKey = m_tpm->getPublicKey(keyName);
-  Key key = identity.addKey(pubKey->buf(), pubKey->size(), keyName);
+  Key key = identity.addKey(pubKey->data(), pubKey->size(), keyName);
 
   NDN_LOG_DEBUG("Requesting self-signing for newly created key " << key.getName());
   selfSign(key);
@@ -386,7 +386,7 @@
 
   try {
     m_tpm->importPrivateKey(keyName,
-                            safeBag.getEncryptedKeyBag().buf(), safeBag.getEncryptedKeyBag().size(),
+                            safeBag.getEncryptedKeyBag().data(), safeBag.getEncryptedKeyBag().size(),
                             pw, pwLen);
   }
   catch (const std::runtime_error&) {
@@ -407,9 +407,9 @@
   {
     using namespace transform;
     PublicKey publicKey;
-    publicKey.loadPkcs8(publicKeyBits.buf(), publicKeyBits.size());
+    publicKey.loadPkcs8(publicKeyBits.data(), publicKeyBits.size());
     bufferSource(content, sizeof(content)) >> verifierFilter(DigestAlgorithm::SHA256, publicKey,
-                                                             sigBits->buf(), sigBits->size())
+                                                             sigBits->data(), sigBits->size())
                                            >> boolSink(isVerified);
   }
   if (!isVerified) {
@@ -419,7 +419,7 @@
   }
 
   Identity id = m_pib->addIdentity(identity);
-  Key key = id.addKey(cert.getPublicKey().buf(), cert.getPublicKey().size(), keyName);
+  Key key = id.addKey(cert.getPublicKey().data(), cert.getPublicKey().size(), keyName);
   key.addCertificate(cert);
 }
 
@@ -559,7 +559,7 @@
   certificate.setFreshnessPeriod(time::hours(1));
 
   // set content
-  certificate.setContent(key.getPublicKey().buf(), key.getPublicKey().size());
+  certificate.setContent(key.getPublicKey().data(), key.getPublicKey().size());
 
   // set signature-info
   SignatureInfo signatureInfo;
diff --git a/src/security/verification-helpers.cpp b/src/security/verification-helpers.cpp
index 1d22373..8c42937 100644
--- a/src/security/verification-helpers.cpp
+++ b/src/security/verification-helpers.cpp
@@ -155,13 +155,13 @@
 bool
 verifySignature(const Data& data, const pib::Key& key)
 {
-  return verifySignature(parse(data), key.getPublicKey().buf(), key.getPublicKey().size());
+  return verifySignature(parse(data), key.getPublicKey().data(), key.getPublicKey().size());
 }
 
 bool
 verifySignature(const Interest& interest, const pib::Key& key)
 {
-  return verifySignature(parse(interest), key.getPublicKey().buf(), key.getPublicKey().size());
+  return verifySignature(parse(interest), key.getPublicKey().data(), key.getPublicKey().size());
 }
 
 bool
@@ -209,7 +209,7 @@
     return false;
 
   // constant-time buffer comparison to mitigate timing attacks
-  return CRYPTO_memcmp(result->buf(), digest, digestLen) == 0;
+  return CRYPTO_memcmp(result->data(), digest, digestLen) == 0;
 }
 
 bool
diff --git a/src/util/sha256.cpp b/src/util/sha256.cpp
index 7aeea64..034d12e 100644
--- a/src/util/sha256.cpp
+++ b/src/util/sha256.cpp
@@ -82,14 +82,14 @@
   }
 
   // constant-time buffer comparison to mitigate timing attacks
-  return CRYPTO_memcmp(lhs.get(), rhs.get(), lhs.size()) == 0;
+  return CRYPTO_memcmp(lhs.data(), rhs.data(), lhs.size()) == 0;
 }
 
 Sha256&
 Sha256::operator<<(Sha256& src)
 {
   auto buf = src.computeDigest();
-  update(buf->get(), buf->size());
+  update(buf->data(), buf->size());
   return *this;
 }
 
diff --git a/src/util/string-helper.cpp b/src/util/string-helper.cpp
index 7665afc..8be94d0 100644
--- a/src/util/string-helper.cpp
+++ b/src/util/string-helper.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -60,7 +60,7 @@
 void
 printHex(std::ostream& os, const Buffer& buffer, bool wantUpperCase)
 {
-  return printHex(os, buffer.buf(), buffer.size(), wantUpperCase);
+  return printHex(os, buffer.data(), buffer.size(), wantUpperCase);
 }
 
 std::string
@@ -74,7 +74,7 @@
 std::string
 toHex(const Buffer& buffer, bool wantUpperCase)
 {
-  return toHex(buffer.buf(), buffer.size(), wantUpperCase);
+  return toHex(buffer.data(), buffer.size(), wantUpperCase);
 }
 
 int
diff --git a/tests/identity-management-fixture.cpp b/tests/identity-management-fixture.cpp
index ecda82d..ee80dd1 100644
--- a/tests/identity-management-fixture.cpp
+++ b/tests/identity-management-fixture.cpp
@@ -115,7 +115,7 @@
   certificate.setFreshnessPeriod(time::hours(1));
 
   // set content
-  certificate.setContent(key.getPublicKey().buf(), key.getPublicKey().size());
+  certificate.setContent(key.getPublicKey().data(), key.getPublicKey().size());
 
   // set signature-info
   SignatureInfo info;
diff --git a/tests/unit-tests/data.t.cpp b/tests/unit-tests/data.t.cpp
index fabd22c..91d46f9 100644
--- a/tests/unit-tests/data.t.cpp
+++ b/tests/unit-tests/data.t.cpp
@@ -194,7 +194,7 @@
   }
   auto buf = sig.buf();
   tlv::writeVarNumber(os, buf->size());
-  os.write(reinterpret_cast<const char*>(buf->data()), buf->size());
+  os.write(buf->get<char>(), buf->size());
 
   Block signatureValue(os.buf());
   Signature signature(signatureInfo, signatureValue);
diff --git a/tests/unit-tests/encoding/encoding-buffer.t.cpp b/tests/unit-tests/encoding/encoding-buffer.t.cpp
index 00240b8..153b7e9 100644
--- a/tests/unit-tests/encoding/encoding-buffer.t.cpp
+++ b/tests/unit-tests/encoding/encoding-buffer.t.cpp
@@ -40,8 +40,6 @@
 BOOST_AUTO_TEST_CASE(ConstructFromBlock)
 {
   auto buf = make_shared<Buffer>(10);
-  std::memset(buf->get(), 0, 10);
-
   Block block(0xab, buf);
   block.encode();
 
diff --git a/tests/unit-tests/ims/in-memory-storage.t.cpp b/tests/unit-tests/ims/in-memory-storage.t.cpp
index 67d87f2..b493001 100644
--- a/tests/unit-tests/ims/in-memory-storage.t.cpp
+++ b/tests/unit-tests/ims/in-memory-storage.t.cpp
@@ -31,7 +31,7 @@
 #include "make-interest-data.hpp"
 #include "../unit-test-time-fixture.hpp"
 
-#include <boost/mpl/list.hpp>
+#include <boost/mpl/vector.hpp>
 
 namespace ndn {
 namespace tests {
@@ -41,10 +41,10 @@
 BOOST_AUTO_TEST_SUITE(Ims)
 BOOST_AUTO_TEST_SUITE(TestInMemoryStorage)
 
-using InMemoryStorages = boost::mpl::list<InMemoryStoragePersistent,
-                                          InMemoryStorageFifo,
-                                          InMemoryStorageLfu,
-                                          InMemoryStorageLru>;
+using InMemoryStorages = boost::mpl::vector<InMemoryStoragePersistent,
+                                            InMemoryStorageFifo,
+                                            InMemoryStorageLfu,
+                                            InMemoryStorageLru>;
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(Insertion, T, InMemoryStorages)
 {
@@ -395,7 +395,7 @@
   ConstBufferPtr digest1 = util::Sha256::computeDigest(data->wireEncode().wire(), data->wireEncode().size());
 
   shared_ptr<Interest> interest = makeInterest("");
-  interest->setName(Name(name).appendImplicitSha256Digest(digest1->buf(), digest1->size()));
+  interest->setName(Name(name).appendImplicitSha256Digest(digest1->data(), digest1->size()));
   interest->setMinSuffixComponents(0);
   interest->setMaxSuffixComponents(0);
 
@@ -621,9 +621,9 @@
   BOOST_CHECK_EQUAL(found3->getName(), "/c/a");
 }
 
-using InMemoryStoragesLimited = boost::mpl::list<InMemoryStorageFifo,
-                                                 InMemoryStorageLfu,
-                                                 InMemoryStorageLru>;
+using InMemoryStoragesLimited = boost::mpl::vector<InMemoryStorageFifo,
+                                                   InMemoryStorageLfu,
+                                                   InMemoryStorageLru>;
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(SetCapacity, T, InMemoryStoragesLimited)
 {
diff --git a/tests/unit-tests/security/digest-sha256.t.cpp b/tests/unit-tests/security/digest-sha256.t.cpp
index 7855058..f3d7bb7 100644
--- a/tests/unit-tests/security/digest-sha256.t.cpp
+++ b/tests/unit-tests/security/digest-sha256.t.cpp
@@ -41,7 +41,7 @@
   char content[6] = "1234\n";
   ConstBufferPtr buf = util::Sha256::computeDigest(reinterpret_cast<uint8_t*>(content), 5);
 
-  BOOST_CHECK_EQUAL(toHex(buf->buf(), buf->size(), false),
+  BOOST_CHECK_EQUAL(toHex(buf->data(), buf->size(), false),
                     "a883dafc480d466ee04e0d6da986bd78eb1fdd2178d04693723da3a8f95d42f4");
 }
 
diff --git a/tests/unit-tests/security/pib/detail/identity-impl.t.cpp b/tests/unit-tests/security/pib/detail/identity-impl.t.cpp
index 2f35d2f..0eaabdb 100644
--- a/tests/unit-tests/security/pib/detail/identity-impl.t.cpp
+++ b/tests/unit-tests/security/pib/detail/identity-impl.t.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -22,9 +22,9 @@
 #include "security/pib/detail/identity-impl.hpp"
 #include "security/pib/pib.hpp"
 #include "security/pib/pib-memory.hpp"
-#include "../pib-data-fixture.hpp"
 
 #include "boost-test.hpp"
+#include "../pib-data-fixture.hpp"
 
 namespace ndn {
 namespace security {
@@ -64,7 +64,7 @@
   BOOST_REQUIRE_THROW(identity1.setDefaultKey(id1Key1Name), Pib::Error);
 
   // add key
-  identity1.addKey(id1Key1.buf(), id1Key1.size(), id1Key1Name);
+  identity1.addKey(id1Key1.data(), id1Key1.size(), id1Key1Name);
   BOOST_CHECK_NO_THROW(identity1.getKey(id1Key1Name));
 
   // new key becomes default key when there is no default key
@@ -79,7 +79,7 @@
   BOOST_CHECK_THROW(identity1.getDefaultKey(), Pib::Error);
 
   // set default key directly
-  BOOST_REQUIRE_NO_THROW(identity1.setDefaultKey(id1Key1.buf(), id1Key1.size(), id1Key1Name));
+  BOOST_REQUIRE_NO_THROW(identity1.setDefaultKey(id1Key1.data(), id1Key1.size(), id1Key1Name));
   BOOST_REQUIRE_NO_THROW(identity1.getDefaultKey());
   BOOST_CHECK_NO_THROW(identity1.getKey(id1Key1Name));
 
@@ -89,7 +89,7 @@
   BOOST_CHECK(defaultKey1.getPublicKey() == id1Key1);
 
   // add another key
-  identity1.addKey(id1Key2.buf(), id1Key2.size(), id1Key2Name);
+  identity1.addKey(id1Key2.data(), id1Key2.size(), id1Key2Name);
   BOOST_CHECK_EQUAL(identity1.getKeys().size(), 2);
 
   // set default key through name
@@ -105,7 +105,7 @@
   BOOST_CHECK_EQUAL(identity1.getKeys().size(), 1);
 
   // set default key directly again, change the default setting
-  BOOST_REQUIRE_NO_THROW(identity1.setDefaultKey(id1Key1.buf(), id1Key1.size(), id1Key1Name));
+  BOOST_REQUIRE_NO_THROW(identity1.setDefaultKey(id1Key1.data(), id1Key1.size(), id1Key1Name));
   const Key& defaultKey3 = identity1.getDefaultKey();
   BOOST_CHECK_EQUAL(defaultKey3.getName(), id1Key1Name);
   BOOST_CHECK(defaultKey3.getPublicKey() == id1Key1);
@@ -126,10 +126,10 @@
   auto pibImpl = make_shared<pib::PibMemory>();
   IdentityImpl identity1(id1, pibImpl, true);
 
-  identity1.addKey(id1Key1.buf(), id1Key1.size(), id1Key1Name);
+  identity1.addKey(id1Key1.data(), id1Key1.size(), id1Key1Name);
   BOOST_CHECK(identity1.getKey(id1Key1Name).getPublicKey() == id1Key1);
 
-  identity1.addKey(id1Key2.buf(), id1Key2.size(), id1Key1Name); // overwriting key should work
+  identity1.addKey(id1Key2.data(), id1Key2.size(), id1Key1Name); // overwriting key should work
   BOOST_CHECK(identity1.getKey(id1Key1Name).getPublicKey() == id1Key2);
 }
 
@@ -140,11 +140,11 @@
   BOOST_CHECK_THROW(IdentityImpl(id1, pibImpl, false), Pib::Error);
   IdentityImpl identity1(id1, pibImpl, true);
 
-  identity1.addKey(id1Key1.buf(), id1Key1.size(), id1Key1Name);
-  BOOST_CHECK_THROW(identity1.addKey(id2Key1.buf(), id2Key1.size(), id2Key1Name), std::invalid_argument);
+  identity1.addKey(id1Key1.data(), id1Key1.size(), id1Key1Name);
+  BOOST_CHECK_THROW(identity1.addKey(id2Key1.data(), id2Key1.size(), id2Key1Name), std::invalid_argument);
   BOOST_CHECK_THROW(identity1.removeKey(id2Key1Name), std::invalid_argument);
   BOOST_CHECK_THROW(identity1.getKey(id2Key1Name), std::invalid_argument);
-  BOOST_CHECK_THROW(identity1.setDefaultKey(id2Key1.buf(), id2Key1.size(), id2Key1Name), std::invalid_argument);
+  BOOST_CHECK_THROW(identity1.setDefaultKey(id2Key1.data(), id2Key1.size(), id2Key1Name), std::invalid_argument);
   BOOST_CHECK_THROW(identity1.setDefaultKey(id2Key1Name), std::invalid_argument);
 }
 
diff --git a/tests/unit-tests/security/pib/detail/key-impl.t.cpp b/tests/unit-tests/security/pib/detail/key-impl.t.cpp
index 5257113..ec51751 100644
--- a/tests/unit-tests/security/pib/detail/key-impl.t.cpp
+++ b/tests/unit-tests/security/pib/detail/key-impl.t.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -36,14 +36,14 @@
 BOOST_AUTO_TEST_SUITE(Security)
 BOOST_AUTO_TEST_SUITE(Pib)
 BOOST_AUTO_TEST_SUITE(Detail)
-BOOST_FIXTURE_TEST_SUITE(TestKeyImpl, ndn::security::tests::PibDataFixture)
+BOOST_FIXTURE_TEST_SUITE(TestKeyImpl, security::tests::PibDataFixture)
 
 using security::Pib;
 
 BOOST_AUTO_TEST_CASE(Basic)
 {
   auto pibImpl = make_shared<pib::PibMemory>();
-  KeyImpl key11(id1Key1Name, id1Key1.buf(), id1Key1.size(), pibImpl);
+  KeyImpl key11(id1Key1Name, id1Key1.data(), id1Key1.size(), pibImpl);
 
   BOOST_CHECK_EQUAL(key11.getName(), id1Key1Name);
   BOOST_CHECK_EQUAL(key11.getIdentity(), id1);
@@ -60,7 +60,7 @@
 BOOST_AUTO_TEST_CASE(CertificateOperation)
 {
   auto pibImpl = make_shared<pib::PibMemory>();
-  KeyImpl key11(id1Key1Name, id1Key1.buf(), id1Key1.size(), pibImpl);
+  KeyImpl key11(id1Key1Name, id1Key1.data(), id1Key1.size(), pibImpl);
   BOOST_CHECK_NO_THROW(KeyImpl(id1Key1Name, pibImpl));
 
   // key does not have any certificate
@@ -141,10 +141,10 @@
   auto pibImpl = make_shared<pib::PibMemory>();
 
   BOOST_CHECK_THROW(KeyImpl(id1Key1Name, pibImpl), Pib::Error);
-  KeyImpl(id1Key1Name, id1Key1.buf(), id1Key1.size(), pibImpl);
+  KeyImpl(id1Key1Name, id1Key1.data(), id1Key1.size(), pibImpl);
   KeyImpl key1(id1Key1Name, pibImpl);
 
-  KeyImpl(id1Key1Name, id1Key2.buf(), id1Key2.size(), pibImpl); // overwriting of the key should work
+  KeyImpl(id1Key1Name, id1Key2.data(), id1Key2.size(), pibImpl); // overwriting of the key should work
   KeyImpl key2(id1Key1Name, pibImpl);
 
   BOOST_CHECK(key1.getPublicKey() != key2.getPublicKey()); // key1 cached the original public key
@@ -173,12 +173,12 @@
   auto pibImpl = make_shared<pib::PibMemory>();
 
   BOOST_CHECK_THROW(KeyImpl(id1Key1Name, pibImpl), Pib::Error);
-  KeyImpl key11(id1Key1Name, id1Key1.buf(), id1Key1.size(), pibImpl);
+  KeyImpl key11(id1Key1Name, id1Key1.data(), id1Key1.size(), pibImpl);
 
   BOOST_CHECK_THROW(KeyImpl(Name("/wrong"), pibImpl), std::invalid_argument);
-  BOOST_CHECK_THROW(KeyImpl(Name("/wrong"), id1Key1.buf(), id1Key1.size(), pibImpl), std::invalid_argument);
+  BOOST_CHECK_THROW(KeyImpl(Name("/wrong"), id1Key1.data(), id1Key1.size(), pibImpl), std::invalid_argument);
   Buffer wrongKey;
-  BOOST_CHECK_THROW(KeyImpl(id1Key2Name, wrongKey.buf(), wrongKey.size(), pibImpl), std::invalid_argument);
+  BOOST_CHECK_THROW(KeyImpl(id1Key2Name, wrongKey.data(), wrongKey.size(), pibImpl), std::invalid_argument);
 
   key11.addCertificate(id1Key1Cert1);
   BOOST_CHECK_THROW(key11.addCertificate(id1Key2Cert1), std::invalid_argument);
diff --git a/tests/unit-tests/security/pib/identity.t.cpp b/tests/unit-tests/security/pib/identity.t.cpp
index 239da12..6f631e5 100644
--- a/tests/unit-tests/security/pib/identity.t.cpp
+++ b/tests/unit-tests/security/pib/identity.t.cpp
@@ -82,12 +82,12 @@
   BOOST_CHECK_NE(identity1, Identity());
   BOOST_CHECK_EQUAL(Identity(), Identity());
 
-  identity1.addKey(id1Key1.buf(), id1Key1.size(), id1Key1Name);
+  identity1.addKey(id1Key1.data(), id1Key1.size(), id1Key1Name);
   BOOST_CHECK_NO_THROW(identity2.getKey(id1Key1Name));
   identity2.removeKey(id1Key1Name);
   BOOST_CHECK_THROW(identity1.getKey(id1Key1Name), Pib::Error);
 
-  identity1.setDefaultKey(id1Key1.buf(), id1Key1.size(), id1Key1Name);
+  identity1.setDefaultKey(id1Key1.data(), id1Key1.size(), id1Key1Name);
   BOOST_CHECK_NO_THROW(identity2.getDefaultKey());
 }
 
diff --git a/tests/unit-tests/security/pib/key-container.t.cpp b/tests/unit-tests/security/pib/key-container.t.cpp
index 5b7961e..c04a415 100644
--- a/tests/unit-tests/security/pib/key-container.t.cpp
+++ b/tests/unit-tests/security/pib/key-container.t.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -49,7 +49,7 @@
   BOOST_CHECK_EQUAL(container.getLoadedKeys().size(), 0);
 
   // add the first key
-  Key key11 = container.add(id1Key1.buf(), id1Key1.size(), id1Key1Name);
+  Key key11 = container.add(id1Key1.data(), id1Key1.size(), id1Key1Name);
   BOOST_CHECK_EQUAL(key11.getName(), id1Key1Name);
   BOOST_CHECK(key11.getPublicKey() == id1Key1);
   BOOST_CHECK_EQUAL(container.size(), 1);
@@ -57,7 +57,7 @@
   BOOST_CHECK(container.find(id1Key1Name) != container.end());
 
   // add the same key again
-  Key key12 = container.add(id1Key1.buf(), id1Key1.size(), id1Key1Name);
+  Key key12 = container.add(id1Key1.data(), id1Key1.size(), id1Key1Name);
   BOOST_CHECK_EQUAL(key12.getName(), id1Key1Name);
   BOOST_CHECK(key12.getPublicKey() == id1Key1);
   BOOST_CHECK_EQUAL(container.size(), 1);
@@ -65,7 +65,7 @@
   BOOST_CHECK(container.find(id1Key1Name) != container.end());
 
   // add the second key
-  Key key21 = container.add(id1Key2.buf(), id1Key2.size(), id1Key2Name);
+  Key key21 = container.add(id1Key2.data(), id1Key2.size(), id1Key2Name);
   BOOST_CHECK_EQUAL(key21.getName(), id1Key2Name);
   BOOST_CHECK(key21.getPublicKey() == id1Key2);
   BOOST_CHECK_EQUAL(container.size(), 2);
@@ -122,7 +122,7 @@
 
   KeyContainer container(id1, pibImpl);
 
-  BOOST_CHECK_THROW(container.add(id2Key1.buf(), id2Key1.size(), id2Key1Name), std::invalid_argument);
+  BOOST_CHECK_THROW(container.add(id2Key1.data(), id2Key1.size(), id2Key1Name), std::invalid_argument);
   BOOST_CHECK_THROW(container.remove(id2Key1Name), std::invalid_argument);
   BOOST_CHECK_THROW(container.get(id2Key1Name), std::invalid_argument);
 }
@@ -132,8 +132,8 @@
   auto pibImpl = make_shared<PibMemory>();
   KeyContainer container(id1, pibImpl);
 
-  container.add(id1Key1.buf(), id1Key1.size(), id1Key1Name);
-  container.add(id1Key2.buf(), id1Key2.size(), id1Key2Name);
+  container.add(id1Key1.data(), id1Key1.size(), id1Key1Name);
+  container.add(id1Key2.data(), id1Key2.size(), id1Key2Name);
 
   std::set<Name> keyNames;
   keyNames.insert(id1Key1Name);
diff --git a/tests/unit-tests/security/pib/key.t.cpp b/tests/unit-tests/security/pib/key.t.cpp
index a3543a3..2a90b9c 100644
--- a/tests/unit-tests/security/pib/key.t.cpp
+++ b/tests/unit-tests/security/pib/key.t.cpp
@@ -54,7 +54,8 @@
   else
     BOOST_CHECK(true);
 
-  auto keyImpl = make_shared<KeyImpl>(id1Key1Name, id1Key1.buf(), id1Key1.size(), make_shared<pib::PibMemory>());
+  auto keyImpl = make_shared<KeyImpl>(id1Key1Name, id1Key1.data(), id1Key1.size(),
+                                      make_shared<pib::PibMemory>());
   key = Key(keyImpl);
 
   BOOST_CHECK_EQUAL(static_cast<bool>(key), true);
@@ -76,7 +77,8 @@
 {
   using security::pib::detail::KeyImpl;
 
-  auto keyImpl = make_shared<KeyImpl>(id1Key1Name, id1Key1.buf(), id1Key1.size(), make_shared<pib::PibMemory>());
+  auto keyImpl = make_shared<KeyImpl>(id1Key1Name, id1Key1.data(), id1Key1.size(),
+                                      make_shared<pib::PibMemory>());
   Key key1(keyImpl);
   Key key2(keyImpl);
   BOOST_CHECK_EQUAL(key1, key2);
diff --git a/tests/unit-tests/security/pib/pib-impl.t.cpp b/tests/unit-tests/security/pib/pib-impl.t.cpp
index 2677e9d..265c111 100644
--- a/tests/unit-tests/security/pib/pib-impl.t.cpp
+++ b/tests/unit-tests/security/pib/pib-impl.t.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -165,7 +165,7 @@
   BOOST_CHECK_EQUAL(this->pib.hasIdentity(this->id1), false);
 
   // add id1Key1, should be default, id1 should be added implicitly
-  this->pib.addKey(this->id1, this->id1Key1Name, this->id1Key1.buf(), this->id1Key1.size());
+  this->pib.addKey(this->id1, this->id1Key1Name, this->id1Key1.data(), this->id1Key1.size());
   BOOST_CHECK_EQUAL(this->pib.hasKey(this->id1Key1Name), true);
   BOOST_CHECK_EQUAL(this->pib.hasIdentity(this->id1), true);
   const Buffer& keyBits = this->pib.getKeyBits(this->id1Key1Name);
@@ -174,7 +174,7 @@
   BOOST_CHECK_EQUAL(this->pib.getDefaultKeyOfIdentity(this->id1), this->id1Key1Name);
 
   // add id1Key2, should not be default
-  this->pib.addKey(this->id1, this->id1Key2Name, this->id1Key2.buf(), this->id1Key2.size());
+  this->pib.addKey(this->id1, this->id1Key2Name, this->id1Key2.data(), this->id1Key2.size());
   BOOST_CHECK_EQUAL(this->pib.hasKey(this->id1Key2Name), true);
   BOOST_CHECK_EQUAL(this->pib.getDefaultKeyOfIdentity(this->id1), this->id1Key1Name);
 
@@ -193,7 +193,7 @@
   BOOST_CHECK_THROW(this->pib.getDefaultKeyOfIdentity(this->id1), Pib::Error);
 
   // add id1Key2 back, should be default
-  this->pib.addKey(this->id1, this->id1Key2Name, this->id1Key2.buf(), this->id1Key2.size());
+  this->pib.addKey(this->id1, this->id1Key2Name, this->id1Key2.data(), this->id1Key2.size());
   BOOST_CHECK_NO_THROW(this->pib.getKeyBits(this->id1Key2Name));
   BOOST_CHECK_EQUAL(this->pib.getDefaultKeyOfIdentity(this->id1), this->id1Key2Name);
 
@@ -275,11 +275,11 @@
   this->pib.removeIdentity(this->id1);
   BOOST_CHECK_THROW(this->pib.getDefaultIdentity(), Pib::Error);
 
-  this->pib.addKey(this->id2, this->id2Key1Name, this->id2Key1.buf(), this->id2Key1.size());
+  this->pib.addKey(this->id2, this->id2Key1Name, this->id2Key1.data(), this->id2Key1.size());
   BOOST_CHECK_EQUAL(this->pib.getDefaultIdentity(), this->id2);
   BOOST_CHECK_EQUAL(this->pib.getDefaultKeyOfIdentity(this->id2), this->id2Key1Name);
 
-  this->pib.addKey(this->id2, this->id2Key2Name, this->id2Key2.buf(), this->id2Key2.size());
+  this->pib.addKey(this->id2, this->id2Key2Name, this->id2Key2.data(), this->id2Key2.size());
   BOOST_CHECK_EQUAL(this->pib.getDefaultKeyOfIdentity(this->id2), this->id2Key1Name);
 
   this->pib.removeKey(this->id2Key1Name);
@@ -303,13 +303,13 @@
   BOOST_CHECK_EQUAL(this->pib.hasKey(this->id1Key1Name), false);
 
   // add id1Key1
-  this->pib.addKey(this->id1, this->id1Key1Name, this->id1Key1.buf(), this->id1Key1.size());
+  this->pib.addKey(this->id1, this->id1Key1Name, this->id1Key1.data(), this->id1Key1.size());
   BOOST_CHECK_EQUAL(this->pib.hasKey(this->id1Key1Name), true);
   const Buffer& keyBits = this->pib.getKeyBits(this->id1Key1Name);
   BOOST_CHECK(keyBits == this->id1Key1);
 
   // check overwrite, add a key with the same name.
-  this->pib.addKey(this->id1, this->id1Key1Name, this->id1Key2.buf(), this->id1Key2.size());
+  this->pib.addKey(this->id1, this->id1Key1Name, this->id1Key2.data(), this->id1Key2.size());
   const Buffer& keyBits2 = this->pib.getKeyBits(this->id1Key1Name);
   BOOST_CHECK(keyBits2 == this->id1Key2);
 
@@ -318,7 +318,7 @@
   BOOST_CHECK_EQUAL(this->pib.hasCertificate(this->id1Key1Cert1.getName()), false);
 
   // add id1Key1Cert1
-  this->pib.addKey(this->id1, this->id1Key1Name, this->id1Key1.buf(), this->id1Key1.size());
+  this->pib.addKey(this->id1, this->id1Key1Name, this->id1Key1.data(), this->id1Key1.size());
   this->pib.addCertificate(this->id1Key1Cert1);
   BOOST_CHECK_EQUAL(this->pib.hasCertificate(this->id1Key1Cert1.getName()), true);
 
diff --git a/tests/unit-tests/security/pib/pib.t.cpp b/tests/unit-tests/security/pib/pib.t.cpp
index de436b4..5ae91b5 100644
--- a/tests/unit-tests/security/pib/pib.t.cpp
+++ b/tests/unit-tests/security/pib/pib.t.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -53,7 +53,7 @@
     BOOST_CHECK(false);
 
   // key
-  Key key = id.addKey(id1Key1.buf(), id1Key1.size(), id1Key1Name);
+  Key key = id.addKey(id1Key1.data(), id1Key1.size(), id1Key1Name);
 
   BOOST_CHECK_EQUAL(static_cast<bool>(key), true);
   BOOST_CHECK_EQUAL(!key, false);
diff --git a/tests/unit-tests/security/tpm/back-end.t.cpp b/tests/unit-tests/security/tpm/back-end.t.cpp
index 9f7104d..ad8e39c 100644
--- a/tests/unit-tests/security/tpm/back-end.t.cpp
+++ b/tests/unit-tests/security/tpm/back-end.t.cpp
@@ -101,14 +101,14 @@
 
   transform::PublicKey pubKey;
   ConstBufferPtr pubKeyBits = key->derivePublicKey();
-  pubKey.loadPkcs8(pubKeyBits->buf(), pubKeyBits->size());
+  pubKey.loadPkcs8(pubKeyBits->data(), pubKeyBits->size());
 
   bool result;
   {
     using namespace transform;
-    bufferSource(content, sizeof(content)) >> verifierFilter(DigestAlgorithm::SHA256, pubKey,
-                                                             sigBlock.value(), sigBlock.value_size())
-                                           >> boolSink(result);
+    bufferSource(content, sizeof(content)) >>
+      verifierFilter(DigestAlgorithm::SHA256, pubKey, sigBlock.value(), sigBlock.value_size()) >>
+      boolSink(result);
   }
   BOOST_CHECK_EQUAL(result, true);
 
@@ -131,11 +131,11 @@
 
   transform::PublicKey pubKey;
   ConstBufferPtr pubKeyBits = key->derivePublicKey();
-  pubKey.loadPkcs8(pubKeyBits->buf(), pubKeyBits->size());
+  pubKey.loadPkcs8(pubKeyBits->data(), pubKeyBits->size());
 
   ConstBufferPtr cipherText = pubKey.encrypt(content, sizeof(content));
 
-  ConstBufferPtr plainText = key->decrypt(cipherText->buf(), cipherText->size());
+  ConstBufferPtr plainText = key->decrypt(cipherText->data(), cipherText->size());
 
   BOOST_CHECK_EQUAL_COLLECTIONS(content, content + sizeof(content),
                                 plainText->begin(), plainText->end());
@@ -160,7 +160,7 @@
 
   transform::PublicKey pubKey;
   ConstBufferPtr pubKeyBits = key->derivePublicKey();
-  pubKey.loadPkcs8(pubKeyBits->buf(), pubKeyBits->size());
+  pubKey.loadPkcs8(pubKeyBits->data(), pubKeyBits->size());
 
   bool result;
   {
@@ -219,14 +219,14 @@
   sKey.savePkcs8(os, password.c_str(), password.size());
   ConstBufferPtr privateKeyBuffer = os.buf();
 
-  tpm.importKey(keyName, privateKeyBuffer->buf(), privateKeyBuffer->size(), password.c_str(), password.size());
+  tpm.importKey(keyName, privateKeyBuffer->data(), privateKeyBuffer->size(), password.c_str(), password.size());
   BOOST_CHECK_EQUAL(tpm.hasKey(keyName), true);
 
   ConstBufferPtr exportedKey = tpm.exportKey(keyName, password.c_str(), password.size());
   BOOST_CHECK_EQUAL(tpm.hasKey(keyName), true);
 
   transform::PrivateKey sKey2;
-  sKey2.loadPkcs8(exportedKey->buf(), exportedKey->size(), password.c_str(), password.size());
+  sKey2.loadPkcs8(exportedKey->data(), exportedKey->size(), password.c_str(), password.size());
   OBufferStream os2;
   sKey.savePkcs1Base64(os2);
   ConstBufferPtr pkcs1Buffer = os2.buf();
diff --git a/tests/unit-tests/security/transform/private-key.t.cpp b/tests/unit-tests/security/transform/private-key.t.cpp
index 6a6ba93..76c541f 100644
--- a/tests/unit-tests/security/transform/private-key.t.cpp
+++ b/tests/unit-tests/security/transform/private-key.t.cpp
@@ -143,7 +143,7 @@
 checkPkcs8Encoding(ConstBufferPtr encoding, const std::string& password, ConstBufferPtr pkcs1)
 {
   PrivateKey sKey;
-  sKey.loadPkcs8(encoding->buf(), encoding->size(), password.c_str(), password.size());
+  sKey.loadPkcs8(encoding->data(), encoding->size(), password.c_str(), password.size());
   OBufferStream os;
   sKey.savePkcs1(os);
   BOOST_CHECK_EQUAL_COLLECTIONS(pkcs1->begin(), pkcs1->end(),
@@ -167,7 +167,7 @@
   OBufferStream os;
   bufferSource(sKeyPkcs1Base64, sKeyPkcs1Base64Len) >> base64Decode() >> streamSink(os);
   ConstBufferPtr sKeyPkcs1Buf = os.buf();
-  const uint8_t* sKeyPkcs1 = sKeyPkcs1Buf->buf();
+  const uint8_t* sKeyPkcs1 = sKeyPkcs1Buf->data();
   size_t sKeyPkcs1Len = sKeyPkcs1Buf->size();
 
   // load key in base64-encoded pkcs1 format
@@ -203,7 +203,7 @@
   size_t sKeyPkcs8Base64Len = dataSet.privateKeyPkcs8.size();
   OBufferStream os4;
   bufferSource(sKeyPkcs8Base64, sKeyPkcs8Base64Len) >> base64Decode() >> streamSink(os4);
-  const uint8_t* sKeyPkcs8 = os4.buf()->buf();
+  const uint8_t* sKeyPkcs8 = os4.buf()->data();
   size_t sKeyPkcs8Len = os4.buf()->size();
 
   std::string password("password");
@@ -309,7 +309,7 @@
   OBufferStream os;
   bufferSource(cipherTextBase64) >> base64Decode() >> streamSink(os);
 
-  auto decrypted = sKey.decrypt(os.buf()->buf(), os.buf()->size());
+  auto decrypted = sKey.decrypt(os.buf()->data(), os.buf()->size());
   BOOST_CHECK_EQUAL_COLLECTIONS(plainText, plainText + sizeof(plainText),
                                 decrypted->begin(), decrypted->end());
 }
@@ -331,7 +331,7 @@
   const uint8_t plainText[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
 
   auto cipherText = pKey.encrypt(plainText, sizeof(plainText));
-  auto decrypted = sKey.decrypt(cipherText->buf(), cipherText->size());
+  auto decrypted = sKey.decrypt(cipherText->data(), cipherText->size());
   BOOST_CHECK_EQUAL_COLLECTIONS(plainText, plainText + sizeof(plainText),
                                 decrypted->begin(), decrypted->end());
 }
@@ -348,7 +348,7 @@
   OBufferStream os;
   bufferSource("Y2lhbyFob2xhIWhlbGxvIQ==") >> base64Decode() >> streamSink(os);
 
-  BOOST_CHECK_THROW(sKey.decrypt(os.buf()->buf(), os.buf()->size()), PrivateKey::Error);
+  BOOST_CHECK_THROW(sKey.decrypt(os.buf()->data(), os.buf()->size()), PrivateKey::Error);
 }
 
 using KeyParams = boost::mpl::vector<RsaKeyParams, EcKeyParams>;
@@ -358,7 +358,7 @@
   unique_ptr<PrivateKey> sKey = generatePrivateKey(T());
   PublicKey pKey;
   ConstBufferPtr pKeyBits = sKey->derivePublicKey();
-  pKey.loadPkcs8(pKeyBits->buf(), pKeyBits->size());
+  pKey.loadPkcs8(pKeyBits->data(), pKeyBits->size());
 
   const uint8_t data[] = {0x01, 0x02, 0x03, 0x04};
   OBufferStream os;
@@ -369,7 +369,7 @@
   ConstBufferPtr sig = os.buf();
   bool result = false;
   BOOST_REQUIRE_NO_THROW(bufferSource(data, sizeof(data)) >>
-                         verifierFilter(DigestAlgorithm::SHA256, pKey, sig->buf(), sig->size()) >>
+                         verifierFilter(DigestAlgorithm::SHA256, pKey, sig->data(), sig->size()) >>
                          boolSink(result));
   BOOST_CHECK(result);
 
diff --git a/tests/unit-tests/security/transform/public-key.t.cpp b/tests/unit-tests/security/transform/public-key.t.cpp
index fee246f..20e071c 100644
--- a/tests/unit-tests/security/transform/public-key.t.cpp
+++ b/tests/unit-tests/security/transform/public-key.t.cpp
@@ -73,7 +73,7 @@
   OBufferStream os;
   bufferSource(pKeyPkcs8Base64, pKeyPkcs8Base64Len) >> base64Decode() >> streamSink(os);
   ConstBufferPtr pKeyPkcs8Buf = os.buf();
-  const uint8_t* pKeyPkcs8 = pKeyPkcs8Buf->buf();
+  const uint8_t* pKeyPkcs8 = pKeyPkcs8Buf->data();
   size_t pKeyPkcs8Len = pKeyPkcs8Buf->size();
 
   PublicKey pKey1;
@@ -119,7 +119,7 @@
   OBufferStream os;
   bufferSource("Y2lhbyFob2xhIWhlbGxvIQ==") >> base64Decode() >> streamSink(os);
 
-  BOOST_CHECK_THROW(pKey.encrypt(os.buf()->buf(), os.buf()->size()), PublicKey::Error);
+  BOOST_CHECK_THROW(pKey.encrypt(os.buf()->data(), os.buf()->size()), PublicKey::Error);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestPublicKey
diff --git a/tests/unit-tests/security/transform/signer-filter.t.cpp b/tests/unit-tests/security/transform/signer-filter.t.cpp
index 450f9ff..5db93a7 100644
--- a/tests/unit-tests/security/transform/signer-filter.t.cpp
+++ b/tests/unit-tests/security/transform/signer-filter.t.cpp
@@ -90,7 +90,7 @@
   bufferSource(data, sizeof(data)) >> signerFilter(DigestAlgorithm::SHA256, sKey) >> streamSink(os2);
   auto sig = os2.buf();
 
-  BOOST_CHECK(verifySignature(data, sizeof(data), sig->buf(), sig->size(), pubKey->buf(), pubKey->size()));
+  BOOST_CHECK(verifySignature(data, sizeof(data), sig->data(), sig->size(), pubKey->data(), pubKey->size()));
 }
 
 BOOST_AUTO_TEST_CASE(Ecdsa)
@@ -127,7 +127,7 @@
   bufferSource(data, sizeof(data)) >> signerFilter(DigestAlgorithm::SHA256, sKey) >> streamSink(os2);
   auto sig = os2.buf();
 
-  BOOST_CHECK(verifySignature(data, sizeof(data), sig->buf(), sig->size(), pubKey->buf(), pubKey->size()));
+  BOOST_CHECK(verifySignature(data, sizeof(data), sig->data(), sig->size(), pubKey->data(), pubKey->size()));
 }
 
 BOOST_AUTO_TEST_CASE(InvalidKey)
diff --git a/tests/unit-tests/security/transform/strip-space.t.cpp b/tests/unit-tests/security/transform/strip-space.t.cpp
index bea3191..431aed2 100644
--- a/tests/unit-tests/security/transform/strip-space.t.cpp
+++ b/tests/unit-tests/security/transform/strip-space.t.cpp
@@ -64,7 +64,7 @@
     "velitessecillumdoloreeufugiatnullapariatur.Excepteursintoccaecatcupidatatnonproi"
     "dent,suntinculpaquiofficiadeseruntmollitanimidestlaborum.");
   ConstBufferPtr buf = os.buf();
-  BOOST_CHECK_EQUAL(std::string(reinterpret_cast<const char*>(buf->get()), buf->size()), expected);
+  BOOST_CHECK_EQUAL(std::string(buf->get<char>(), buf->size()), expected);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestStripSpace
diff --git a/tests/unit-tests/security/transform/verifier-filter.t.cpp b/tests/unit-tests/security/transform/verifier-filter.t.cpp
index 217cf87..ae2f2ee 100644
--- a/tests/unit-tests/security/transform/verifier-filter.t.cpp
+++ b/tests/unit-tests/security/transform/verifier-filter.t.cpp
@@ -85,7 +85,7 @@
   auto pubKey = os1.buf();
 
   PublicKey pKey;
-  pKey.loadPkcs8(pubKey->buf(), pubKey->size());
+  pKey.loadPkcs8(pubKey->data(), pubKey->size());
 
   PrivateKey sKey;
   sKey.loadPkcs1Base64(reinterpret_cast<const uint8_t*>(privateKeyPkcs1.data()), privateKeyPkcs1.size());
@@ -94,11 +94,11 @@
   bufferSource(data, sizeof(data)) >> signerFilter(DigestAlgorithm::SHA256, sKey) >> streamSink(os2);
   auto sig = os2.buf();
 
-  BOOST_CHECK_THROW(VerifierFilter(DigestAlgorithm::NONE, pKey, sig->buf(), sig->size()), Error);
+  BOOST_CHECK_THROW(VerifierFilter(DigestAlgorithm::NONE, pKey, sig->data(), sig->size()), Error);
 
   bool result = false;
   bufferSource(data, sizeof(data)) >>
-    verifierFilter(DigestAlgorithm::SHA256, pKey, sig->buf(), sig->size()) >>
+    verifierFilter(DigestAlgorithm::SHA256, pKey, sig->data(), sig->size()) >>
     boolSink(result);
 
   BOOST_CHECK_EQUAL(result, true);
@@ -130,7 +130,7 @@
   auto pubKey = os1.buf();
 
   PublicKey pKey;
-  pKey.loadPkcs8(pubKey->buf(), pubKey->size());
+  pKey.loadPkcs8(pubKey->data(), pubKey->size());
 
   PrivateKey sKey;
   sKey.loadPkcs1Base64(reinterpret_cast<const uint8_t*>(privateKeyPkcs1.data()), privateKeyPkcs1.size());
@@ -139,11 +139,11 @@
   bufferSource(data, sizeof(data)) >> signerFilter(DigestAlgorithm::SHA256, sKey) >> streamSink(os2);
   auto sig = os2.buf();
 
-  BOOST_CHECK_THROW(VerifierFilter(DigestAlgorithm::NONE, pKey, sig->buf(), sig->size()), Error);
+  BOOST_CHECK_THROW(VerifierFilter(DigestAlgorithm::NONE, pKey, sig->data(), sig->size()), Error);
 
   bool result = false;
   bufferSource(data, sizeof(data)) >>
-    verifierFilter(DigestAlgorithm::SHA256, pKey, sig->buf(), sig->size()) >>
+    verifierFilter(DigestAlgorithm::SHA256, pKey, sig->data(), sig->size()) >>
     boolSink(result);
 
   BOOST_CHECK_EQUAL(result, true);
diff --git a/tests/unit-tests/security/v2/validator.t.cpp b/tests/unit-tests/security/v2/validator.t.cpp
index 9945ef9..ac5ca86 100644
--- a/tests/unit-tests/security/v2/validator.t.cpp
+++ b/tests/unit-tests/security/v2/validator.t.cpp
@@ -275,7 +275,7 @@
     certificate.setFreshnessPeriod(time::hours(1));
 
     // set content
-    certificate.setContent(requestedKey.getPublicKey().buf(), requestedKey.getPublicKey().size());
+    certificate.setContent(requestedKey.getPublicKey().data(), requestedKey.getPublicKey().size());
 
     // set signature-info
     SignatureInfo info;
diff --git a/tests/unit-tests/security/verification-helpers.t.cpp b/tests/unit-tests/security/verification-helpers.t.cpp
index d1654d7..41aed81 100644
--- a/tests/unit-tests/security/verification-helpers.t.cpp
+++ b/tests/unit-tests/security/verification-helpers.t.cpp
@@ -430,24 +430,24 @@
   v2::Certificate cert(Block(dataset.cert.data(), dataset.cert.size()));
   Buffer keyRaw = cert.getPublicKey();
   v2::PublicKey key;
-  key.loadPkcs8(keyRaw.buf(), keyRaw.size());
+  key.loadPkcs8(keyRaw.data(), keyRaw.size());
   Data data(Block(dataset.goodData.data(), dataset.goodData.size()));
   Data badSigData(Block(dataset.badSigData.data(), dataset.badSigData.size()));
   Interest interest(Block(dataset.goodInterest.data(), dataset.goodInterest.size()));
   Interest badSigInterest(Block(dataset.badSigInterest.data(), dataset.badSigInterest.size()));
 
   BOOST_CHECK(verifySignature(data, key));
-  BOOST_CHECK(verifySignature(data, keyRaw.buf(), keyRaw.size()));
+  BOOST_CHECK(verifySignature(data, keyRaw.data(), keyRaw.size()));
   BOOST_CHECK(verifySignature(data, cert));
   BOOST_CHECK(verifySignature(interest, key));
-  BOOST_CHECK(verifySignature(interest, keyRaw.buf(), keyRaw.size()));
+  BOOST_CHECK(verifySignature(interest, keyRaw.data(), keyRaw.size()));
   BOOST_CHECK(verifySignature(interest, cert));
 
   BOOST_CHECK(!verifySignature(badSigData, key));
-  BOOST_CHECK(!verifySignature(badSigData, keyRaw.buf(), keyRaw.size()));
+  BOOST_CHECK(!verifySignature(badSigData, keyRaw.data(), keyRaw.size()));
   BOOST_CHECK(!verifySignature(badSigData, cert));
   BOOST_CHECK(!verifySignature(badSigInterest, key));
-  BOOST_CHECK(!verifySignature(badSigInterest, keyRaw.buf(), keyRaw.size()));
+  BOOST_CHECK(!verifySignature(badSigInterest, keyRaw.data(), keyRaw.size()));
   BOOST_CHECK(!verifySignature(badSigInterest, cert));
 
   Data unsignedData("/some/data");
diff --git a/tests/unit-tests/util/segment-fetcher.t.cpp b/tests/unit-tests/util/segment-fetcher.t.cpp
index d80f1ae..dfc2cd8 100644
--- a/tests/unit-tests/util/segment-fetcher.t.cpp
+++ b/tests/unit-tests/util/segment-fetcher.t.cpp
@@ -20,9 +20,9 @@
  */
 
 #include "util/segment-fetcher.hpp"
+
 #include "data.hpp"
-#include "encoding/block.hpp"
-#include "lp/nack-header.hpp"
+#include "lp/nack.hpp"
 #include "util/dummy-client-face.hpp"
 
 #include "boost-test.hpp"
@@ -44,26 +44,21 @@
 public:
   Fixture()
     : face(io, m_keyChain)
-    , nErrors(0)
-    , nData(0)
-    , dataSize(0)
   {
   }
 
-  shared_ptr<Data>
+  static shared_ptr<Data>
   makeDataSegment(const Name& baseName, uint64_t segment, bool isFinal)
   {
     const uint8_t buffer[] = "Hello, world!";
 
     auto data = make_shared<Data>(Name(baseName).appendSegment(segment));
     data->setContent(buffer, sizeof(buffer));
-
     if (isFinal) {
       data->setFinalBlockId(data->getName()[-1]);
     }
-    data = signData(data);
 
-    return data;
+    return signData(data);
   }
 
   void
@@ -78,7 +73,7 @@
   {
     ++nData;
     dataSize = data->size();
-    dataString = std::string(reinterpret_cast<const char*>(data->get()));
+    dataString = std::string(data->get<char>());
   }
 
   void
@@ -93,10 +88,10 @@
 public:
   DummyClientFace face;
 
-  uint32_t nErrors;
-  uint32_t lastError;
-  uint32_t nData;
-  size_t dataSize;
+  uint32_t nErrors = 0;
+  uint32_t lastError = 0;
+  uint32_t nData = 0;
+  size_t dataSize = 0;
   std::string dataString;
 };
 
@@ -148,7 +143,7 @@
   BOOST_CHECK_EQUAL(dataSize, 14);
 
   const uint8_t buffer[] = "Hello, world!";
-  std::string bufferString = std::string(reinterpret_cast<const char*>(buffer));
+  std::string bufferString(reinterpret_cast<const char*>(buffer));
 
   BOOST_CHECK_EQUAL(dataString, bufferString);
 
@@ -172,9 +167,7 @@
   advanceClocks(time::milliseconds(10));
 
   const uint8_t buffer[] = "Hello, world!";
-
-  shared_ptr<Data> data = makeData("/hello/world/version0/no-segment");
-
+  auto data = makeData("/hello/world/version0/no-segment");
   data->setContent(buffer, sizeof(buffer));
 
   face.receive(*data);
diff --git a/tests/unit-tests/util/sha256.t.cpp b/tests/unit-tests/util/sha256.t.cpp
index 2fec00f..5775785 100644
--- a/tests/unit-tests/util/sha256.t.cpp
+++ b/tests/unit-tests/util/sha256.t.cpp
@@ -48,8 +48,8 @@
   statefulSha256.update(input + 3, 1);
   ConstBufferPtr digest = statefulSha256.computeDigest();
   BOOST_CHECK_EQUAL(digest->size(), Sha256::DIGEST_SIZE);
-  BOOST_CHECK_EQUAL_COLLECTIONS(expected->buf(), expected->buf() + expected->size(),
-                                digest->buf(), digest->buf() + digest->size());
+  BOOST_CHECK_EQUAL_COLLECTIONS(expected->data(), expected->data() + expected->size(),
+                                digest->data(), digest->data() + digest->size());
 }
 
 BOOST_AUTO_TEST_CASE(ConstructFromStream)
@@ -63,8 +63,8 @@
   BOOST_CHECK_EQUAL(sha.toString(), "315F5BDB76D078C43B8AC0064E4A0164612B1FCE77C869345BFC94C75894EDD3");
 
   ConstBufferPtr digest = sha.computeDigest();
-  BOOST_CHECK_EQUAL_COLLECTIONS(expected->buf(), expected->buf() + expected->size(),
-                                digest->buf(), digest->buf() + digest->size());
+  BOOST_CHECK_EQUAL_COLLECTIONS(expected->data(), expected->data() + expected->size(),
+                                digest->data(), digest->data() + digest->size());
 }
 
 BOOST_AUTO_TEST_CASE(Compare)
@@ -98,8 +98,8 @@
   ConstBufferPtr digest = statefulSha256.computeDigest();
 
   BOOST_CHECK_EQUAL(statefulSha256.empty(), false);
-  BOOST_CHECK_EQUAL_COLLECTIONS(expected->buf(), expected->buf() + expected->size(),
-                                digest->buf(), digest->buf() + digest->size());
+  BOOST_CHECK_EQUAL_COLLECTIONS(expected->data(), expected->data() + expected->size(),
+                                digest->data(), digest->data() + digest->size());
 }
 
 BOOST_AUTO_TEST_CASE(InsertionOperatorString)
@@ -112,8 +112,8 @@
   ConstBufferPtr digest = statefulSha256.computeDigest();
 
   BOOST_CHECK_EQUAL(statefulSha256.empty(), false);
-  BOOST_CHECK_EQUAL_COLLECTIONS(expected->buf(), expected->buf() + expected->size(),
-                                digest->buf(), digest->buf() + digest->size());
+  BOOST_CHECK_EQUAL_COLLECTIONS(expected->data(), expected->data() + expected->size(),
+                                digest->data(), digest->data() + digest->size());
 }
 
 BOOST_AUTO_TEST_CASE(InsertionOperatorBlock)
@@ -138,8 +138,8 @@
   ConstBufferPtr digest = statefulSha256.computeDigest();
 
   BOOST_CHECK_EQUAL(statefulSha256.empty(), false);
-  BOOST_CHECK_EQUAL_COLLECTIONS(expected->buf(), expected->buf() + expected->size(),
-                                digest->buf(), digest->buf() + digest->size());
+  BOOST_CHECK_EQUAL_COLLECTIONS(expected->data(), expected->data() + expected->size(),
+                                digest->data(), digest->data() + digest->size());
 }
 
 BOOST_AUTO_TEST_CASE(InsertionOperatorUint64t)
@@ -154,8 +154,8 @@
   ConstBufferPtr digest = statefulSha256.computeDigest();
 
   BOOST_CHECK_EQUAL(statefulSha256.empty(), false);
-  BOOST_CHECK_EQUAL_COLLECTIONS(expected->buf(), expected->buf() + expected->size(),
-                                digest->buf(), digest->buf() + digest->size());
+  BOOST_CHECK_EQUAL_COLLECTIONS(expected->data(), expected->data() + expected->size(),
+                                digest->data(), digest->data() + digest->size());
 }
 
 BOOST_AUTO_TEST_CASE(Reset)
@@ -186,8 +186,8 @@
   auto expected = fromHex("9f64a747e1b97f131fabb6b447296c9b6f0201e79fb3c5356e6c77e89b6a806a");
 
   ConstBufferPtr digest = Sha256::computeDigest(input, sizeof(input));
-  BOOST_CHECK_EQUAL_COLLECTIONS(expected->buf(), expected->buf() + expected->size(),
-                                digest->buf(), digest->buf() + digest->size());
+  BOOST_CHECK_EQUAL_COLLECTIONS(expected->data(), expected->data() + expected->size(),
+                                digest->data(), digest->data() + digest->size());
 }
 
 BOOST_AUTO_TEST_CASE(Print)
diff --git a/tools/ndnsec/cert-gen.cpp b/tools/ndnsec/cert-gen.cpp
index f63a2ea..dbab9cb 100644
--- a/tools/ndnsec/cert-gen.cpp
+++ b/tools/ndnsec/cert-gen.cpp
@@ -136,7 +136,7 @@
   try {
     Buffer keyContent = certRequest.getPublicKey();
     t::PublicKey pubKey;
-    pubKey.loadPkcs8(keyContent.buf(), keyContent.size());
+    pubKey.loadPkcs8(keyContent.data(), keyContent.size());
   }
   catch (const std::exception& e) {
     std::cerr << "ERROR: " << e.what() << std::endl;
diff --git a/tools/ndnsec/sign-req.cpp b/tools/ndnsec/sign-req.cpp
index da330cf..a03a595 100644
--- a/tools/ndnsec/sign-req.cpp
+++ b/tools/ndnsec/sign-req.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -99,7 +99,7 @@
   certificate.setFreshnessPeriod(time::hours(1));
 
   // set content
-  certificate.setContent(key.getPublicKey().buf(), key.getPublicKey().size());
+  certificate.setContent(key.getPublicKey().data(), key.getPublicKey().size());
 
   // set signature-info
   SignatureInfo signatureInfo;
