diff --git a/src/security/identity/basic-identity-storage.cpp b/src/security/identity/basic-identity-storage.cpp
index 85af9a9..46a98bf 100644
--- a/src/security/identity/basic-identity-storage.cpp
+++ b/src/security/identity/basic-identity-storage.cpp
@@ -26,7 +26,6 @@
 INIT_LOGGER("BasicIdentityStorage");
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn
 {
@@ -445,7 +444,7 @@
   sqlite3_finalize(statement);
 }
 
-shared_ptr<Data> 
+ptr_lib::shared_ptr<Data> 
 BasicIdentityStorage::getCertificate(const Name &certificateName, bool allowAny)
 {
   if (doesCertificateExist(certificateName)) {
@@ -469,7 +468,7 @@
       
     int res = sqlite3_step(statement);
       
-    shared_ptr<Data> data(new Data());
+    ptr_lib::shared_ptr<Data> data(new Data());
 
     if (res == SQLITE_ROW)
       data->wireDecode((const uint8_t*)sqlite3_column_blob(statement, 0), sqlite3_column_bytes(statement, 0));            
@@ -479,7 +478,7 @@
   }
   else {
     _LOG_DEBUG("Certificate does not exist!");
-    return shared_ptr<Data>();
+    return ptr_lib::shared_ptr<Data>();
   }
 }
 
diff --git a/src/security/identity/identity-manager.cpp b/src/security/identity/identity-manager.cpp
index 28e1d10..88e6782 100644
--- a/src/security/identity/identity-manager.cpp
+++ b/src/security/identity/identity-manager.cpp
@@ -26,7 +26,6 @@
 INIT_LOGGER("ndn.security.IdentityManager")
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
@@ -41,7 +40,7 @@
   Name keyName = generateRSAKeyPairAsDefault(identityName, true);
 
   _LOG_DEBUG("Create self-signed certificate");
-  shared_ptr<IdentityCertificate> selfCert = selfSign(keyName); 
+  ptr_lib::shared_ptr<IdentityCertificate> selfCert = selfSign(keyName); 
   
   _LOG_DEBUG("Add self-signed certificate as default");
 
@@ -63,7 +62,7 @@
   privateKeyStorage_->generateKeyPair(keyName.toUri(), keyType, keySize);
 
   _LOG_DEBUG("Create a key record in public storage");
-  shared_ptr<PublicKey> pubKey = privateKeyStorage_->getPublicKey(keyName.toUri());
+  ptr_lib::shared_ptr<PublicKey> pubKey = privateKeyStorage_->getPublicKey(keyName.toUri());
   identityStorage_->addKey(keyName, keyType, pubKey->getKeyDer());
 
   return keyName;
@@ -96,9 +95,9 @@
   Name keyName = getKeyNameFromCertificatePrefix(certificatePrefix);
   
   Blob keyBlob = identityStorage_->getKey(keyName);
-  shared_ptr<PublicKey> publicKey = PublicKey::fromDer(keyBlob);
+  ptr_lib::shared_ptr<PublicKey> publicKey = PublicKey::fromDer(keyBlob);
 
-  shared_ptr<IdentityCertificate> certificate = createIdentityCertificate
+  ptr_lib::shared_ptr<IdentityCertificate> certificate = createIdentityCertificate
     (certificatePrefix, *publicKey,  signerCertificateName, notBefore, notAfter);
 
   identityStorage_->addCertificate(*certificate);
