diff --git a/ndn-cpp/security/identity/memory-private-key-storage.cpp b/ndn-cpp/security/identity/memory-private-key-storage.cpp
index 56054af..0fef285 100644
--- a/ndn-cpp/security/identity/memory-private-key-storage.cpp
+++ b/ndn-cpp/security/identity/memory-private-key-storage.cpp
@@ -19,7 +19,7 @@
 }
 
 void MemoryPrivateKeyStorage::setKeyPairForKeyName
-  (const Name& keyName, unsigned char *publicKeyDer, size_t publicKeyDerLength, unsigned char *privateKeyDer, 
+  (const Name& keyName, uint8_t *publicKeyDer, size_t publicKeyDerLength, uint8_t *privateKeyDer, 
    size_t privateKeyDerLength)
 {
   publicKeyStore_[keyName.toUri()] = PublicKey::fromDer(Blob(publicKeyDer, publicKeyDerLength));
@@ -44,15 +44,15 @@
 }
 
 Blob 
-MemoryPrivateKeyStorage::sign(const unsigned char *data, unsigned int dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm)
+MemoryPrivateKeyStorage::sign(const uint8_t *data, unsigned int dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm)
 {
   if (digestAlgorithm != DIGEST_ALGORITHM_SHA256)
     return Blob();
 
-  unsigned char digest[SHA256_DIGEST_LENGTH];
+  uint8_t digest[SHA256_DIGEST_LENGTH];
   ndn_digestSha256(data, dataLength, digest);
   // TODO: use RSA_size to get the proper size of the signature buffer.
-  unsigned char signatureBits[1000];
+  uint8_t signatureBits[1000];
   unsigned int signatureBitsLength;
   
   // Find the private key and sign.
@@ -66,7 +66,7 @@
 }
 
 Blob 
-MemoryPrivateKeyStorage::decrypt(const Name& keyName, const unsigned char* data, unsigned int dataLength, bool isSymmetric)
+MemoryPrivateKeyStorage::decrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric)
 {
 #if 1
   throw std::runtime_error("MemoryPrivateKeyStorage::decrypt not implemented");
@@ -74,7 +74,7 @@
 }
 
 Blob
-MemoryPrivateKeyStorage::encrypt(const Name& keyName, const unsigned char* data, unsigned int dataLength, bool isSymmetric)
+MemoryPrivateKeyStorage::encrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric)
 {
 #if 1
   throw std::runtime_error("MemoryPrivateKeyStorage::encrypt not implemented");
@@ -101,10 +101,10 @@
     return false;
 }
 
-MemoryPrivateKeyStorage::RsaPrivateKey::RsaPrivateKey(unsigned char *keyDer, size_t keyDerLength)
+MemoryPrivateKeyStorage::RsaPrivateKey::RsaPrivateKey(uint8_t *keyDer, size_t keyDerLength)
 {
   // Use a temporary pointer since d2i updates it.
-  const unsigned char *derPointer = keyDer;
+  const uint8_t *derPointer = keyDer;
   privateKey_ = d2i_RSAPrivateKey(NULL, &derPointer, keyDerLength);
   if (!privateKey_)
     throw SecurityException("RsaPrivateKey constructor: Error decoding private key DER");
diff --git a/ndn-cpp/security/identity/memory-private-key-storage.hpp b/ndn-cpp/security/identity/memory-private-key-storage.hpp
index d97d2a8..b44f2ba 100644
--- a/ndn-cpp/security/identity/memory-private-key-storage.hpp
+++ b/ndn-cpp/security/identity/memory-private-key-storage.hpp
@@ -36,7 +36,7 @@
    * @param privateKeyDerLength The length of privateKeyDer.
    */
   void setKeyPairForKeyName
-    (const Name& keyName, unsigned char *publicKeyDer, size_t publicKeyDerLength, unsigned char *privateKeyDer, 
+    (const Name& keyName, uint8_t *publicKeyDer, size_t publicKeyDerLength, uint8_t *privateKeyDer, 
      size_t privateKeyDerLength);
   
   /**
@@ -65,7 +65,7 @@
    * @return The signature, or a null pointer if signing fails.
    */  
   virtual Blob 
-  sign(const unsigned char *data, unsigned int dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm);
+  sign(const uint8_t *data, unsigned int dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm);
     
   /**
    * Decrypt data.
@@ -76,7 +76,7 @@
    * @return The decrypted data.
    */
   virtual Blob 
-  decrypt(const Name& keyName, const unsigned char* data, unsigned int dataLength, bool isSymmetric);
+  decrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric);
 
   /**
    * Encrypt data.
@@ -87,7 +87,7 @@
    * @return The encrypted data.
    */
   virtual Blob
-  encrypt(const Name& keyName, const unsigned char* data, unsigned int dataLength, bool isSymmetric);
+  encrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric);
 
   /**
    * @brief Generate a symmetric key.
@@ -113,7 +113,7 @@
    */
   class RsaPrivateKey {
   public:
-    RsaPrivateKey(unsigned char *keyDer, size_t keyDerLength);
+    RsaPrivateKey(uint8_t *keyDer, size_t keyDerLength);
     
     ~RsaPrivateKey();
     
diff --git a/ndn-cpp/security/identity/private-key-storage.hpp b/ndn-cpp/security/identity/private-key-storage.hpp
index 3b71d37..0e24eec 100644
--- a/ndn-cpp/security/identity/private-key-storage.hpp
+++ b/ndn-cpp/security/identity/private-key-storage.hpp
@@ -50,7 +50,7 @@
    * @return The signature, or a null pointer if signing fails.
    */  
   virtual Blob 
-  sign(const unsigned char *data, unsigned int dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256) = 0;
+  sign(const uint8_t *data, unsigned int dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256) = 0;
     
   Blob 
   sign(const Blob& data, const Name& keyName, DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256)
@@ -67,7 +67,7 @@
    * @return The decrypted data.
    */
   virtual Blob 
-  decrypt(const Name& keyName, const unsigned char* data, unsigned int dataLength, bool isSymmetric = false) = 0;
+  decrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric = false) = 0;
 
   Blob 
   decrypt(const Name& keyName, const Blob& data, bool isSymmetric = false)
@@ -84,7 +84,7 @@
    * @return The encrypted data.
    */
   virtual Blob
-  encrypt(const Name& keyName, const unsigned char* data, unsigned int dataLength, bool isSymmetric = false) = 0;
+  encrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric = false) = 0;
 
   Blob
   encrypt(const Name& keyName, const Blob& data, bool isSymmetric = false)
