diff --git a/src/contactpanel.cpp b/src/contactpanel.cpp
index e2c8359..4ba7323 100644
--- a/src/contactpanel.cpp
+++ b/src/contactpanel.cpp
@@ -18,62 +18,96 @@
 #include <QDir>
 
 #ifndef Q_MOC_RUN
+#include <ndn.cxx/security/keychain.h>
+#include <ndn.cxx/security/identity/osx-privatekey-storage.h>
+#include <ndn.cxx/security/identity/identity-manager.h>
+#include <ndn.cxx/security/identity/basic-identity-storage.h>
+#include <ndn.cxx/security/cache/ttl-certificate-cache.h>
+#include <ndn.cxx/security/encryption/basic-encryption-manager.h>
 #include <ndn.cxx/common.h>
 #include <boost/filesystem.hpp>
+#include <boost/random/random_device.hpp>
+#include <boost/random/uniform_int_distribution.hpp>
+#include "invitation-policy-manager.h"
 #include "logging.h"
 #include "exception.h"
 #endif
 
 namespace fs = boost::filesystem;
 using namespace ndn;
+
 using namespace std;
 
 INIT_LOGGER("ContactPanel");
 
+Q_DECLARE_METATYPE(ndn::security::IdentityCertificate)
+
 ContactPanel::ContactPanel(Ptr<ContactManager> contactManager, QWidget *parent) 
     : QDialog(parent)
     , ui(new Ui::ContactPanel)
     , m_contactManager(contactManager)
     , m_contactListModel(new QStringListModel)
+    , m_profileEditor(new ProfileEditor(m_contactManager))
     , m_addContactPanel(new AddContactPanel(contactManager))
     , m_setAliasDialog(new SetAliasDialog(contactManager))
     , m_startChatDialog(new StartChatDialog)
+    , m_invitationDialog(new InvitationDialog)
+    , m_settingDialog(new SettingDialog)
     , m_menuInvite(new QAction("&Chat", this))
     , m_menuAlias(new QAction("&Set Alias", this))
 {
+  qRegisterMetaType<ndn::security::IdentityCertificate>("IdentityCertificate");
   
-    ui->setupUi(this);
+   ui->setupUi(this);
+   refreshContactList();
 
-    QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
-    QString path = (QDir::home().path());
-    path.append(QDir::separator()).append(".chronos").append(QDir::separator()).append("chronos.db");
-    db.setDatabaseName(path);
-    bool ok = db.open();
+   openDB();    
 
-    m_profileEditor = new ProfileEditor(m_contactManager);
+   setKeychain();
+   m_handler = Ptr<Wrapper>(new Wrapper(m_keychain));
+   
+   setLocalPrefix();
+    
+   // Set Identity, TODO: through user interface
+   m_defaultIdentity = m_keychain->getDefaultIdentity();
+   m_settingDialog->setIdentity(m_defaultIdentity.toUri());
+   setInvitationListener();
 
-    refreshContactList();
-    ui->ContactList->setModel(m_contactListModel);
+   ui->ContactList->setModel(m_contactListModel);
 
-    QItemSelectionModel* selectionModel = ui->ContactList->selectionModel();
+   QItemSelectionModel* selectionModel = ui->ContactList->selectionModel();
 
-    connect(selectionModel, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
-	    this, SLOT(updateSelection(const QItemSelection &, const QItemSelection &)));
-    connect(ui->ContactList, SIGNAL(customContextMenuRequested(const QPoint&)),
-            this, SLOT(showContextMenu(const QPoint&)));
-    connect(ui->EditProfileButton, SIGNAL(clicked()), 
-            this, SLOT(openProfileEditor()));
+   connect(selectionModel, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
+           this, SLOT(updateSelection(const QItemSelection &, const QItemSelection &)));
 
-    connect(ui->AddContactButton, SIGNAL(clicked()),
-            this, SLOT(openAddContactPanel()));
+   connect(ui->ContactList, SIGNAL(customContextMenuRequested(const QPoint&)),
+           this, SLOT(showContextMenu(const QPoint&)));
 
-    connect(m_addContactPanel, SIGNAL(newContactAdded()),
-            this, SLOT(refreshContactList()));
-    connect(m_setAliasDialog, SIGNAL(aliasChanged()),
-            this, SLOT(refreshContactList()));
+   connect(ui->EditProfileButton, SIGNAL(clicked()), 
+           this, SLOT(openProfileEditor()));
 
-    connect(m_startChatDialog, SIGNAL(chatroomConfirmed(const QString&, const QString&, bool)),
-            this, SLOT(startChatroom(const QString&, const QString&, bool)));
+   connect(ui->AddContactButton, SIGNAL(clicked()),
+           this, SLOT(openAddContactPanel()));
+   
+   connect(ui->settingButton, SIGNAL(clicked()),
+           this, SLOT(openSettingDialog()));
+   
+   connect(m_addContactPanel, SIGNAL(newContactAdded()),
+           this, SLOT(refreshContactList()));
+
+   connect(m_setAliasDialog, SIGNAL(aliasChanged()),
+           this, SLOT(refreshContactList()));
+
+   connect(m_startChatDialog, SIGNAL(chatroomConfirmed(const QString&, const QString&, bool)),
+           this, SLOT(startChatroom(const QString&, const QString&, bool)));
+
+   connect(m_invitationDialog, SIGNAL(invitationAccepted(const ndn::Name&, const ndn::security::IdentityCertificate&, QString, QString)),
+           this, SLOT(acceptInvitation(const ndn::Name&, const ndn::security::IdentityCertificate&, QString, QString)));
+   connect(m_invitationDialog, SIGNAL(invitationRejected(const ndn::Name&)),
+           this, SLOT(rejectInvitation(const ndn::Name&)));
+
+   connect(m_settingDialog, SIGNAL(identitySet(const QString&)),
+           this, SLOT(updateDefaultIdentity(const QString&)));
 
 
 
@@ -90,6 +124,204 @@
 }
 
 void
