diff --git a/src/security/key-chain.hpp b/src/security/key-chain.hpp
index 1a76d1a..5143a4a 100644
--- a/src/security/key-chain.hpp
+++ b/src/security/key-chain.hpp
@@ -511,14 +511,14 @@
 
     Name keyName = Info::getDefaultKeyNameForIdentity(identity);
 
-    ConstBufferPtr pkcs8;
+    ConstBufferPtr pkcs5;
     try
       {
-        pkcs8 = Tpm::exportPrivateKeyPkcs8FromTpm(keyName, passwordStr);
+        pkcs5 = Tpm::exportPrivateKeyPkcs5FromTpm(keyName, passwordStr);
       }
     catch (TpmError& e)
       {
-        throw InfoError("Fail to export PKCS8 of private key");
+        throw InfoError("Fail to export PKCS5 of private key");
       }
 
     shared_ptr<IdentityCertificate> cert;
@@ -533,7 +533,7 @@
       }
 
     shared_ptr<SecuredBag> secureBag = make_shared<SecuredBag>(boost::cref(*cert),
-                                                               boost::cref(pkcs8));
+                                                               boost::cref(pkcs5));
 
     return secureBag;
   }
@@ -555,7 +555,7 @@
     Info::addIdentity(identity);
 
     // Add key
-    Tpm::importPrivateKeyPkcs8IntoTpm(keyName,
+    Tpm::importPrivateKeyPkcs5IntoTpm(keyName,
                                       securedBag.getKey()->buf(),
                                       securedBag.getKey()->size(),
                                       passwordStr);
diff --git a/src/security/sec-tpm-file.cpp b/src/security/sec-tpm-file.cpp
index ba3cca8..94ed510 100644
--- a/src/security/sec-tpm-file.cpp
+++ b/src/security/sec-tpm-file.cpp
@@ -149,7 +149,7 @@
   string keyURI = keyName.toUri();
 
   if (!doesKeyExistInTpm(keyName, KEY_CLASS_PUBLIC))
-    throw Error("Public Key already exist");
+    throw Error("Public Key does not exist");
 
   ostringstream os;
   try
@@ -169,7 +169,7 @@
 }
 
 ConstBufferPtr
