diff --git a/include/ndn-cpp/security/certificate/identity-certificate.hpp b/include/ndn-cpp/security/certificate/identity-certificate.hpp
index 0319774..d111acc 100644
--- a/include/ndn-cpp/security/certificate/identity-certificate.hpp
+++ b/include/ndn-cpp/security/certificate/identity-certificate.hpp
@@ -43,8 +43,8 @@
   virtual Data &
   setName(const Name& name);
 
-  virtual Name 
-  getPublicKeyName() const;
+  Name 
+  getPublicKeyName () const { return publicKeyName_; }
 
   static bool
   isIdentityCertificate(const Certificate& certificate);
@@ -52,6 +52,12 @@
 private:
   static bool
   isCorrectName(const Name& name);
+  
+  void
+  setPublicKeyName();
+    
+protected:
+  Name publicKeyName_;
 };
 
 }
diff --git a/src/encoding/der/visitor/print-visitor.cpp b/src/encoding/der/visitor/print-visitor.cpp
index cba5d2d..4c5ee64 100644
--- a/src/encoding/der/visitor/print-visitor.cpp
+++ b/src/encoding/der/visitor/print-visitor.cpp
@@ -78,7 +78,7 @@
 PrintVisitor::visit(DerOid& derOid, ndnboost::any param)
 {
   const string& indent = ndnboost::any_cast<const string&>(param);
-	
+  
   printData(derOid.getHeader(), indent);
   printData(derOid.getPayload(), indent + "   ");
 
@@ -88,7 +88,7 @@
 PrintVisitor::visit(DerGtime& derGtime, ndnboost::any param)
 {
   const string& indent = ndnboost::any_cast<const string&>(param);
-	
+  
   printData(derGtime.getHeader(), indent);
   printData(derGtime.getPayload(), indent + "   ");
 }
@@ -103,7 +103,7 @@
   const DerNodePtrList& children = derSequence.getChildren();
   DerNodePtrList::const_iterator it = children.begin();
   for(; it != children.end(); it++)
-	(*it)->accept(*this, indent + " | ");
+  (*it)->accept(*this, indent + " | ");
 }
 
 
diff --git a/src/security/certificate/identity-certificate.cpp b/src/security/certificate/identity-certificate.cpp
index a328112..2e2ea79 100644
--- a/src/security/certificate/identity-certificate.cpp
+++ b/src/security/certificate/identity-certificate.cpp
@@ -18,6 +18,8 @@
 {
   if (!isCorrectName(data.getName()))
     throw SecurityException("Wrong Identity Certificate Name!");
+  
+  setPublicKeyName();
 }
 
 IdentityCertificate::~IdentityCertificate()
@@ -29,14 +31,25 @@
 {
   int i = name.size() - 1;
   
+  string idString("ID-CERT");
   for (; i >= 0; i--) {
-    if(name.get(i).toEscapedString() == string("ID-CERT"))
+    if(name.get(i).toEscapedString() == idString)
       break;
   }
 
   if (i < 0)
     return false;
   
+  int keyIdx = 0;
+  string keyString("KEY");
+  for (; keyIdx < name.size(); keyIdx++) {
+    if(name.get(keyIdx).toEscapedString() == keyString)
+      break;
+  }
+
+  if (keyIdx >= name.size())
+    return false;
+
   return true;
 }
 
@@ -47,20 +60,30 @@
     throw SecurityException("Wrong Identity Certificate Name!");
   
   Data::setName(name);
+  setPublicKeyName();
   return *this;
 }
 
-Name
-IdentityCertificate::getPublicKeyName() const
+void
+IdentityCertificate::setPublicKeyName()
 {
   const Name& certificateName = getName();
-  int i = certificateName.size() - 1;
 
-  for (; i >= 0; i--)
-    if(certificateName.get(i).toEscapedString() == string("ID-CERT"))
-  break; 
+  int i = certificateName.size() - 1;
+  string idString("ID-CERT");
+  for (; i >= 0; i--) {
+    if (certificateName.get(i).toEscapedString() == idString)
+      break;
+  }
+    
+  Name tmpName = certificateName.getSubName(0, i);    
+  string keyString("KEY");
+  for (i = 0; i < tmpName.size(); i++) {
+    if (tmpName.get(i).toEscapedString() == keyString)
+      break;
+  }
   
-  return certificateName.getSubName(0, i);
+  publicKeyName_ = tmpName.getSubName(0, i).append(tmpName.getSubName(i + 1, tmpName.size() - i - 1));
 }
 
 bool