+ContactPanel::openDB()
+{
+  QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
+  QString path = (QDir::home().path());
+  path.append(QDir::separator()).append(".chronos").append(QDir::separator()).append("chronos.db");
+  db.setDatabaseName(path);
+  bool ok = db.open();
+}
+
+void 
+ContactPanel::setKeychain()
+{
+  Ptr<security::OSXPrivatekeyStorage> privateStorage = Ptr<security::OSXPrivatekeyStorage>::Create();
+  Ptr<security::IdentityManager> identityManager = Ptr<security::IdentityManager>(new security::IdentityManager(Ptr<security::BasicIdentityStorage>::Create(), privateStorage));
+  Ptr<security::CertificateCache> certificateCache = Ptr<security::CertificateCache>(new security::TTLCertificateCache());
+  Ptr<InvitationPolicyManager> policyManager = Ptr<InvitationPolicyManager>(new InvitationPolicyManager(10, certificateCache));
+  Ptr<security::EncryptionManager> encryptionManager = Ptr<security::EncryptionManager>(new security::BasicEncryptionManager(privateStorage, "/tmp/encryption.db"));
+
+  vector<Ptr<ContactItem> >::const_iterator it = m_contactList.begin();
+  for(; it != m_contactList.end(); it++)
+      policyManager->addTrustAnchor((*it)->getSelfEndorseCertificate());
+
+  m_keychain = Ptr<security::Keychain>(new security::Keychain(identityManager, policyManager, encryptionManager));
+}
+
+void
+ContactPanel::setLocalPrefix()
+{
+  Ptr<Interest> interest = Ptr<Interest>(new Interest(Name("/local/ndn/prefix")));
+  interest->setChildSelector(Interest::CHILD_RIGHT);
+  
+  Ptr<Closure> closure = Ptr<Closure>(new Closure(boost::bind(&ContactPanel::onLocalPrefixVerified, 
+                                                              this,
+                                                              _1),
+                                                  boost::bind(&ContactPanel::onLocalPrefixTimeout,
+                                                              this,
+                                                              _1, 
+                                                              _2),
+                                                  boost::bind(&ContactPanel::onLocalPrefixVerified,
+                                                              this,
+                                                              _1)));
+
+  m_handler->sendInterest(interest, closure);
+}
+
+void
+ContactPanel::onLocalPrefixVerified(Ptr<Data> data)
+{
+  string originPrefix(data->content().buf(), data->content().size());
+  string prefix = QString::fromStdString (originPrefix).trimmed ().toUtf8().constData();
+  string randomSuffix = getRandomString();
+  _LOG_DEBUG("prefix: " << prefix);
+  _LOG_DEBUG("randomSuffix: " << randomSuffix);
+  m_localPrefix = Name(prefix);
+}
+
+void
+ContactPanel::onLocalPrefixTimeout(Ptr<Closure> closure, Ptr<Interest> interest)
+{ throw LnException("No local prefix is found!"); }
+
+void
+ContactPanel::onUnverified(Ptr<Data> data)
+{}
+
+void
+ContactPanel::onTimeout(Ptr<Closure> closure, Ptr<Interest> interest)
+{}
+
+void
+ContactPanel::onInvitationCertVerified(Ptr<Data> data, 
+                                       const Name& interestName,
+                                       int inviterIndex)
+{
+  Ptr<security::IdentityCertificate> certificate = Ptr<security::IdentityCertificate>(new security::IdentityCertificate(*data));
+
+  const int end = interestName.size();
+
+  string signature = interestName.get(end-1).toBlob();
+  Blob signatureBlob(signature.c_str(), signature.size());
+  string signedName = interestName.getSubName(0, end - 1).toUri();
+  Blob signedBlob(signedName.c_str(), signedName.size());
+
+  if(security::PolicyManager::verifySignature(signedBlob, signatureBlob, certificate->getPublicKeyInfo()))
+    {
+      Name keyName = certificate->getPublicKeyName();
+      Name inviterNameSpace = keyName.getSubName(0, keyName.size() - 1);
+      popChatInvitation(interestName, inviterIndex, inviterNameSpace, certificate);
+    }
+}
+
+void
+ContactPanel::popChatInvitation(const Name& interestName,
+                                int inviterIndex,
+                                const Name& inviterNameSpace,
+                                Ptr<security::IdentityCertificate> certificate)
+{
+  string chatroomTag("chatroom");
+  int i = 0;
+  for(; i < inviterIndex; i++)
+    if(interestName.get(i).toUri() == chatroomTag)
+      break;
+  if(i+1 >= inviterIndex)
+    return;
+
+  string chatroom = interestName.get(i+1).toUri();
+  string inviter = inviterNameSpace.toUri();
+  
+  m_invitationDialog->setMsg(inviter, chatroom);
+  m_invitationDialog->setIdentityCertificate(certificate);
+  m_invitationDialog->setInterestName(interestName);
+  m_invitationDialog->show();
+}
+
+static std::string chars("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789");
+
+string
+ContactPanel::getRandomString()
+{
+  string randStr;
+  boost::random::random_device rng;
+  boost::random::uniform_int_distribution<> index_dist(0, chars.size() - 1);
+  for (int i = 0; i < 10; i ++)
+  {
+    randStr += chars[index_dist(rng)];
+  }
+  return randStr;
+}
+
+
+void
+ContactPanel::setInvitationListener()
+{
+  Name prefix("/ndn/broadcast/chronos/invitation");
+  prefix.append(m_defaultIdentity);
+  m_handler->setInterestFilter (prefix, 
+                                boost::bind(&ContactPanel::onInvitation, 
+                                            this,
+                                            _1));
+
+}
+
+void
+ContactPanel::onInvitation(Ptr<Interest> interest)
+{
+  const Name& interestName = interest->getName();
+  const int end = interestName.size();
+  
+  string inviter("inviter");
+  int j = end-2;
+  for(; j >= 0; j--)
+    if(interestName.get(j).toUri() == inviter)
+      break;
+
+  //No certificate name found
+  if(j < 0)
+    return;
+  
+  Name certName = interestName.getSubName(j+1, end-2-j);
+  string keyString("KEY");
+  string idString("ID-CERT");
+  int m = certName.size() - 1;
+  int keyIndex = -1;
+  int idIndex = -1;
+  for(; m >= 0; m--)
+    if(certName.get(m).toUri() == idString)
+      {
+        idIndex = m;
+        break;
+      }
+
+  for(; m >=0; m--)
+    if(certName.get(m).toUri() == keyString)
+      {
+        keyIndex = m;
+        break;
+      }
+
+  //Not a qualified certificate name 
+  if(keyIndex < 0 && idIndex < 0)
+    return;
+
+  Ptr<Interest> newInterest = Ptr<Interest>(new Interest(certName));
+  Ptr<Closure> closure = Ptr<Closure>(new Closure(boost::bind(&ContactPanel::onInvitationCertVerified, 
+                                                              this,
+                                                              _1,
+                                                              interestName,
+                                                              j),
+                                                  boost::bind(&ContactPanel::onTimeout,
+                                                              this,
+                                                              _1,
+                                                              _2),
+                                                  boost::bind(&ContactPanel::onUnverified,
+                                                              this,
+                                                              _1)));
+  m_handler->sendInterest(newInterest, closure);
+}
+
+void
 ContactPanel::updateSelection(const QItemSelection &selected,
 			      const QItemSelection &deselected)
 {
@@ -117,6 +349,10 @@
 }
 
 void
