diff --git a/src/endorse-certificate.cpp b/src/endorse-certificate.cpp
new file mode 100644
index 0000000..a565ebc
--- /dev/null
+++ b/src/endorse-certificate.cpp
@@ -0,0 +1,77 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013, Regents of the University of California
+ *                     Yingdi Yu
+ *
+ * BSD license, See the LICENSE file for more information
+ *
+ * Author: Yingdi Yu <yingdi@cs.ucla.edu>
+ */
+
+#include "endorse-certificate.h"
+#include "exception.h"
+#include <ndn.cxx/security/certificate/certificate-subdescrpt.h>
+
+
+using namespace std;
+using namespace ndn;
+using namespace ndn::security;
+
+EndorseExtension::EndorseExtension(const Blob & value)
+  : CertificateExtension("1.3.6.1.5.32.2", true, value)
+{}
+
+EndorseCertificate::EndorseCertificate(const IdentityCertificate& kskCertificate,
+				       const Name& signer,
+				       const Time& notBefore,
+				       const Time& notAfter)
+  : Certificate()
+  , m_keyName(kskCertificate.getPublicKeyName())
+  , m_signer(signer)
+{
+  setNotBefore(notBefore);
+  setNotAfter(notAfter);
+  addSubjectDescription(CertificateSubDescrypt("2.5.4.41", m_keyName.toUri()));
+  setPublicKeyInfo(kskCertificate.getPublicKeyInfo());
+}
+
+EndorseCertificate::EndorseCertificate(const EndorseCertificate& endorseCertificate)
+  : Certificate(endorseCertificate)
+  , m_keyName(endorseCertificate.m_keyName)
+  , m_signer(endorseCertificate.m_signer)
+  , m_profileList(endorseCertificate.m_profileList)
+{}
+
+EndorseCertificate::EndorseCertificate(const Data& data)
+  : Certificate(data)
+{
+  const Name& dataName = data.getName();
+  name::Component certFlag(string("PROFILE-CERT"));  
+
+  int profileIndex = -1;
+  for(int i = 0; i < dataName.size(); i++)
+    {
+      if(0 == dataName.get(i).compare(certFlag))
+	{
+	  profileIndex = i;
+	  break;
+	}
+    }
+
+  if(profileIndex < 0)
+    throw LnException("No PROFILE-CERT component in data name!");
+
+  m_keyName = dataName.getSubName(0, profileIndex);
+  m_signer = dataName.getSubName(profileIndex + 1, dataName.size() - profileIndex - 2);
+
+  OID profileExtenstionOID("1.3.6.1.5.32.2");
+  ExtensionList::iterator it = m_extnList.begin();
+  for(; it != m_extnList.end(); it++)
+    {
+      if(profileExtenstionOID == it->getOID())
+	{
+	  Ptr<Blob> valueBlob = Ptr<Blob>(new Blob(it->getValue().buf(), it->getValue().size()));
+	  m_profileList.push_back(ProfileData(*(Data::decodeFromWire(valueBlob))));
+	}
+    }
+}
diff --git a/src/endorse-certificate.h b/src/endorse-certificate.h
new file mode 100644
index 0000000..28202da
--- /dev/null
+++ b/src/endorse-certificate.h
@@ -0,0 +1,74 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013, Regents of the University of California
+ *                     Yingdi Yu
+ *
+ * BSD license, See the LICENSE file for more information
+ *
+ * Author: Yingdi Yu <yingdi@cs.ucla.edu>
+ */
+
+#ifndef LINKEDN_ENDORSE_CERTIFICATE_H
+#define LINKEDN_ENDORSE_CERTIFICATE_H
+
+#include <vector>
+#include <ndn.cxx/data.h>
+#include <ndn.cxx/security/certificate/identity-certificate.h>
+#include <ndn.cxx/security/certificate/certificate-extension.h>
+
+#include "profile-data.h"
+
+class EndorseExtension : public ndn::security::CertificateExtension
+{
+public:
+  EndorseExtension(const ndn::Blob & value);
+
+  virtual
+  ~EndorseExtension() {}
+};
+
+class EndorseCertificate : public ndn::security::Certificate
+{
+public:
+  EndorseCertificate(const ndn::security::IdentityCertificate& kskCertificate,
+                     const ndn::Name& signer,
+                     const ndn::Time& notBefore,
+                     const ndn::Time& notAfter);
+
+  EndorseCertificate(const EndorseCertificate& endorseCertificate);
+
+  EndorseCertificate(const ndn::Data& data);
+
+  virtual
+  ~EndorseCertificate()
+  {}
+
+  void 
+  addProfile(const ProfileData& profile);
+
+  void
+  encode();
+
+  inline const ndn::Name&
+  getSigner() const
+  { return m_signer; }
+
+  inline const std::vector<ProfileData>&
+  getProfileList() const
+  { return m_profileList; }
+
+  inline ndn::Name
+  getPublicKeyName ()
+  { return m_keyName; }
+
+private:
+  void 
+  decode();
+
+private:
+  ndn::Name m_keyName;
+  ndn::Name m_signer;
+  std::vector<ProfileData> m_profileList;
+};
+
+#endif
diff --git a/src/profile-data.h b/src/profile-data.h
index 6e29a43..c70f6fc 100644
--- a/src/profile-data.h
+++ b/src/profile-data.h
@@ -23,7 +23,8 @@
   ProfileData (const ProfileData& profile);
 
   ProfileData (const ndn::Data& data);
-
+  
+  virtual
   ~ProfileData () {}
 
   inline const ndn::Name&
