encoding: remove duplicate buf() and get() methods from Buffer class

Change-Id: If885d4199d6c9df9b9b46664c3641c9a14a77eab
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);