+ContactPanel::updateDefaultIdentity(const QString& identity)
+{ m_defaultIdentity = Name(identity.toUtf8().constData()); }
+
+void
 ContactPanel::openProfileEditor()
 { m_profileEditor->show(); }
 
@@ -157,6 +393,13 @@
 }
 
 void
+ContactPanel::openSettingDialog()
+{
+  m_settingDialog->setIdentity(m_defaultIdentity.toUri());
+  m_settingDialog->show();
+}
+
+void
 ContactPanel::openStartChatDialog()
 {
   TimeInterval ti = time::NowUnixTimestamp();
@@ -178,6 +421,32 @@
   _LOG_DEBUG("introducer: " << std::boolalpha << isIntroducer);
 }
 
+void
+ContactPanel::startChatroom2(const QString& chatroom, const QString& inviter)
+{
+  _LOG_DEBUG("room: " << chatroom.toUtf8().constData());
+  _LOG_DEBUG("inviter: " << inviter.toUtf8().constData());
+}
+
+void
+ContactPanel::acceptInvitation(const Name& interestName, 
+                               const security::IdentityCertificate& identityCertificate, 
+                               QString inviter, 
+                               QString chatroom)
+{
+  string prefix = m_localPrefix.toUri();
+  m_handler->publishDataByIdentity (interestName, prefix);
+  //TODO:: open chat dialog
+  startChatroom2(chatroom, inviter);
+}
+
+void
+ContactPanel::rejectInvitation(const ndn::Name& interestName)
+{
+  string empty;
+  m_handler->publishDataByIdentity (interestName, empty);
+}
+
 
 #if WAF
 #include "contactpanel.moc"
