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/src/security/pib/key-container.cpp b/src/security/pib/key-container.cpp
index ca30ab9..7653955 100644
--- a/src/security/pib/key-container.cpp
+++ b/src/security/pib/key-container.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).
  *
@@ -24,9 +24,10 @@
 
 namespace ndn {
 namespace security {
+namespace pib {
 
 KeyContainer::const_iterator::const_iterator(const Name& identity,
-                                             std::set<name::Component>::const_iterator it,
+                                             std::set<Name>::const_iterator it,
                                              shared_ptr<PibImpl> impl)
   : m_identity(identity)
   , m_it(it)
@@ -37,7 +38,7 @@
 Key
 KeyContainer::const_iterator::operator*()
 {
-  return Key(m_identity, *m_it, m_impl);
+  return Key(*m_it, m_impl);
 }
 
 KeyContainer::const_iterator&
@@ -71,11 +72,9 @@
 {
 }
 
-KeyContainer::KeyContainer(const Name& identity,
-                           std::set<name::Component>&& keyIds,
-                           shared_ptr<PibImpl> impl)
+KeyContainer::KeyContainer(const Name& identity, std::set<Name>&& keyNames, shared_ptr<PibImpl> impl)
   : m_identity(identity)
-  , m_keyIds(keyIds)
+  , m_keyNames(keyNames)
   , m_impl(impl)
 {
 }
@@ -83,26 +82,27 @@
 KeyContainer::const_iterator
 KeyContainer::begin() const
 {
-  return const_iterator(m_identity, m_keyIds.begin(), m_impl);
+  return const_iterator(m_identity, m_keyNames.begin(), m_impl);
 }
 
 KeyContainer::const_iterator
 KeyContainer::end() const
 {
-  return const_iterator(m_identity, m_keyIds.end(), m_impl);
+  return const_iterator(m_identity, m_keyNames.end(), m_impl);
 }
 
 KeyContainer::const_iterator
-KeyContainer::find(const name::Component& keyId) const
+KeyContainer::find(const Name& keyName) const
 {
-  return const_iterator(m_identity, m_keyIds.find(keyId), m_impl);
+  return const_iterator(m_identity, m_keyNames.find(keyName), m_impl);
 }
 
 size_t
 KeyContainer::size() const
 {
-  return m_keyIds.size();
+  return m_keyNames.size();
 }
 
+} // namespace pib
 } // namespace security
 } // namespace ndn