diff --git a/nlsr.c b/nlsr.c
index 1580dcc..e4183ee 100644
--- a/nlsr.c
+++ b/nlsr.c
@@ -41,6 +41,7 @@
 #include "nlsr_sync.h"
 #include "nlsr_face.h"
 #include "nlsr_fib.h"
+#include "nlsr_km.h"
 
 
 #define ON_ERROR_DESTROY(resval) \
@@ -1198,11 +1199,13 @@
 	destroy_all_face_by_nlsr();	
 	destroy_faces_for_nbrs();
 	
+
 	destroy_adl();
 	destroy_npl();
 	destroy_lsdb();	
 	destroy_npt();
 	destroy_routing_table();
+	destroy_keys();
 
 	if ( nlsr->slice != NULL ) 
 		ccns_slice_destroy(&nlsr->slice);
@@ -1296,6 +1299,7 @@
 	nlsr->npl = hashtb_create(sizeof(struct name_prefix_list_entry), NULL);
 	nlsr->npt = hashtb_create(sizeof(struct npt_entry), NULL);
 	nlsr->routing_table = hashtb_create(sizeof(struct routing_table_entry), NULL);
+	nlsr->keys = hashtb_create(sizeof(struct nlsr_key), NULL);
 
 	nlsr->lsdb=(struct linkStateDatabase *)malloc(sizeof(struct linkStateDatabase));
 	nlsr->lsdb->adj_lsdb = hashtb_create(sizeof(struct alsa), NULL);
diff --git a/nlsr.h b/nlsr.h
index 7ecb9d0..045a9d3 100644
--- a/nlsr.h
+++ b/nlsr.h
@@ -62,6 +62,7 @@
 	struct hashtb *rev_map;
 	struct hashtb *npt;
 	struct hashtb *routing_table;
+	struct hashtb *keys;
 
 
 	struct linkStateDatabase *lsdb;
diff --git a/nlsr_km.c b/nlsr_km.c
index 32d6102..f745d91 100644
--- a/nlsr_km.c
+++ b/nlsr_km.c
@@ -17,6 +17,7 @@
 #include "nlsr.h"
 #include "nlsr_km.h"
 #include "nlsr_km_util.h"
+#include "utility.h"
 
 int
 sign_content_with_user_defined_keystore(struct ccn_charbuf *content_name,
@@ -454,3 +455,108 @@
 	return ret;
 }
 
+void
+destroy_keys(void)
+{	
+	int i, key_element;
+	struct nlsr_key *key;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	
+    	hashtb_start(nlsr->keys, e);
+	key_element=hashtb_n(nlsr->keys);
+
+	for(i=0;i<key_element;i++)
+	{
+		key=e->data;
+		free(key->key_name);
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+	
+	if( nlsr->keys )
+		hashtb_destroy(&nlsr->keys);
+
+}
+
+void
+print_keys(void){
+
+	if ( nlsr->debugging )
+		printf("print_keys called \n");
+	if ( nlsr->detailed_logging )
+		writeLogg(__FILE__,__FUNCTION__,__LINE__,"print_keys called \n");		
+	
+	int i, key_element;
+	struct nlsr_key *key;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	
+    	hashtb_start(nlsr->keys, e);
+	key_element=hashtb_n(nlsr->keys);
+
+	for(i=0;i<key_element;i++)
+	{
+		key=e->data;
+		
+		if ( nlsr->debugging )
+			printf("Key : %s \n",key->key_name);
+			
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+
+}
+
+int
+does_key_exist(char *keyname){
+	if (nlsr->debugging)
+	{
+		printf("does_key_exist called\n");
+		printf("Keyname : %s \n",keyname);
+	}
+
+	int ret=0;
+
+	unsigned *v;
+	v = hashtb_lookup(nlsr->keys, keyname, strlen(keyname));
+	if (v != NULL){
+		ret = 1;
+		if (nlsr->debugging)
+			printf("Key Found\n");
+	}
+	
+	return ret;
+}
+
+void
+add_key(char *keyname){
+	if (nlsr->debugging)
+	{
+		printf("add_key called\n");
+		printf("Keyname : %s \n",keyname);
+	}
+
+	struct nlsr_key *key;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee; 	
+    	int res;
+
+   	hashtb_start(nlsr->keys, e);
+    	res = hashtb_seek(e, keyname, strlen(keyname), 0);
+
+	if(res == HT_NEW_ENTRY )
+	{
+		key=e->data;
+		key->key_name=(char *)calloc(strlen(keyname)+1,sizeof(char));
+		memcpy(key->key_name,keyname,strlen(keyname)+1);
+	}
+
+	if (nlsr->debugging)
+		print_keys();
+}
diff --git a/nlsr_km.h b/nlsr_km.h
index bb935fa..65c2dca 100644
--- a/nlsr_km.h
+++ b/nlsr_km.h
@@ -11,6 +11,9 @@
 };
 
 
+struct nlsr_key{
+	char *key_name;
+};
 
 
 int
@@ -33,4 +36,9 @@
 				struct ccn_parsed_ContentObject *pco,
 				int content_type);
 
