diff --git a/src/security/nlsr_cert_store.hpp b/src/security/nlsr_cert_store.hpp
index 5bbef9e..9bd7ca8 100644
--- a/src/security/nlsr_cert_store.hpp
+++ b/src/security/nlsr_cert_store.hpp
@@ -1,6 +1,31 @@
 #ifndef NLSR_CERT_STORE_HPP
 #define NLSR_CERT_STORE_HPP
 
+#include<list>
+#include <ndn-cpp-dev/security/identity-certificate.hpp>
+#include "nlsr_cse.hpp"
 
+namespace nlsr
+{
+    class NlsrCertificateStore
+    {
+        public:
+            NlsrCertificateStore()
+            {}
+            
+            bool addCertificate(NlsrCertificateStoreEntry & ncse);
+            bool addCertificate(ndn::shared_ptr<ndn::IdentityCertificate> pcert
+                                                      , uint32_t csn, bool isv);
+            std::pair<ndn::shared_ptr<ndn::IdentityCertificate>, bool>
+            getCertificateFromStore(const std::string certName);
+            std::pair<ndn::shared_ptr<ndn::IdentityCertificate>, bool>
+            getCertificateFromStore(const std::string certName, int checkSeqNum);
+            bool removeCertificateFromStroe(const std::string certName);
+            bool isCertificateNewInStore(const std::string certName, int checkSeqNo);
+            void printCertStore();
+        private:
+            std::list<NlsrCertificateStoreEntry> certTable;
+    };
+}
 
 #endif
diff --git a/src/security/nlsr_km.cpp b/src/security/nlsr_km.cpp
index 69052eb..e97bbfe 100644
--- a/src/security/nlsr_km.cpp
+++ b/src/security/nlsr_km.cpp
@@ -1,13 +1,21 @@
 #include <ndn-cpp-dev/security/identity-certificate.hpp>
 #include <ndn-cpp-dev/encoding/block.hpp>
