diff --git a/src/security/key-chain.cpp b/src/security/key-chain.cpp
index 4c7d08f..3a1cbda 100644
--- a/src/security/key-chain.cpp
+++ b/src/security/key-chain.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2014 Regents of the University of California.
+ * Copyright (c) 2013-2015 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -62,35 +62,52 @@
 
 NDN_CXX_KEYCHAIN_REGISTER_TPM(SecTpmFile, "tpm-file", "file");
 
-static std::map<std::string, KeyChain::PibCreateFunc>&
+template<class T>
+struct Factory
+{
+  Factory(const std::string& canonicalName, const T& create)
+    : canonicalName(canonicalName)
+    , create(create)
+  {
+  }
+
+  std::string canonicalName;
+  T create;
+};
+typedef Factory<KeyChain::PibCreateFunc> PibFactory;
+typedef Factory<KeyChain::TpmCreateFunc> TpmFactory;
+
+static std::map<std::string, PibFactory>&
 getPibFactories()
 {
-  static std::map<std::string, KeyChain::PibCreateFunc> pibFactories;
+  static std::map<std::string, PibFactory> pibFactories;
   return pibFactories;
 }
 
-static std::map<std::string, KeyChain::TpmCreateFunc>&
+static std::map<std::string, TpmFactory>&
 getTpmFactories()
 {
-  static std::map<std::string, KeyChain::TpmCreateFunc> tpmFactories;
+  static std::map<std::string, TpmFactory> tpmFactories;
   return tpmFactories;
 }
 
 void
-KeyChain::registerPibImpl(std::initializer_list<std::string> schemes,
+KeyChain::registerPibImpl(const std::string& canonicalName,
+                          std::initializer_list<std::string> aliases,
                           KeyChain::PibCreateFunc createFunc)
 {
-  for (const std::string& scheme : schemes) {
-    getPibFactories()[scheme] = createFunc;
+  for (const std::string& alias : aliases) {
+    getPibFactories().insert(make_pair(alias, PibFactory(canonicalName, createFunc)));
   }
 }
 
 void
-KeyChain::registerTpmImpl(std::initializer_list<std::string> schemes,
+KeyChain::registerTpmImpl(const std::string& canonicalName,
+                          std::initializer_list<std::string> aliases,
                           KeyChain::TpmCreateFunc createFunc)
 {
-  for (const std::string& scheme : schemes) {
-    getTpmFactories()[scheme] = createFunc;
+  for (const std::string& alias : aliases) {
+    getTpmFactories().insert(make_pair(alias, TpmFactory(canonicalName, createFunc)));
   }
 }
 
@@ -157,6 +174,7 @@
   if (pibFactory == getPibFactories().end()) {
     throw Error("PIB scheme '" + pibScheme + "' is not supported");
   }
+  pibScheme = pibFactory->second.canonicalName;
 
   if (tpmScheme.empty()) {
     tpmScheme = DEFAULT_TPM_SCHEME;
@@ -165,9 +183,10 @@
   if (tpmFactory == getTpmFactories().end()) {
     throw Error("TPM scheme '" + tpmScheme + "' is not supported");
   }
+  tpmScheme = tpmFactory->second.canonicalName;
 
   // Create PIB
-  m_pib = pibFactory->second(pibLocation);
+  m_pib = pibFactory->second.create(pibLocation);
 
   std::string actualTpmLocator = tpmScheme + ":" + tpmLocation;
 
@@ -187,7 +206,7 @@
   // wrong one or if the PIB was shared by more than one TPMs before.  This is due to the
   // old PIB does not have TPM info, new pib should not have this problem.
 
-  m_tpm = tpmFactory->second(tpmLocation);
+  m_tpm = tpmFactory->second.create(tpmLocation);
   m_pib->setTpmLocator(actualTpmLocator);
 }
 
diff --git a/src/security/key-chain.hpp b/src/security/key-chain.hpp
index cc45dc3..bdf3514 100644
--- a/src/security/key-chain.hpp
+++ b/src/security/key-chain.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2014 Regents of the University of California.
+ * Copyright (c) 2013-2015 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -72,19 +72,21 @@
 
   /**
    * @brief Register a new PIB
-   * @param schemes List of scheme with which this PIB will be associated
+   * @param aliases List of schemes with which this PIB will be associated.
+   *        The first alias in the list is considered a canonical name of the PIB instance.
    */
   template<class PibType>
   static void
-  registerPib(std::initializer_list<std::string> schemes);
+  registerPib(std::initializer_list<std::string> aliases);
 
   /**
    * @brief Register a new TPM
-   * @param schemes List of scheme with which this TPM will be associated
+   * @param aliases List of schemes with which this TPM will be associated
+   *        The first alias in the list is considered a canonical name of the TPM instance.
    */
   template<class TpmType>
   static void
-  registerTpm(std::initializer_list<std::string> schemes);
+  registerTpm(std::initializer_list<std::string> aliases);
 
   /**
    * @brief Constructor to create KeyChain with default PIB and TPM
@@ -743,10 +745,12 @@
                     const Name& keyName, DigestAlgorithm digestAlgorithm);
 
   static void
-  registerPibImpl(std::initializer_list<std::string> schemes, PibCreateFunc createFunc);
+  registerPibImpl(const std::string& canonicalName,
+                  std::initializer_list<std::string> aliases, PibCreateFunc createFunc);
 
   static void
-  registerTpmImpl(std::initializer_list<std::string> schemes, TpmCreateFunc createFunc);
+  registerTpmImpl(const std::string& canonicalName,
+                  std::initializer_list<std::string> aliases, TpmCreateFunc createFunc);
 
 public:
   static const Name DEFAULT_PREFIX;
@@ -819,18 +823,18 @@
 
 template<class PibType>
 inline void
-KeyChain::registerPib(std::initializer_list<std::string> schemes)
+KeyChain::registerPib(std::initializer_list<std::string> aliases)
 {
-  registerPibImpl(schemes, [] (const std::string& locator) {
+  registerPibImpl(*aliases.begin(), aliases, [] (const std::string& locator) {
       return unique_ptr<SecPublicInfo>(new PibType(locator));
     });
 }
 
 template<class TpmType>
 inline void
-KeyChain::registerTpm(std::initializer_list<std::string> schemes)
+KeyChain::registerTpm(std::initializer_list<std::string> aliases)
 {
-  registerTpmImpl(schemes, [] (const std::string& locator) {
+  registerTpmImpl(*aliases.begin(), aliases, [] (const std::string& locator) {
       return unique_ptr<SecTpm>(new TpmType(locator));
     });
 }
@@ -841,7 +845,7 @@
  * This macro should be placed once in the implementation file of the
  * SecPib type within the namespace where the type is declared.
  */
-#define NDN_CXX_KEYCHAIN_REGISTER_PIB(PibType, ...)  \
+#define NDN_CXX_KEYCHAIN_REGISTER_PIB(PibType, ...)     \
 static class NdnCxxAuto ## PibType ## PibRegistrationClass    \
 {                                                             \
 public:                                                       \
@@ -857,7 +861,7 @@
  * This macro should be placed once in the implementation file of the
  * SecTpm type within the namespace where the type is declared.
  */
-#define NDN_CXX_KEYCHAIN_REGISTER_TPM(TpmType, ...)  \
+#define NDN_CXX_KEYCHAIN_REGISTER_TPM(TpmType, ...)     \
 static class NdnCxxAuto ## TpmType ## TpmRegistrationClass    \
 {                                                             \
 public:                                                       \