+void add_key(char *keyname);
+int does_key_exist(char *keyname);
+
+void destroy_keys(void);
+
 #endif
diff --git a/nlsr_ndn.c b/nlsr_ndn.c
index 3a724d5..2fdf091 100644
--- a/nlsr_ndn.c
+++ b/nlsr_ndn.c
@@ -510,14 +510,34 @@
 	
 
 	if ( contain_key_name(info->content_ccnb, info->pco) == 1){
+		int res_verify=-1;
+		int key_exists=0;
+		struct ccn_charbuf *key_name=get_key_name(info->content_ccnb, info->pco);
+		struct ccn_charbuf *key_uri = ccn_charbuf_create();
+		ccn_uri_append(key_uri, key_name->buf, key_name->length, 0);
+		key_exists=does_key_exist(ccn_charbuf_as_string(key_uri));
+		int key_type=get_key_type_from_key_name(key_name);
+
+		if ( res_verify == 1 && key_type == NLSR_KEY ){				
+			res_verify=0;
+		}
+		else{
+			res_verify=verify_key(info->content_ccnb,info->pco,0);
+		}
 						
-		int res_verify=verify_key(info->content_ccnb,info->pco,0);
+		//int res_verify=verify_key(info->content_ccnb,info->pco,0);
 
 		if ( res_verify != 0 ){
 			if ( nlsr->debugging )
 				printf("Error in verfiying keys !! :( \n");
+			ccn_charbuf_destroy(&key_name);
+			ccn_charbuf_destroy(&key_uri);
 		}
 		else{
+			if ( key_exists == 0 )
+				add_key(ccn_charbuf_as_string(key_uri));
+			ccn_charbuf_destroy(&key_name);
+			ccn_charbuf_destroy(&key_uri);
 			if ( nlsr->debugging )
 				printf("Key verification is successful :)\n");
 			update_adjacent_timed_out_zero_to_adl(nbr);	
diff --git a/nlsr_sync.c b/nlsr_sync.c
index b0058e7..b893022 100644
--- a/nlsr_sync.c
+++ b/nlsr_sync.c
@@ -251,14 +251,32 @@
 			if ( nlsr->debugging )	
 				printf("Content Parsing result: %d\n",chk_cont); 
 			if ( contain_key_name(ptr, &pcobuf1) == 1){
-						
-				int res_verify=verify_key(ptr,&pcobuf1,1);
+				int res_verify=-1;
+				int key_exists=0;
+				struct ccn_charbuf *key_name=get_key_name(ptr, &pcobuf1);
+				struct ccn_charbuf *key_uri = ccn_charbuf_create();
+				ccn_uri_append(key_uri, key_name->buf, key_name->length, 0);
+				key_exists=does_key_exist(ccn_charbuf_as_string(key_uri));
+				int key_type=get_key_type_from_key_name(key_name);
+
+				if ( key_exists == 1 && key_type == NLSR_KEY ){				
+					res_verify=0;
+				}
+				else{
+					res_verify=verify_key(ptr,&pcobuf1,1);
+				}
 
 				if ( res_verify != 0 ){
 					if ( nlsr->debugging )
 						printf("Error in verfiying keys !! :( \n");
+					ccn_charbuf_destroy(&key_name);
+					ccn_charbuf_destroy(&key_uri);
 				}
 				else{
+					if ( key_exists == 0 )
+						add_key(ccn_charbuf_as_string(key_uri));
+					ccn_charbuf_destroy(&key_name);
+					ccn_charbuf_destroy(&key_uri);
 					if ( nlsr->debugging )
 						printf("Key verification is successful :)\n");
 					ptr_in=ptr;
