security: Adapt PIB to NDN Certificate Format version 2.0

The certificate format can be found at docs/specs/certificate-format.rst

Change-Id: I5656837f09ce327e06a0cb1abdf16ac28fe0b823
Refs: #3202
diff --git a/tests/unit-tests/security/pib/pib.t.cpp b/tests/unit-tests/security/pib/pib.t.cpp
index 7c6b47f..97e8568 100644
--- a/tests/unit-tests/security/pib/pib.t.cpp
+++ b/tests/unit-tests/security/pib/pib.t.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).
  *
@@ -27,12 +27,17 @@
 
 namespace ndn {
 namespace security {
+namespace pib {
 namespace tests {
 
+using namespace ndn::security::tests;
+
 BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(TestPib)
+BOOST_AUTO_TEST_SUITE(Pib)
 BOOST_FIXTURE_TEST_SUITE(Common, PibDataFixture)
 
+using pib::Pib;
+
 BOOST_AUTO_TEST_CASE(ValidityChecking)
 {
   auto pibImpl = make_shared<PibMemory>();
@@ -49,7 +54,7 @@
     BOOST_CHECK(false);
 
   // key
-  Key key = id.addKey(id1Key1, id1Key1Name.get(-1));
+  Key key = id.addKey(id1Key1.buf(), id1Key1.size(), id1Key1Name);
 
   BOOST_CHECK_EQUAL(bool(key), true);
   BOOST_CHECK_EQUAL(!key, false);
@@ -81,9 +86,10 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // Common
-BOOST_AUTO_TEST_SUITE_END() // TestPib
+BOOST_AUTO_TEST_SUITE_END() // Pib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
+} // namespace pib
 } // namespace security
 } // namespace ndn