+#include <ndn-cpp-dev/util/io.hpp>
+#include <stdexcept>
 #include "nlsr_sm.hpp"
 #include "nlsr_km.hpp"
 
 namespace nlsr
 {
-    void
+    bool
     KeyManager::initKeyManager(ConfParameter &cp)
     {
+        initCertSeqFromFile(cp.getSeqFileDir());
+        if( !loadAllCertificates(cp.getCertDir()) )
+        {
+            return false;
+        }
+        nlsrRootKeyPrefix=cp.getRootKeyPrefix();
         string processIdentityName(cp.getRootKeyPrefix());
         processIdentityName += "/";
         processIdentityName += cp.getSiteName();
@@ -15,25 +23,119 @@
         processIdentityName += "R.Start";
         processIdentityName += "/";
         processIdentityName += cp.getRouterName();
+        ndn::Name ri(processIdentityName);
+        std::cout<<"Router Identity: "<<ri.toUri()<<std::endl;
+        routerIdentity=ri;
         processIdentityName += "/";
         processIdentityName += "nlsr";
         cout<<"Proces Identity Name: "<<processIdentityName<<endl;
         ndn::Name identityName(processIdentityName);
-        routerIdentity=identityName;
-        ndn::KeyChain::deleteIdentity(routerIdentity);
-        routerCertName = ndn::KeyChain::createIdentity(routerIdentity);
-        cout<<"Certificate Name: "<<routerCertName.toUri()<<endl;
-        routerKeyName=
-            ndn::IdentityCertificate::certificateNameToPublicKeyName(routerCertName);
-        cout<<"Key Name: "<<routerKeyName.toUri()<<endl;
-        initCertSeqFromFile(cp.getSeqFileDir());
+        processIdentity=identityName;
+        ndn::KeyChain::deleteIdentity(processIdentity);
+        processCertName = ndn::KeyChain::createIdentity(processIdentity);
+        cout<<"Certificate Name: "<<processCertName.toUri()<<endl;
+        processKeyName=
+            ndn::IdentityCertificate::certificateNameToPublicKeyName(processCertName);
+        cout<<"Key Name: "<<processKeyName.toUri()<<endl;
+        ndn::shared_ptr<ndn::IdentityCertificate> cert=getCertificate(processCertName);
+        signByIdentity(*(cert),routerIdentity);
+        //initCertSeqFromFile(cp.getSeqFileDir());
+        certStore.addCertificate(cert, certSeqNo, true);
+        certStore.printCertStore();
+        
+        return true;
+    }
+    
+    bool 
+    KeyManager::loadAllCertificates(std::string certDirPath)
+    {
+        std::string filePath=certDirPath;
+        if(filePath.empty())
+        {
+            SequencingManager sm;
+            filePath=sm.getUserHomeDirectory();
+            filePath+="/nlsrCertDir";
+        }
+        
+        return loadCertificate(filePath+"/root.cert", KEY_TYPE_ROOT) 
+               && loadCertificate(filePath+"/site.cert", KEY_TYPE_SITE)
+               && loadCertificate(filePath+"/operator.cert", KEY_TYPE_OPERATOR)
+               && loadCertificate(filePath+"/router.cert", KEY_TYPE_ROUTER) ;
+    }
+    
+    bool 
+    KeyManager::loadCertificate(std::string inputFile, nlsrKeyType keyType)
+    {
+        try
+        {
+            ndn::shared_ptr<ndn::IdentityCertificate> cert = 
+             ndn::io::load<ndn::IdentityCertificate>(inputFile, ndn::io::BASE_64);
+            ndn::Name certName=cert->getName();
+            //certStore.addCertificate(cert, 10, true);
+            switch(keyType)
+            {
+                case KEY_TYPE_ROOT:
+                    certStore.addCertificate(cert, 10, true);
+                    rootCertName=certName;
+                    break;
+                case KEY_TYPE_SITE:
+                    certStore.addCertificate(cert, 10, true);
+                    siteCertName=certName;
+                    break;
+                case KEY_TYPE_OPERATOR:
+                    certStore.addCertificate(cert, 10, true);
+                    opCertName=certName;
+                    break;
+                case KEY_TYPE_ROUTER:
+                    certStore.addCertificate(cert, certSeqNo, true);
+                    routerCertName=certName;
+                    break;
+                case KEY_TYPE_PROCESS:
+                    certStore.addCertificate(cert, certSeqNo, true);
+                    processCertName=certName;
+                    break;
+                default:
+                    break;
+            }
+            return true;
+        }
+        catch(std::exception& e)
+        {
+            return false;
+        }
+        
+        return false;
     }
 
     ndn::Name
+    KeyManager::getProcessCertName()
+    {
+        return processCertName;
+    }
+    
+    ndn::Name 
     KeyManager::getRouterCertName()
     {
         return routerCertName;
     }
+    
+    ndn::Name 
+    KeyManager::getOperatorCertName()
+    {
+        return opCertName;
+    }
+    
+    ndn::Name 
+    KeyManager::getSiteCertName()
+    {
+        return siteCertName;
+    }
+    
+    ndn::Name 
+    KeyManager::getRootCertName()
+    {
+        return rootCertName;
+    }
 
     uint32_t
     KeyManager::getCertSeqNo()
@@ -78,6 +180,133 @@
         outputFile<<certSeqNo;
         outputFile.close();
     }