diff --git a/src/contactpanel.h b/src/contactpanel.h
index dff0e56..9803a6a 100644
--- a/src/contactpanel.h
+++ b/src/contactpanel.h
@@ -20,11 +20,14 @@
 #include "addcontactpanel.h"
 #include "setaliasdialog.h"
 #include "startchatdialog.h"
+#include "invitationdialog.h"
+#include "settingdialog.h"
 
 #ifndef Q_MOC_RUN
 #include "contact-manager.h"
 #endif
 
+
 namespace Ui {
 class ContactPanel;
 }
@@ -35,14 +38,60 @@
 
 public:
   explicit ContactPanel(ndn::Ptr<ContactManager> contactManager, QWidget *parent = 0);
+
   ~ContactPanel();
 
+private:
+  void
+  openDB();
+
+  void
+  setKeychain();
+
+  void
+  setLocalPrefix();
+
+  void
+  onLocalPrefixVerified(ndn::Ptr<ndn::Data> data);
+  
+  void
+  onLocalPrefixTimeout(ndn::Ptr<ndn::Closure> closure, ndn::Ptr<ndn::Interest> interest);
+
+  void
+  onUnverified(ndn::Ptr<ndn::Data> data);
+  
+  void
+  onTimeout(ndn::Ptr<ndn::Closure> closure, ndn::Ptr<ndn::Interest> interest);
+    
+  void
+  setInvitationListener();
+
+  void
+  onInvitation(ndn::Ptr<ndn::Interest> interest);
+
+  void
+  onInvitationCertVerified(ndn::Ptr<ndn::Data> data,
+                           const ndn::Name& interestName,
+                           int inviterIndex);
+
+  std::string
+  getRandomString();
+
+  void
+  popChatInvitation(const ndn::Name& interestName,
+                    int inviterIndex,
+                    const ndn::Name& inviterNameSpace,
+                    ndn::Ptr<ndn::security::IdentityCertificate> certificate);
+
 private slots:
   void
   updateSelection(const QItemSelection &selected,
                   const QItemSelection &deselected);
 
   void