@@ -113,7 +112,7 @@
                                            const MillisecondsSince1970& notBefore,
                                            const MillisecondsSince1970& notAfter)
 {
-  shared_ptr<IdentityCertificate> certificate(new IdentityCertificate());
+  ptr_lib::shared_ptr<IdentityCertificate> certificate(new IdentityCertificate());
   Name keyName = getKeyNameFromCertificatePrefix(certificatePrefix);
   
   Name certificateName = certificatePrefix;
@@ -131,7 +130,7 @@
   certificate->addSubjectDescription(CertificateSubjectDescription("2.5.4.41", keyName.toUri()));
   certificate->encode();
 
-  shared_ptr<Sha256WithRsaSignature> sha256Sig(new Sha256WithRsaSignature());
+  ptr_lib::shared_ptr<Sha256WithRsaSignature> sha256Sig(new Sha256WithRsaSignature());
 
   KeyLocator keyLocator;    
   keyLocator.setType(ndn_KeyLocatorType_KEYNAME);
@@ -144,7 +143,7 @@
 
   SignedBlob unsignedData = certificate->wireEncode();
 
-  shared_ptr<IdentityCertificate> signerCertificate = getCertificate(signerCertificateName);
+  ptr_lib::shared_ptr<IdentityCertificate> signerCertificate = getCertificate(signerCertificateName);
   Name signerkeyName = signerCertificate->getPublicKeyName();
 
   Blob sigBits = privateKeyStorage_->sign(unsignedData, signerkeyName);
@@ -189,12 +188,12 @@
 IdentityManager::signByCertificate(const uint8_t* buffer, size_t bufferLength, const Name& certificateName)
 {
   Name keyName = IdentityCertificate::certificateNameToPublicKeyName(certificateName);
-  shared_ptr<PublicKey> publicKey = privateKeyStorage_->getPublicKey(keyName.toUri());
+  ptr_lib::shared_ptr<PublicKey> publicKey = privateKeyStorage_->getPublicKey(keyName.toUri());
 
   Blob sigBits = privateKeyStorage_->sign(buffer, bufferLength, keyName.toUri());
 
   //For temporary usage, we support RSA + SHA256 only, but will support more.
-  shared_ptr<Sha256WithRsaSignature> sha256Sig(new Sha256WithRsaSignature());
+  ptr_lib::shared_ptr<Sha256WithRsaSignature> sha256Sig(new Sha256WithRsaSignature());
 
   KeyLocator keyLocator;    
   keyLocator.setType(ndn_KeyLocatorType_KEYNAME);
@@ -211,7 +210,7 @@
 IdentityManager::signByCertificate(Data &data, const Name &certificateName, WireFormat& wireFormat)
 {
   Name keyName = IdentityCertificate::certificateNameToPublicKeyName(certificateName);
-  shared_ptr<PublicKey> publicKey = privateKeyStorage_->getPublicKey(keyName);
+  ptr_lib::shared_ptr<PublicKey> publicKey = privateKeyStorage_->getPublicKey(keyName);
 
   // For temporary usage, we support RSA + SHA256 only, but will support more.
   data.setSignature(Sha256WithRsaSignature());
@@ -236,17 +235,17 @@
   data.wireEncode(wireFormat);
 }
 
-shared_ptr<IdentityCertificate>
+ptr_lib::shared_ptr<IdentityCertificate>
 IdentityManager::selfSign(const Name& keyName)
 {
-  shared_ptr<IdentityCertificate> certificate(new IdentityCertificate());
+  ptr_lib::shared_ptr<IdentityCertificate> certificate(new IdentityCertificate());
   
   Name certificateName = keyName.getSubName(0, keyName.size() - 1);
   certificateName.append("KEY").append(keyName.get(keyName.size() - 1)).append("ID-CERT").append("0");
   certificate->setName(certificateName);
 
   Blob keyBlob = identityStorage_->getKey(keyName);
-  shared_ptr<PublicKey> publicKey = PublicKey::fromDer(keyBlob);
+  ptr_lib::shared_ptr<PublicKey> publicKey = PublicKey::fromDer(keyBlob);
 
 #if NDN_CPP_HAVE_GMTIME_SUPPORT
   time_t nowSeconds = time(NULL);
@@ -268,7 +267,7 @@
   certificate->addSubjectDescription(CertificateSubjectDescription("2.5.4.41", keyName.toUri()));
   certificate->encode();
 
-  shared_ptr<Sha256WithRsaSignature> sha256Sig(new Sha256WithRsaSignature());
+  ptr_lib::shared_ptr<Sha256WithRsaSignature> sha256Sig(new Sha256WithRsaSignature());
 
   KeyLocator keyLocator;    
   keyLocator.setType(ndn_KeyLocatorType_KEYNAME);
diff --git a/src/security/identity/memory-identity-storage.cpp b/src/security/identity/memory-identity-storage.cpp
index c5fb409..26341fa 100644
--- a/src/security/identity/memory-identity-storage.cpp
+++ b/src/security/identity/memory-identity-storage.cpp
@@ -14,7 +14,6 @@
 #include <ndn-cpp/security/identity/memory-identity-storage.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
@@ -64,13 +63,13 @@
   if (doesKeyExist(keyName))
     throw SecurityException("a key with the same name already exists!");
   
-  keyStore_[keyName.toUri()] = make_shared<KeyRecord>(keyType, publicKeyDer);
+  keyStore_[keyName.toUri()] = ptr_lib::make_shared<KeyRecord>(keyType, publicKeyDer);
 }
 
 Blob
 MemoryIdentityStorage::getKey(const Name& keyName)
 {
-  map<string, shared_ptr<KeyRecord> >::iterator record = keyStore_.find(keyName.toUri());
+  map<string, ptr_lib::shared_ptr<KeyRecord> >::iterator record = keyStore_.find(keyName.toUri());
   if (record == keyStore_.end())
     // Not found.  Silently return null.
     return Blob();
@@ -130,9 +129,9 @@
   map<string, Blob>::iterator record = certificateStore_.find(certificateName.toUri());
   if (record == certificateStore_.end())
     // Not found.  Silently return null.
-    return shared_ptr<Data>();
+    return ptr_lib::shared_ptr<Data>();
   
-  shared_ptr<Data> data(new Data());
+  ptr_lib::shared_ptr<Data> data(new Data());
   data->wireDecode(*record->second);
   return data;
 }
diff --git a/src/security/identity/memory-private-key-storage.cpp b/src/security/identity/memory-private-key-storage.cpp
index b2bbcb5..7c3a2e0 100644
--- a/src/security/identity/memory-private-key-storage.cpp
+++ b/src/security/identity/memory-private-key-storage.cpp
@@ -13,7 +13,6 @@
 #include <ndn-cpp/security/identity/memory-private-key-storage.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
@@ -26,7 +25,7 @@
    size_t privateKeyDerLength)
 {
   publicKeyStore_[keyName.toUri()] = PublicKey::fromDer(Blob(publicKeyDer, publicKeyDerLength));
-  privateKeyStore_[keyName.toUri()] = make_shared<RsaPrivateKey>(privateKeyDer, privateKeyDerLength);
+  privateKeyStore_[keyName.toUri()] = ptr_lib::make_shared<RsaPrivateKey>(privateKeyDer, privateKeyDerLength);
 }
 
 void 
@@ -37,10 +36,10 @@
 #endif
 }
 