+    
+    bool 
+    KeyManager::isNewCertificate(std::string certName, int checkSeqNum)
+    {
+        return certStore.isCertificateNewInStore(certName,checkSeqNum);
+    }
+    
+    std::pair<ndn::shared_ptr<ndn::IdentityCertificate>, bool>
+    KeyManager::getCertificateFromStore(const std::string certName, int checkSeqNum)
+    {
+        return certStore.getCertificateFromStore(certName, checkSeqNum);
+    }
+    
+    bool 
+    KeyManager::addCertificate(ndn::shared_ptr<ndn::IdentityCertificate> pcert
+                                                      , uint32_t csn, bool isv)
+    {
+        return certStore.addCertificate(pcert, csn, isv);
+    }
+    
+    nlsrKeyType 
+    KeyManager::getKeyTypeFromName(const std::string keyName)
+    {
+        nlsrTokenizer nt(keyName,"/");
+        std::string KEY("KEY");
+        std::string opHandle("O.Start");
+        std::string routerHandle("R.Start");
+        std::string processHandle("nlsr");
+        if ( nt.getTokenString(0,nt.getTokenPosition(KEY)-1) == nlsrRootKeyPrefix)
+        {
+            return KEY_TYPE_ROOT;
+        }
+        else if ( nt.doesTokenExist(opHandle) )
+        {
+            return KEY_TYPE_OPERATOR;
+        }
+        else if ( nt.doesTokenExist(routerHandle) && 
+                                             nt.doesTokenExist(processHandle))
+        {
+            return KEY_TYPE_PROCESS;
+        }
+        else if ( nt.doesTokenExist(routerHandle) && 
+                                             !nt.doesTokenExist(processHandle))
+        {
+            return KEY_TYPE_ROUTER;
+        }
+        else
+        {
+            return KEY_TYPE_SITE;
+        }
+    }
+    
+    std::string 
+    KeyManager::getRouterName(const std::string name)
+    {
+        std::string routerName;
+        std::string rkp(nlsrRootKeyPrefix);
+        nlsrTokenizer ntRkp(rkp,"/");
+        nlsrTokenizer nt(name,"/");
+        std::string KEY("KEY");
+        std::string opHandle("O.Start");
+        std::string routerHandle("R.Start");
+        std::string processHandle("nlsr");
+        std::string infoHandle("info");
+        std::string lsaHandle("LSA");
+        
+        if ( nt.doesTokenExist(processHandle) && nt.doesTokenExist(routerHandle))
+        {
+            routerName="/ndn" + 
+                        nt.getTokenString(ntRkp.getTokenNumber(), 
+                                          nt.getTokenPosition(routerHandle)-1) +
+                        nt.getTokenString(nt.getTokenPosition(routerHandle)+1, 
+                                          nt.getTokenPosition(processHandle)-1);
+        }
+        else if(nt.doesTokenExist(routerHandle) && !nt.doesTokenExist(infoHandle)
+                                                && !nt.doesTokenExist(lsaHandle))
+        {
+            routerName="/ndn" + 
+                        nt.getTokenString(ntRkp.getTokenNumber(), 
+                                          nt.getTokenPosition(routerHandle)-1) +
+                        nt.getTokenString(nt.getTokenPosition(routerHandle)+1,
+                                                    nt.getTokenPosition(KEY)-1);
+        }
+        else
+        {
+            if (nt.doesTokenExist(infoHandle) )
+            {
+               routerName=nt.getTokenString(0,nt.getTokenPosition(infoHandle)-1);
+            }
+            else
+            {
+                routerName=nt.getTokenString(nt.getTokenPosition(lsaHandle)+1,
+                                             nt.getTokenNumber()-3);
+            } 
+        }
+        return routerName;
+    }
+        
+    std::string 
+    KeyManager::getSiteName(const std::string name)
+    {
+        std::string siteName;
+        std::string routerName;
+        std::string rkp(nlsrRootKeyPrefix);
+        nlsrTokenizer ntRkp(rkp,"/");
+        nlsrTokenizer nt(name,"/");
+        std::string KEY("KEY");
+        std::string opHandle("O.Start");
+        std::string routerHandle("R.Start");
+        
+        if ( nt.doesTokenExist(routerHandle) )
+        {
+            siteName="/ndn" + nt.getTokenString(ntRkp.getTokenNumber(), 
+                                          nt.getTokenPosition(routerHandle) -1); 
+        }
+        else if ( nt.doesTokenExist(opHandle) )
+        {
+            siteName="/ndn" + nt.getTokenString(ntRkp.getTokenNumber(), 
+                                          nt.getTokenPosition(opHandle) -1);
+        }
+        else
+        {
+           siteName="/ndn" + nt.getTokenString(ntRkp.getTokenNumber(), 
+                                          nt.getTokenPosition(KEY) -1); 
+        }
+        return siteName;
+    }
 }
 
 
