security: tolerate invalid or unsupported public keys in PIB

Change-Id: I3c1dd9d3fe81d0895e2d1706f0b29a8e61940beb
diff --git a/tests/unit/security/pib/key.t.cpp b/tests/unit/security/pib/key.t.cpp
index 8265f01..4d1da0c 100644
--- a/tests/unit/security/pib/key.t.cpp
+++ b/tests/unit/security/pib/key.t.cpp
@@ -39,15 +39,18 @@
   Key key;
   BOOST_TEST(!key);
   BOOST_TEST(key == Key());
+  BOOST_CHECK_THROW(key.getName(), std::domain_error);
 
   auto impl = std::make_shared<detail::KeyImpl>(id1Key1Name, id1Key1,
                                                 makePibWithKey(id1Key1Name, id1Key1));
   key = Key(impl);
   BOOST_TEST(key);
   BOOST_TEST(key != Key());
+  BOOST_TEST(key.getName() == id1Key1Name);
 
   impl.reset();
   BOOST_TEST(!key);
+  BOOST_CHECK_THROW(key.getName(), std::domain_error);
 }
 
 // pib::Key is a wrapper of pib::detail::KeyImpl. Since the functionality of KeyImpl is