-shared_ptr<PublicKey> 
+ptr_lib::shared_ptr<PublicKey> 
 MemoryPrivateKeyStorage::getPublicKey(const Name& keyName)
 {
-  map<string, shared_ptr<PublicKey> >::iterator publicKey = publicKeyStore_.find(keyName.toUri());
+  map<string, ptr_lib::shared_ptr<PublicKey> >::iterator publicKey = publicKeyStore_.find(keyName.toUri());
   if (publicKey == publicKeyStore_.end())
     throw SecurityException(string("MemoryPrivateKeyStorage: Cannot find public key ") + keyName.toUri());
   return publicKey->second;
@@ -59,7 +58,7 @@
   unsigned int signatureBitsLength;
   
   // Find the private key and sign.
-  map<string, shared_ptr<RsaPrivateKey> >::iterator privateKey = privateKeyStore_.find(keyName.toUri());
+  map<string, ptr_lib::shared_ptr<RsaPrivateKey> >::iterator privateKey = privateKeyStore_.find(keyName.toUri());
   if (privateKey == privateKeyStore_.end())
     throw SecurityException(string("MemoryPrivateKeyStorage: Cannot find private key ") + keyName.toUri());
   if (!RSA_sign(NID_sha256, digest, sizeof(digest), signatureBits, &signatureBitsLength, privateKey->second->getPrivateKey()))
diff --git a/src/security/identity/osx-private-key-storage.cpp b/src/security/identity/osx-private-key-storage.cpp
index aa6b7b8..e504616 100644
--- a/src/security/identity/osx-private-key-storage.cpp
+++ b/src/security/identity/osx-private-key-storage.cpp
@@ -18,7 +18,6 @@
 #include <ndn-cpp/security/security-exception.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 INIT_LOGGER("ndn.OSXPrivateKeyStorage");
 
@@ -124,7 +123,7 @@
         throw SecurityException("Fail to create a symmetric key");
   }
 
-  shared_ptr<PublicKey> OSXPrivateKeyStorage::getPublicKey(const Name & keyName)
+  ptr_lib::shared_ptr<PublicKey> OSXPrivateKeyStorage::getPublicKey(const Name & keyName)
   {
     _LOG_TRACE("OSXPrivateKeyStorage::getPublickey");
 