+  updateDefaultIdentity(const QString& identity);
+
+  void
   openProfileEditor();
 
   void
@@ -55,6 +104,9 @@
   openStartChatDialog();
 
   void
+  openSettingDialog();
+
+  void
   refreshContactList();
 
   void
@@ -63,6 +115,18 @@
   void
   startChatroom(const QString& chatroom, const QString& invitee, bool isIntroducer);
 
+  void 
+  startChatroom2(const QString& chatroom, const QString& inviter);
+
+  void
+  acceptInvitation(const ndn::Name& interestName, 
+                   const ndn::security::IdentityCertificate& identityCertificate, 
+                   QString inviter, 
+                   QString chatroom);
+
+  void
+  rejectInvitation(const ndn::Name& interestName);
+
 private:
   Ui::ContactPanel *ui;
   ndn::Ptr<ContactManager> m_contactManager;
@@ -71,14 +135,22 @@
   AddContactPanel* m_addContactPanel;
   SetAliasDialog* m_setAliasDialog;
   StartChatDialog* m_startChatDialog;
+  InvitationDialog* m_invitationDialog;
+  SettingDialog* m_settingDialog;
   QAction* m_menuInvite;
   QAction* m_menuAlias;
-
-
   std::vector<ndn::Ptr<ContactItem> > m_contactList;
 
+  ndn::Ptr<ndn::security::Keychain> m_keychain;
+  ndn::Ptr<ndn::Wrapper> m_handler;
+
+  ndn::Name m_defaultIdentity;
+  ndn::Name m_localPrefix;
+
   std::string m_currentSelectedContactAlias;
   std::string m_currentSelectedContactNamespace;
+
+
 };
 
 #endif // CONTACTPANEL_H
diff --git a/src/contactpanel.ui b/src/contactpanel.ui
index 6819ad0..0e5bbfb 100644
--- a/src/contactpanel.ui
+++ b/src/contactpanel.ui
@@ -253,9 +253,9 @@
      </layout>
     </item>
     <item>
-     <layout class="QHBoxLayout" name="ButtonsLayout" stretch="1,1">
+     <layout class="QHBoxLayout" name="ButtonsLayout" stretch="1,1,1">
       <property name="spacing">
-       <number>100</number>
+       <number>50</number>
       </property>
       <item>
        <widget class="QPushButton" name="AddContactButton">
