diff --git a/nlsr.c b/nlsr.c
index a498264..2efd619 100644
--- a/nlsr.c
+++ b/nlsr.c
@@ -714,10 +714,6 @@
 	{
 		process_command_ccnname(remainder);
 	}
-	/*else if(!strcmp(cmd_type,"lsdb-synch-interval") )
-	{
-		process_command_lsdb_synch_interval(remainder);
-	}*/
 	else if(!strcmp(cmd_type,"interest-retry") )
 	{
 		process_command_interest_retry(remainder);
diff --git a/nlsr_ndn.c b/nlsr_ndn.c
index 258c954..545f594 100644
--- a/nlsr_ndn.c
+++ b/nlsr_ndn.c
@@ -158,9 +158,6 @@
 	if ( nlsr->detailed_logging )
 		writeLogg(__FILE__,__FUNCTION__,__LINE__,"LSA Identifier: %s Length: %d\n",lsaId->name,lsaId->length-1);
 
-	//printf("LSA Identifier: %s Length: %d\n",lsaId->name,lsaId->length-1);
-
-
 }
 
 int 
@@ -307,17 +304,39 @@
 	if (res >= 0)
 	{
 		sp.template_ccnb=ccn_charbuf_create();
-		ccn_charbuf_append_tt(sp.template_ccnb,CCN_DTAG_SignedInfo, CCN_DTAG);
-		ccnb_tagged_putf(sp.template_ccnb, CCN_DTAG_FreshnessSeconds, "%ld", 10);
-       	 	sp.sp_flags |= CCN_SP_TEMPL_FRESHNESS;
+
+		struct ccn_charbuf *pubid = ccn_charbuf_create();
+		struct ccn_charbuf *pubkey = ccn_charbuf_create();
+
+		int res1;
+		res1 = ccn_get_public_key(nlsr->ccn, NULL, pubid, pubkey);		
+		ccn_charbuf_append_tt(sp.template_ccnb, CCN_DTAG_SignedInfo, CCN_DTAG);
+		ccn_charbuf_append_tt(sp.template_ccnb, CCN_DTAG_KeyLocator, CCN_DTAG);
+		ccn_charbuf_append_tt(sp.template_ccnb, CCN_DTAG_KeyName, CCN_DTAG);
+		ccn_charbuf_append_charbuf(sp.template_ccnb, pubid);
 		ccn_charbuf_append_closer(sp.template_ccnb);
+		ccn_charbuf_append_closer(sp.template_ccnb);
+
+		ccnb_tagged_putf(sp.template_ccnb, CCN_DTAG_FreshnessSeconds, "%ld", 10);
+       	 	sp.sp_flags |= CCN_SP_TEMPL_FRESHNESS;		
+
+		ccn_charbuf_append_closer(sp.template_ccnb);
+		
+		sp.sp_flags |= CCN_SP_TEMPL_KEY_LOCATOR;
+		sp.sp_flags |= CCN_SP_FINAL_BLOCK;
+		sp.type = CCN_CONTENT_KEY;
+		
+		//ccn_charbuf_append_tt(sp.template_ccnb,CCN_DTAG_SignedInfo, CCN_DTAG);
+		//ccnb_tagged_putf(sp.template_ccnb, CCN_DTAG_FreshnessSeconds, "%ld", 10);
+       	 	//sp.sp_flags |= CCN_SP_TEMPL_FRESHNESS;
+		//ccn_charbuf_append_closer(sp.template_ccnb);
 
 
 		char *raw_data=(char *)malloc(20);
 		memset(raw_data,0,20);
 		sprintf(raw_data,"%s", nlsr->lsdb->lsdb_version);	
 
-		res= ccn_sign_content(nlsr->ccn, data, name, &sp, raw_data,strlen(raw_data)); 
+		res= ccn_sign_content(nlsr->ccn, data, name, &sp, pubkey->buf,pubkey->length); 
 		if(res >= 0)
 		{
 			if ( nlsr->debugging )
@@ -357,6 +376,8 @@
 		free(nbr);
 		free(raw_data);
 		ccn_charbuf_destroy(&sp.template_ccnb);
+		ccn_charbuf_destroy(&pubid);
+		ccn_charbuf_destroy(&pubkey);
 	}
 
 	ccn_charbuf_destroy(&data);
@@ -405,15 +426,14 @@
 		struct ccn_charbuf*ito;
 		ito=ccn_charbuf_create();
 		ccn_uri_append(ito,info->interest_ccnb,info->pi->offset[CCN_PI_E],0);
-
 		if ( nlsr->debugging )
 			printf("%s\n",ccn_charbuf_as_string(ito));
 		if ( nlsr->detailed_logging )
 			writeLogg(__FILE__,__FUNCTION__,__LINE__,"%s\n",ccn_charbuf_as_string(ito));
-
-		//printf("%s\n",ccn_charbuf_as_string(ito));
 		ccn_charbuf_destroy(&ito);
 
+		
+
 		process_incoming_timed_out_interest(selfp,info);
 
 	    break;
@@ -484,17 +504,15 @@
 		writeLogg(__FILE__,__FUNCTION__,__LINE__,"Info Content Received For Neighbor: %s Length:%d\n",nbr->name,nbr->length);
 
 
-	//const unsigned char *ptr;
-	//size_t length;
-	//ccn_content_get_value(info->content_ccnb, info->pco->offset[CCN_PCO_E_Content]-info->pco->offset[CCN_PCO_B_Content], info->pco, &ptr, &length);
-
-	//long int interval=atoi((char *)ptr);
-
-
+	if ( contain_key_name(info->content_ccnb, info->pco) == 1)
+	{
+		struct ccn_charbuf *key_name=get_key_name(info->content_ccnb, info->pco);
+		if(nlsr->debugging)
+			printf("Key Name: %s\n",ccn_charbuf_as_string(key_name));
+	}
 
 	update_adjacent_timed_out_zero_to_adl(nbr);	
 	update_adjacent_status_to_adl(nbr,NBR_ACTIVE);
-	//update_lsdb_synch_interval_to_adl(nbr,interval);
 	print_adjacent_from_adl();
 
 
@@ -722,5 +740,28 @@
 	}
 	ccn_charbuf_destroy(&name);
 	free(int_name);
