diff --git a/src/security/sec-tpm-memory.cpp b/src/security/sec-tpm-memory.cpp
index fd6a79c..205e93a 100644
--- a/src/security/sec-tpm-memory.cpp
+++ b/src/security/sec-tpm-memory.cpp
@@ -76,7 +76,7 @@
 }
 
 Block 
-SecTpmMemory::sign(const uint8_t *data, size_t dataLength,
+SecTpmMemory::signInTpm(const uint8_t *data, size_t dataLength,
                 const Name& keyName,
                 DigestAlgorithm digestAlgorithm)
 {
@@ -110,7 +110,7 @@
 }
 
 void
-SecTpmMemory::sign(Data &d,
+SecTpmMemory::signInTpm(Data &d,
                 const Name& keyName,
                 DigestAlgorithm digestAlgorithm)
 {
@@ -149,7 +149,7 @@
 }
 
 ConstBufferPtr
-SecTpmMemory::decrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool isSymmetric)
+SecTpmMemory::decryptInTpm(const Name& keyName, const uint8_t* data, size_t dataLength, bool isSymmetric)
 {
 #if 1
   throw Error("MemoryPrivateKeyStorage::decrypt not implemented");
@@ -157,7 +157,7 @@
 }
 
 ConstBufferPtr
-SecTpmMemory::encrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool isSymmetric)
+SecTpmMemory::encryptInTpm(const Name& keyName, const uint8_t* data, size_t dataLength, bool isSymmetric)
 {
 #if 1
   throw Error("MemoryPrivateKeyStorage::encrypt not implemented");
@@ -165,7 +165,7 @@
 }
 
 void 
-SecTpmMemory::generateSymmetricKey(const Name& keyName, KeyType keyType, int keySize)
+SecTpmMemory::generateSymmetricKeyInTpm(const Name& keyName, KeyType keyType, int keySize)
 {
 #if 1
   throw Error("MemoryPrivateKeyStorage::generateKey not implemented");
@@ -173,7 +173,7 @@
 }
 
 bool
-SecTpmMemory::doesKeyExist(const Name& keyName, KeyClass keyClass)
+SecTpmMemory::doesKeyExistInTpm(const Name& keyName, KeyClass keyClass)
 {
   if (keyClass == KEY_CLASS_PUBLIC)
     return publicKeyStore_.find(keyName.toUri()) != publicKeyStore_.end();
diff --git a/src/security/sec-tpm-osx.cpp b/src/security/sec-tpm-osx.cpp
index cfe7579..cd1b17f 100644
--- a/src/security/sec-tpm-osx.cpp
+++ b/src/security/sec-tpm-osx.cpp
@@ -137,7 +137,7 @@
   SecTpmOsx::generateKeyPairInTpm(const Name & keyName, KeyType keyType, int keySize)
   { 
     
-    if(doesKeyExist(keyName, KEY_CLASS_PUBLIC)){
+    if(doesKeyExistInTpm(keyName, KEY_CLASS_PUBLIC)){
       _LOG_DEBUG("keyName has existed");
       throw Error("keyName has existed");
     }
@@ -171,10 +171,10 @@
   }
 
   void 
-  SecTpmOsx::generateSymmetricKey(const Name & keyName, KeyType keyType, int keySize)
+  SecTpmOsx::generateSymmetricKeyInTpm(const Name & keyName, KeyType keyType, int keySize)
   {
 
-    if(doesKeyExist(keyName, KEY_CLASS_SYMMETRIC))
+    if(doesKeyExistInTpm(keyName, KEY_CLASS_SYMMETRIC))
         throw Error("keyName has existed!");
 
     string keyNameUri =  impl_->toInternalKeyName(keyName, KEY_CLASS_SYMMETRIC);
@@ -220,7 +220,7 @@
   }
 
   Block
-  SecTpmOsx::sign(const uint8_t *data, size_t dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm)
+  SecTpmOsx::signInTpm(const uint8_t *data, size_t dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm)
   {
     _LOG_TRACE("OSXPrivateKeyStorage::Sign");
     
@@ -280,16 +280,16 @@
   }
 
   void
-  SecTpmOsx::sign(Data &data, const Name& keyName, DigestAlgorithm digestAlgorithm)
+  SecTpmOsx::signInTpm(Data &data, const Name& keyName, DigestAlgorithm digestAlgorithm)
   {
     data.setSignatureValue
-      (sign(data.wireEncode().value(),
+      (signInTpm(data.wireEncode().value(),
             data.wireEncode().value_size() - data.getSignature().getValue().size(),
             keyName, digestAlgorithm));
   }
 
   ConstBufferPtr
-  SecTpmOsx::decrypt(const Name & keyName, const uint8_t* data, size_t dataLength, bool sym)
+  SecTpmOsx::decryptInTpm(const Name & keyName, const uint8_t* data, size_t dataLength, bool sym)
   {
     _LOG_TRACE("OSXPrivateKeyStorage::Decrypt");
 
@@ -429,7 +429,7 @@
   // }
 
   ConstBufferPtr
-  SecTpmOsx::encrypt(const Name & keyName, const uint8_t* data, size_t dataLength, bool sym)
+  SecTpmOsx::encryptInTpm(const Name & keyName, const uint8_t* data, size_t dataLength, bool sym)
   {
     _LOG_TRACE("OSXPrivateKeyStorage::Encrypt");
 
@@ -465,7 +465,7 @@
   }
 
   bool
-  SecTpmOsx::doesKeyExist(const Name & keyName, KeyClass keyClass)
+  SecTpmOsx::doesKeyExistInTpm(const Name & keyName, KeyClass keyClass)
   {
     _LOG_TRACE("OSXPrivateKeyStorage::doesKeyExist");
 
diff --git a/src/security/verifier.cpp b/src/security/verifier.cpp
index 992d1f0..67a9273 100644
--- a/src/security/verifier.cpp
+++ b/src/security/verifier.cpp
@@ -72,7 +72,7 @@
 Verifier::verifyData
   (const ptr_lib::shared_ptr<Data>& data, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed, int stepCount)
 {
-  if (policies().requireVerify(*data)) {
+  if (policy().requireVerify(*data)) {
     ptr_lib::shared_ptr<ValidationRequest> nextStep = policy_->checkVerificationPolicy
       (data, stepCount, onVerified, onVerifyFailed);
     if (static_cast<bool>(nextStep))
@@ -86,7 +86,7 @@
            bind(&Verifier::onCertificateInterestTimeout, this, _1, nextStep->retry_, onVerifyFailed, data, nextStep));
       }
   }
-  else if (policies().skipVerifyAndTrust(*data))
+  else if (policy().skipVerifyAndTrust(*data))
     onVerified(data);
   else
     onVerifyFailed(data);