@@ -265,6 +265,13 @@
        </widget>
       </item>
       <item>
+       <widget class="QPushButton" name="settingButton">
+        <property name="text">
+         <string>Setting</string>
+        </property>
+       </widget>
+      </item>
+      <item>
        <widget class="QPushButton" name="EditProfileButton">
         <property name="text">
          <string>Edit Profile</string>
diff --git a/src/invitation-policy-manager.cpp b/src/invitation-policy-manager.cpp
index 3c87c46..9016eb6 100644
--- a/src/invitation-policy-manager.cpp
+++ b/src/invitation-policy-manager.cpp
@@ -9,6 +9,10 @@
  */
 
 #include "invitation-policy-manager.h"
+
+#include <ndn.cxx/security/certificate/identity-certificate.h>
+#include <boost/bind.hpp>
+
 #include "logging.h"
 
 using namespace std;
@@ -18,19 +22,21 @@
 INIT_LOGGER("InvitationPolicyManager");
 
 InvitationPolicyManager::InvitationPolicyManager(const int & stepLimit,
-						 Ptr<CertificateCache> certificateCache,
-						 Name signingIdentity)
+						 Ptr<CertificateCache> certificateCache)
   : m_stepLimit(stepLimit)
   , m_certificateCache(certificateCache)
   , m_localPrefixRegex(Ptr<Regex>(new Regex("^<local><ndn><prefix><><>$")))
 {
   m_invitationDataRule = Ptr<IdentityPolicyRule>(new IdentityPolicyRule("^<ndn><broadcast><chronos><invitation>([^<chatroom>]*)<chatroom>", 
-									"^([^<KEY>]*)<KEY><DSK-.*><ID-CERT>$", 
+									"^([^<KEY>]*)<KEY><DSK-.*><ID-CERT><>$", 
 									"==", "\\1", "\\1", true));
   
-  m_dskRule = Ptr<IdentityPolicyRule>(new IdentityPolicyRule("^([^<KEY>]*)<KEY><DSK-.*><ID-CERT>$", 
-							     "^([^<KEY>]*)<KEY>(<>*)<KSK-.*><ID-CERT>$", 
+  m_dskRule = Ptr<IdentityPolicyRule>(new IdentityPolicyRule("^([^<KEY>]*)<KEY><DSK-.*><ID-CERT><>$", 
+							     "^([^<KEY>]*)<KEY>(<>*)<KSK-.*><ID-CERT><>$", 
 							     "==", "\\1", "\\1\\2", true));
+
+  m_keyNameRegex = Ptr<Regex>(new Regex("^([^<KEY>]*)<KEY>(<>*<KSK-.*>)<ID-CERT><>$", "\\1\\2"));
+
   m_signingCertificateRegex = Ptr<Regex>(new Regex("^<ndn><broadcast><chronos><invitation>([^<chatroom>]*)<chatroom>", "\\1"));
 }
 
@@ -121,22 +127,22 @@
 
   if(m_dskRule->satisfy(*data))
     {
-      Ptr<IdentityCertificate> trustedCert;
-      if(m_trustAnchors.end() != m_trustAnchors.find(keyLocatorName))
-	trustedCert = m_trustAnchors[keyLocatorName];
-      else
-	{
-	  unverifiedCallback(data);
-	  return NULL;
-	}
+      m_keyNameRegex->match(keyLocatorName);
+      Name keyName = m_keyNameRegex->expand();
 
-      if(verifySignature(*data, trustedCert->getPublicKeyInfo()))
-	verifiedCallback(data);
+      if(m_trustAnchors.end() != m_trustAnchors.find(keyName))
+        if(verifySignature(*data, m_trustAnchors[keyName]))
+          verifiedCallback(data);
+        else
+          unverifiedCallback(data);
       else
-	unverifiedCallback(data);
+        unverifiedCallback(data);
 
       return NULL;	
     }
+
+  unverifiedCallback(data);
+  return NULL;
 }
 
 void 
@@ -151,8 +157,6 @@
     verifiedCallback(originalData);
   else
     unverifiedCallback(originalData);
-
-  return NULL;
 }
 
 void