+}
 
+int
+contain_key_name(const unsigned char *ccnb, struct ccn_parsed_ContentObject *pco) 
+{
+	if (pco->offset[CCN_PCO_B_KeyLocator] == pco->offset[CCN_PCO_E_KeyLocator])
+		return -1;
+
+	struct ccn_buf_decoder decoder;
+	struct ccn_buf_decoder *d;
+	d = ccn_buf_decoder_start(&decoder, ccnb + pco->offset[CCN_PCO_B_Key_Certificate_KeyName], pco->offset[CCN_PCO_E_Key_Certificate_KeyName] - pco->offset[CCN_PCO_B_Key_Certificate_KeyName]);
+	if (ccn_buf_match_dtag(d, CCN_DTAG_KeyName))
+		return 1;
+
+	return -1;
+}
+
+struct ccn_charbuf *
+get_key_name(const unsigned char *ccnb, struct ccn_parsed_ContentObject *pco) 
+{
+	struct ccn_charbuf *key_name = ccn_charbuf_create();
+	ccn_charbuf_append(key_name, ccnb + pco->offset[CCN_PCO_B_KeyName_Name], pco->offset[CCN_PCO_E_KeyName_Name] - pco->offset[CCN_PCO_B_KeyName_Name]);
+
+	return key_name;
 }
diff --git a/nlsr_ndn.h b/nlsr_ndn.h
index 1e34284..b084b8c 100644
--- a/nlsr_ndn.h
+++ b/nlsr_ndn.h
@@ -21,5 +21,8 @@
 int send_info_interest(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags);
 void send_info_interest_to_neighbor(struct name_prefix *nbr);
 
+struct ccn_charbuf * get_key_name(const unsigned char *ccnb, struct ccn_parsed_ContentObject *pco);
+int contain_key_name(const unsigned char *ccnb, struct ccn_parsed_ContentObject *pco);
+
 
 #endif