diff --git a/src/security/nlsr_km.hpp b/src/security/nlsr_km.hpp
index 7b3b7ba..5fa7ec6 100644
--- a/src/security/nlsr_km.hpp
+++ b/src/security/nlsr_km.hpp
@@ -5,23 +5,12 @@
 #include <ndn-cpp-dev/data.hpp>
 #include <ndn-cpp-dev/security/key-chain.hpp>
 #include <ndn-cpp-dev/security/validator.hpp>
-#include <ndn-cpp-dev/util/scheduler.hpp>
 #include <ndn-cpp-dev/util/random.hpp>
 #include <ndn-cpp-dev/security/identity-certificate.hpp>
-#include <ndn-cpp-dev/security/signature-sha256-with-rsa.hpp>
-
-#include <ndn-cpp-dev/security/sec-public-info-sqlite3.hpp>
-#include <ndn-cpp-dev/security/sec-public-info-memory.hpp>
-//TPM
-#include <ndn-cpp-dev/security/sec-tpm-file.hpp>
-#include <ndn-cpp-dev/security/sec-tpm-memory.hpp>
-
-#ifdef NDN_CPP_HAVE_OSX_SECURITY
-#include <ndn-cpp-dev/security/sec-tpm-osx.hpp>
-#endif
-
 #include <list>
 #include "nlsr_conf_param.hpp"
+#include "nlsr_cert_store.hpp"
+#include "utility/nlsr_tokenizer.hpp"
 
 namespace nlsr
 {
@@ -31,7 +20,14 @@
         KEY_TYPE_SITE,
         KEY_TYPE_OPERATOR,
         KEY_TYPE_ROUTER,
-        KEY_TYPE_PROCESS
+        KEY_TYPE_PROCESS,
+        KEY_TYPE_UNKNOWN
+    };
+    
+    enum nlsrContentType
+    {
+        CONTENT_TYPE_DATA,
+        CONTENT_TYPE_CERT
     };
 
     class KeyManager: public ndn::KeyChain, public ndn::Validator
@@ -41,10 +37,14 @@
     public:
         KeyManager()
             : certSeqNo(1)
+            , certStore()
+            , nlsrRootKeyPrefix()
         {
         }
 
-        void initKeyManager(ConfParameter &cp);
+        bool initKeyManager(ConfParameter &cp);
+        
+        
 
         void
         checkPolicy (const ndn::Data& data,
@@ -64,15 +64,31 @@
 
         void signData(ndn::Data& data)
         {
-            ndn::KeyChain::signByIdentity(data,routerIdentity);
-            //ndn::SignatureSha256WithRsa signature(data.getSignature());
-            //signature.setKeyLocator(routerCertName);
+            ndn::KeyChain::signByIdentity(data,processIdentity);
+        }
+        
+        template<typename T>
+        void signByIdentity(T& packet, ndn::Name signeeIdentity)
+        {
+            ndn::KeyChain::signByIdentity(packet,signeeIdentity);
         }
         
         ndn::shared_ptr<ndn::IdentityCertificate>
         getCertificate(ndn::Name certificateName)
         {
-            return ndn::KeyChain::getCertificate(routerCertName);
+            return ndn::KeyChain::getCertificate(certificateName);
+        }
+        
+        ndn::shared_ptr<ndn::IdentityCertificate>
+        getCertificate()
+        {
+            return getCertificate(processCertName);
+        }
+        
+        ndn::Name
+        createIdentity(const ndn::Name identityName)
+        {
+            return ndn::KeyChain::createIdentity(identityName);
         }
 
         ndn::Name
@@ -137,20 +153,118 @@
             }
             return certName;
         }