@@ -170,15 +174,12 @@
 Name 
 InvitationPolicyManager::inferSigningIdentity(const Name & dataName)
 {
-  if(m_signingCertificateRegex->match(data))
+  if(m_signingCertificateRegex->match(dataName))
     return m_signingCertificateRegex->expand();
   else
     return Name();
 }
 
 void
-InvitationPolicyManager::addTrustAnchor(Ptr<IdentityCertificate> ksk)
-{
-  Name name = ksk->getName();    
-  m_cache.insert(pair <Name, Ptr<IdentityCertificate> > (name, ksk));
-}
+InvitationPolicyManager::addTrustAnchor(const EndorseCertificate& selfEndorseCertificate)
+{ m_trustAnchors.insert(pair <Name, Publickey > (selfEndorseCertificate.getPublicKeyName(), selfEndorseCertificate.getPublicKeyInfo())); }
diff --git a/src/invitation-policy-manager.h b/src/invitation-policy-manager.h
index 5684138..7d4b944 100644
--- a/src/invitation-policy-manager.h
+++ b/src/invitation-policy-manager.h
@@ -13,14 +13,16 @@
 
 #include <ndn.cxx/security/policy/policy-manager.h>
 #include <ndn.cxx/security/policy/identity-policy-rule.h>
+#include <ndn.cxx/security/cache/certificate-cache.h>
 #include <map>
 
-class InvitationPolicyManager : ndn::security::PolicyManager
+#include "endorse-certificate.h"
+
+class InvitationPolicyManager : public ndn::security::PolicyManager
 {
 public:
   InvitationPolicyManager(const int & stepLimit,                        
-                          ndn::Ptr<ndn::security::CertificateCache> certificateCache,
-                          ndn::Name signingIdentity);
+                          ndn::Ptr<ndn::security::CertificateCache> certificateCache);
 
   ~InvitationPolicyManager()
   {}
@@ -49,7 +51,7 @@
    * @param unverifiedCallback the callback function that will be called if the received data packet cannot be validated
    * @return the indication of next verification step, NULL if there is no further step
    */
-  Ptr<ValidationRequest>
+  ndn::Ptr<ndn::security::ValidationRequest>
   checkVerificationPolicy(ndn::Ptr<ndn::Data> data, 
                           const int & stepCount, 
                           const ndn::DataCallback& verifiedCallback,
@@ -70,12 +72,12 @@
    * @param dataName, the name of data to be signed
    * @return the signing identity. 
    */
-  Name 
+  ndn::Name 
   inferSigningIdentity(const ndn::Name & dataName);
 
   
   void
-  addTrustAnchor(ndn::Ptr<ndn::security::IdentityCertificate> ksk);
+  addTrustAnchor(const EndorseCertificate& selfEndorseCertificate);
 
 private:
   void 
@@ -93,10 +95,11 @@
   int m_stepLimit;
   ndn::Ptr<ndn::security::CertificateCache> m_certificateCache;
   ndn::Ptr<ndn::Regex> m_localPrefixRegex;
-  ndn::Ptr<ndn::IdentityPolicyRule> m_invitationDataRule;
-  ndn::Ptr<ndn::IdentityPolicyRule> m_dskRule;
+  ndn::Ptr<ndn::security::IdentityPolicyRule> m_invitationDataRule;
+  ndn::Ptr<ndn::security::IdentityPolicyRule> m_dskRule;
+  ndn::Ptr<ndn::Regex> m_keyNameRegex;
   ndn::Ptr<ndn::Regex> m_signingCertificateRegex;
-  std::map<ndn::Name, ndn::Ptr<ndn::security::IdentityCertificate> > m_trustAnchors;
+  std::map<ndn::Name, ndn::security::Publickey> m_trustAnchors;
   
 };
 
