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.hpp b/src/security/pib/key-container.hpp
index 7d88da9..a593132 100644
--- a/src/security/pib/key-container.hpp
+++ b/src/security/pib/key-container.hpp
@@ -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,6 +27,7 @@
 
 namespace ndn {
 namespace security {
+namespace pib {
 
 class PibImpl;
 
@@ -37,9 +38,6 @@
   class const_iterator
   {
   public:
-    friend class KeyContainer;
-
-  public:
     Key
     operator*();
 
@@ -56,14 +54,14 @@
     operator!=(const const_iterator& other);
 
   private:
-    const_iterator(const Name& identity,
-                   std::set<name::Component>::const_iterator it,
-                   shared_ptr<PibImpl> impl);
+    const_iterator(const Name& identity, std::set<Name>::const_iterator it, shared_ptr<PibImpl> impl);
 
   private:
     Name m_identity;
-    std::set<name::Component>::const_iterator m_it;
+    std::set<Name>::const_iterator m_it;
     shared_ptr<PibImpl> m_impl;
+
+    friend class KeyContainer;
   };
 
   typedef const_iterator iterator;
@@ -71,9 +69,7 @@
 public:
   KeyContainer();
 
-  KeyContainer(const Name& identity,
-               std::set<name::Component>&& keyIds,
-               shared_ptr<PibImpl> impl);
+  KeyContainer(const Name& identity, std::set<Name>&& keyNames, shared_ptr<PibImpl> impl);
 
   const_iterator
   begin() const;
@@ -82,17 +78,21 @@
   end() const;
 
   const_iterator
-  find(const name::Component& keyId) const;
+  find(const Name& keyName) const;
 
   size_t
   size() const;
 
 private:
   Name m_identity;
-  std::set<name::Component> m_keyIds;
+  std::set<Name> m_keyNames;
   shared_ptr<PibImpl> m_impl;
 };
 
+} // namespace pib
+
+using pib::KeyContainer;
+
 } // namespace security
 } // namespace ndn