-SecTpmFile::exportPrivateKeyPkcs1FromTpm(const Name& keyName)
+SecTpmFile::exportPrivateKeyPkcs8FromTpm(const Name& keyName)
 {
   OBufferStream privateKeyOs;
   CryptoPP::FileSource(m_impl->nameTransform(keyName.toUri(), ".pri").string().c_str(), true,
@@ -179,7 +179,7 @@
 }
 
 bool
-SecTpmFile::importPrivateKeyPkcs1IntoTpm(const Name& keyName, const uint8_t* buf, size_t size)
+SecTpmFile::importPrivateKeyPkcs8IntoTpm(const Name& keyName, const uint8_t* buf, size_t size)
 {
   try
     {
diff --git a/src/security/sec-tpm-file.hpp b/src/security/sec-tpm-file.hpp
index 8cc20df..4dbbf79 100644
--- a/src/security/sec-tpm-file.hpp
+++ b/src/security/sec-tpm-file.hpp
@@ -107,10 +107,10 @@
    * From TrustedPlatformModule *
    ******************************/
   virtual ConstBufferPtr
-  exportPrivateKeyPkcs1FromTpm(const Name& keyName);
+  exportPrivateKeyPkcs8FromTpm(const Name& keyName);
 
   virtual bool
-  importPrivateKeyPkcs1IntoTpm(const Name& keyName, const uint8_t* buf, size_t size);
+  importPrivateKeyPkcs8IntoTpm(const Name& keyName, const uint8_t* buf, size_t size);
 
   virtual bool
   importPublicKeyPkcs1IntoTpm(const Name& keyName, const uint8_t* buf, size_t size);
diff --git a/src/security/sec-tpm-osx.cpp b/src/security/sec-tpm-osx.cpp
index fd21439..84be0e2 100644
--- a/src/security/sec-tpm-osx.cpp
+++ b/src/security/sec-tpm-osx.cpp
@@ -376,7 +376,7 @@
 }
 
 ConstBufferPtr
-SecTpmOsx::exportPrivateKeyPkcs1FromTpmInternal(const Name& keyName, bool needRetry)
+SecTpmOsx::exportPrivateKeyPkcs8FromTpmInternal(const Name& keyName, bool needRetry)
 {
   using namespace CryptoPP;
 
@@ -393,7 +393,7 @@
       if (res == errSecAuthFailed && !needRetry)
         {
           if (unlockTpm(0, 0, false))
-            return exportPrivateKeyPkcs1FromTpmInternal(keyName, true);
+            return exportPrivateKeyPkcs8FromTpmInternal(keyName, true);
           else
             return shared_ptr<Buffer>();
         }
@@ -438,7 +438,7 @@
 #endif // __GNUC__
 
 bool
-SecTpmOsx::importPrivateKeyPkcs1IntoTpmInternal(const Name& keyName,
+SecTpmOsx::importPrivateKeyPkcs8IntoTpmInternal(const Name& keyName,
                                                 const uint8_t* buf, size_t size,
                                                 bool needRetry)
 {
@@ -506,7 +506,7 @@
       if (res == errSecAuthFailed && !needRetry)
         {
           if (unlockTpm(0, 0, false))
-            return importPrivateKeyPkcs1IntoTpmInternal(keyName, buf, size, true);
+            return importPrivateKeyPkcs8IntoTpmInternal(keyName, buf, size, true);
           else
             return false;
         }
diff --git a/src/security/sec-tpm-osx.hpp b/src/security/sec-tpm-osx.hpp
index 1a5bd1f..d4363c2 100644
--- a/src/security/sec-tpm-osx.hpp
+++ b/src/security/sec-tpm-osx.hpp
@@ -99,15 +99,15 @@
    * From TrustedPlatformModule *
    ******************************/
   virtual ConstBufferPtr
-  exportPrivateKeyPkcs1FromTpm(const Name& keyName)
+  exportPrivateKeyPkcs8FromTpm(const Name& keyName)
   {
-    return exportPrivateKeyPkcs1FromTpmInternal(keyName, false);
+    return exportPrivateKeyPkcs8FromTpmInternal(keyName, false);
   }
 
   virtual bool
-  importPrivateKeyPkcs1IntoTpm(const Name& keyName, const uint8_t* buf, size_t size)
+  importPrivateKeyPkcs8IntoTpm(const Name& keyName, const uint8_t* buf, size_t size)
   {
-    return importPrivateKeyPkcs1IntoTpmInternal(keyName, buf, size, false);
+    return importPrivateKeyPkcs8IntoTpmInternal(keyName, buf, size, false);
   }
 
   virtual bool
@@ -123,10 +123,10 @@
   deleteKeyPairInTpmInternal(const Name& keyName, bool needRetry);
 
   ConstBufferPtr
-  exportPrivateKeyPkcs1FromTpmInternal(const Name& keyName, bool needRetry);
+  exportPrivateKeyPkcs8FromTpmInternal(const Name& keyName, bool needRetry);
 
   bool
-  importPrivateKeyPkcs1IntoTpmInternal(const Name& keyName,
+  importPrivateKeyPkcs8IntoTpmInternal(const Name& keyName,
                                        const uint8_t* buf, size_t size,
                                        bool needRetry);
 
diff --git a/src/security/sec-tpm.cpp b/src/security/sec-tpm.cpp
index d2e4af5..253ab02 100644
--- a/src/security/sec-tpm.cpp
+++ b/src/security/sec-tpm.cpp
@@ -14,7 +14,7 @@
 namespace ndn {
 
 ConstBufferPtr
-SecTpm::exportPrivateKeyPkcs8FromTpm(const Name& keyName, const string& passwordStr)
+SecTpm::exportPrivateKeyPkcs5FromTpm(const Name& keyName, const string& passwordStr)
 {
   using namespace CryptoPP;
 
@@ -47,14 +47,14 @@
   CBC_Mode< DES_EDE3 >::Encryption e;
   e.SetKeyWithIV(derived, derivedLen, iv);
 
-  ConstBufferPtr pkcs1PrivateKey = exportPrivateKeyPkcs1FromTpm(keyName);
-  if (!static_cast<bool>(pkcs1PrivateKey))
+  ConstBufferPtr pkcs8PrivateKey = exportPrivateKeyPkcs8FromTpm(keyName);
+  if (!static_cast<bool>(pkcs8PrivateKey))
     throw Error("Cannot export the private key, #1");
 
   OBufferStream encryptedOs;
   try
     {
-      StringSource stringSource(pkcs1PrivateKey->buf(), pkcs1PrivateKey->size(), true,
+      StringSource stringSource(pkcs8PrivateKey->buf(), pkcs8PrivateKey->size(), true,
                                 new StreamTransformationFilter(e, new FileSink(encryptedOs)));
     }
   catch (CryptoPP::Exception& e)
@@ -136,7 +136,7 @@
 }
 
 bool
-SecTpm::importPrivateKeyPkcs8IntoTpm(const Name& keyName,
+SecTpm::importPrivateKeyPkcs5IntoTpm(const Name& keyName,
                                      const uint8_t* buf, size_t size,
                                      const string& passwordStr)
 {
@@ -249,7 +249,7 @@
       return false;
     }
 
-  if (!importPrivateKeyPkcs1IntoTpm(keyName,
+  if (!importPrivateKeyPkcs8IntoTpm(keyName,
                                     privateKeyOs.buf()->buf(), privateKeyOs.buf()->size()))
     return false;
 
diff --git a/src/security/sec-tpm.hpp b/src/security/sec-tpm.hpp
index 14b5756..395cec9 100644
--- a/src/security/sec-tpm.hpp
+++ b/src/security/sec-tpm.hpp
@@ -208,7 +208,7 @@
   addAppToACL(const Name& keyName, KeyClass keyClass, const std::string& appPath, AclType acl) = 0;
 
   /**
-   * @brief Export a private key in PKCS#8 format.
+   * @brief Export a private key in PKCS#5 format.
    *
    * @param keyName The private key name.
    * @param password The password to encrypt the private key.
@@ -216,10 +216,10 @@
    * @throws SecTpm::Error if private key cannot be exported.
    */
   ConstBufferPtr
-  exportPrivateKeyPkcs8FromTpm(const Name& keyName, const std::string& password);
+  exportPrivateKeyPkcs5FromTpm(const Name& keyName, const std::string& password);
 
   /**
-   * @brief Import a private key in PKCS#8 format.
+   * @brief Import a private key in PKCS#5 format.
    *
    * Also recover the public key and installed it in TPM.
    *
@@ -229,29 +229,29 @@
    * @return False if import fails.
    */
   bool
-  importPrivateKeyPkcs8IntoTpm(const Name& keyName,
+  importPrivateKeyPkcs5IntoTpm(const Name& keyName,
                                const uint8_t* buf, size_t size,
                                const std::string& password);
 
 protected:
   /**
-   * @brief Export a private key in PKCS#1 format.
+   * @brief Export a private key in PKCS#8 format.
    *
    * @param keyName The private key name.
-   * @return The private key info (in PKCS#1 format) if exist, otherwise a NULL pointer.
+   * @return The private key info (in PKCS#8 format) if exist, otherwise a NULL pointer.
    */
   virtual ConstBufferPtr
-  exportPrivateKeyPkcs1FromTpm(const Name& keyName) = 0;
+  exportPrivateKeyPkcs8FromTpm(const Name& keyName) = 0;
 
   /**
-   * @brief Import a private key in PKCS#1 format.
+   * @brief Import a private key in PKCS#8 format.
    *
    * @param keyName The private key name.
    * @param key The encoded private key info.
    * @return False if import fails.
    */
   virtual bool
-  importPrivateKeyPkcs1IntoTpm(const Name& keyName, const uint8_t* buf, size_t size) = 0;
+  importPrivateKeyPkcs8IntoTpm(const Name& keyName, const uint8_t* buf, size_t size) = 0;
 
   /**
    * @brief Import a public key in PKCS#1 format.