diff --git a/src/invitationdialog.cpp b/src/invitationdialog.cpp
index bea2693..f7b2a59 100644
--- a/src/invitationdialog.cpp
+++ b/src/invitationdialog.cpp
@@ -13,6 +13,7 @@
 #include "ui_invitationdialog.h"
 
 using namespace std;
+using namespace ndn;
 
 InvitationDialog::InvitationDialog(QWidget *parent) :
     QDialog(parent),
@@ -29,6 +30,8 @@
 void
 InvitationDialog::setMsg(const string& inviter, const string& chatroom)
 {
+  m_inviter = inviter;
+  m_chatroom = chatroom;
   string msg = inviter;
   msg.append(" invites you to join the chat room: ");
   
@@ -38,7 +41,11 @@
 
 void
 InvitationDialog::onOkClicked()
-{ emit invitationAccepted(m_interestName); }
+{ 
+  QString inviter = QString::fromUtf8(m_inviter.c_str());
+  QString chatroom = QString::fromUtf8(m_chatroom.c_str());
+  emit invitationAccepted(m_interestName, *m_identityCertificate, inviter, chatroom); 
+}
   
 void
 InvitationDialog::onCancelClicked()
@@ -46,6 +53,8 @@
   ui->msgLabel->clear();
   ui->chatroomLine->clear();
   m_interestName = Name();
+  m_inviter.clear();
+  m_chatroom.clear();
   emit invitationRejected(m_interestName); 
 }
 
diff --git a/src/invitationdialog.h b/src/invitationdialog.h
index bcfeaa6..3826ad4 100644
--- a/src/invitationdialog.h
+++ b/src/invitationdialog.h
@@ -13,6 +13,11 @@
 
 #include <QDialog>
 
+#ifndef Q_MOC_RUN
+#include <ndn.cxx/data.h>
+#include <ndn.cxx/security/certificate/identity-certificate.h>
+#endif
+
 namespace Ui {
 class InvitationDialog;
 }
@@ -32,9 +37,16 @@
   setInterestName(const ndn::Name& interestName)
   { m_interestName = interestName; }
 
+  inline void
+  setIdentityCertificate(const ndn::Ptr<ndn::security::IdentityCertificate> identityCertificate)
+  { m_identityCertificate = identityCertificate; }
+
 signals:
   void
-  invitationAccepted(const ndn::Name& interestName);
+  invitationAccepted(const ndn::Name& interestName, 
+                     const ndn::security::IdentityCertificate& identityCertificate, 
+                     QString inviter, 
+                     QString chatroom);
   
   void
   invitationRejected(const ndn::Name& interestName);
@@ -49,7 +61,10 @@
 
 private:
   Ui::InvitationDialog *ui;
+  std::string m_inviter;
+  std::string m_chatroom;
   ndn::Name m_interestName;
+  ndn::Ptr<ndn::security::IdentityCertificate> m_identityCertificate;
 };
 
 #endif // INVITATIONDIALOG_H
diff --git a/src/settingdialog.cpp b/src/settingdialog.cpp
index 291d7e6..a8dca16 100644
--- a/src/settingdialog.cpp
+++ b/src/settingdialog.cpp
@@ -18,6 +18,9 @@
     ui(new Ui::SettingDialog)
 {
     ui->setupUi(this);
+
+    connect(ui->okButton, SIGNAL(clicked()),
+            this, SLOT(onOkClicked()));
 }
 
 SettingDialog::~SettingDialog()
@@ -26,7 +29,7 @@
 }
 
 void
-setIdentity(const std::string& identity)
+SettingDialog::setIdentity(const std::string& identity)
 { 
   m_identity = identity;
   ui->identityLine->setText(QString::fromUtf8(m_identity.c_str()));
@@ -42,6 +45,7 @@
       m_identity = identity;
       emit identitySet(text);
     }
+  this->close();
 }
 
 
