security: Bug fixing

1. correct the error message for non-existing public key.
2. rename private key export/import methods to avoid confusion.

Refs: #1527

Change-Id: I3ea8378378a66e1fbec7f0d4f210057c8f9b969b
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;
         }