+        
+        void printCertStore()
+        {
+            certStore.printCertStore();
+        }
+        
+    private:
+        bool
+        verifyDataPacket(ndn::Data packet)
+        {
+            ndn::SignatureSha256WithRsa signature(packet.getSignature());
+            std::string signingCertName=signature.getKeyLocator().getName().toUri();
+            std::string packetName=packet.getName().toUri();
+            
+            std::pair<ndn::shared_ptr<ndn::IdentityCertificate>, bool> signee=
+                             certStore.getCertificateFromStore(signingCertName);
+            if( signee.second )
+            {
+                return ( getRouterName(signingCertName)== getRouterName(packetName)
+                       && verifySignature(packet, signee.first->getPublicKeyInfo()));
+            }
+            
+            return false; 
+        }
+        
+        bool 
+        verifyCertPacket(ndn::IdentityCertificate packet)
+        {
+            return true;
+        }
+        
+        template<typename T>
+        bool 
+        verify(T& packet , nlsrContentType contentType,
+                                                     nlsrKeyType signingKeyType)
+        {
+            switch(contentType)
+            {
+                case CONTENT_TYPE_DATA:
+                    return verifyDataPacket(packet);
+                    break;
+                case CONTENT_TYPE_CERT:
+                    return verifyCertPacket(packet);
+                    break;
+            }
+            
+            return false;
+        }
+        
+    public:
+        template<typename T>
+        bool 
+        verify(T& packet )
+        {
+            ndn::SignatureSha256WithRsa signature(packet.getSignature());
+            std::string signingKeyName=signature.getKeyLocator().getName().toUri();
+            std::string packetName=packet.getName().toUri();
+            nlsrTokenizer nt(packetName,"/");
+            std::string keyHandle("keys");
+            if ( nt.doesTokenExist(keyHandle) )
+            {
+                return verify(packet, CONTENT_TYPE_CERT, 
+                                            getKeyTypeFromName(signingKeyName));
+            }
+            else
+            {
+                return verify(packet, CONTENT_TYPE_DATA, 
+                                            getKeyTypeFromName(signingKeyName));
+            }
+            
+            return false;
+        }
 
+        ndn::Name getProcessCertName();
         ndn::Name getRouterCertName();
+        ndn::Name getOperatorCertName();
+        ndn::Name getSiteCertName();
+        ndn::Name getRootCertName();
 
         uint32_t getCertSeqNo();
         void setCerSeqNo(uint32_t csn);
         void initCertSeqFromFile(string certSeqFileDir);
         void writeCertSeqToFile();
+        bool isNewCertificate(std::string certName, int checkSeqNum);
+        std::pair<ndn::shared_ptr<ndn::IdentityCertificate>, bool>
+        getCertificateFromStore(const std::string certName, int checkSeqNum);
+        std::pair<ndn::shared_ptr<ndn::IdentityCertificate>, bool>
+        getCertificateFromStore(const std::string certName);
+        bool addCertificate(ndn::shared_ptr<ndn::IdentityCertificate> pcert
+                                                      , uint32_t csn, bool isv);
+        
+        
+    private:
+        bool loadAllCertificates(std::string certDirPath);
+        bool loadCertificate(std::string inputFile, nlsrKeyType keyType);
+        nlsrKeyType getKeyTypeFromName(const std::string keyName);
+        std::string getRouterName(const std::string name);
+        std::string getSiteName(const std::string name);
 
     private:
+        ndn::Name processIdentity;
         ndn::Name routerIdentity;
+        ndn::Name processCertName;
         ndn::Name routerCertName;
-        ndn::Name routerKeyName;
+        ndn::Name opCertName;
+        ndn::Name siteCertName;
+        ndn::Name rootCertName;
+        ndn::Name processKeyName;
         uint32_t certSeqNo;
         string certSeqFileNameWithPath;
+        string nlsrRootKeyPrefix;
+        NlsrCertificateStore certStore;
 
     };
 }
