diff --git a/include/ndn-cpp/security/identity/identity-manager.hpp b/include/ndn-cpp/security/identity/identity-manager.hpp
index 1d6df04..5b07fa0 100644
--- a/include/ndn-cpp/security/identity/identity-manager.hpp
+++ b/include/ndn-cpp/security/identity/identity-manager.hpp
@@ -198,14 +198,26 @@
         
   /**
    * Sign the byte array data based on the certificate name.
-   * @param data The data to be signed.
-   * @param dataLength the length of data.
+   * @param buffer The byte array to be signed.
+   * @param bufferLength the length of buffer.
    * @param certificateName The signing certificate name.
    * @return The generated signature.
    */
   ptr_lib::shared_ptr<Signature>
-  signByCertificate(const uint8_t* data, size_t dataLength, const Name& certificateName);
-    
+  signByCertificate(const uint8_t* buffer, size_t bufferLength, const Name& certificateName);
+
+  /**
+   * Sign the byte array data based on the certificate name.
+   * @param buffer The byte array to be signed.
+   * @param certificateName The signing certificate name.
+   * @return The generated signature.
+   */
+  ptr_lib::shared_ptr<Signature>
+  signByCertificate(const std::vector<uint8_t>& buffer, const Name& certificateName) 
+  {
+    return signByCertificate(&buffer[0], buffer.size(), certificateName);
+  }
+
   /**
    * Sign data packet based on the certificate name.
    * Note: the caller must make sure the timestamp in data is correct, for example with 
diff --git a/include/ndn-cpp/security/key-chain.hpp b/include/ndn-cpp/security/key-chain.hpp
index 40e24fd..758c0fa 100644
--- a/include/ndn-cpp/security/key-chain.hpp
+++ b/include/ndn-cpp/security/key-chain.hpp
@@ -218,6 +218,28 @@
   sign(Data& data, const Name& certificateName, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat());
   
   /**
+   * Sign the byte array using a certificate name and return a Signature object.
+   * @param buffer The byte array to be signed.
+   * @param bufferLength the length of buffer.
+   * @param certificateName The certificate name used to get the signing key and which will be put into KeyLocator.
+   * @return The Signature.
+   */
+  ptr_lib::shared_ptr<Signature> 
+  sign(const uint8_t* buffer, size_t bufferLength, const Name& certificateName);
+
+  /**
+   * Sign the byte array using a certificate name and return a Signature object.
+   * @param buffer The byte array to be signed.
+   * @param certificateName The certificate name used to get the signing key and which will be put into KeyLocator.
+   * @return The Signature.
+   */
+  ptr_lib::shared_ptr<Signature> 
+  sign(const std::vector<uint8_t>& buffer, const Name& certificateName)
+  {
+    return sign(&buffer[0], buffer.size(), certificateName);
+  }
+
+  /**
    * Wire encode the Data object, sign it and set its signature.
    * Note: the caller must make sure the timestamp is correct, for example with 
    * data.getMetaInfo().setTimestampMilliseconds(time(NULL) * 1000.0).
@@ -229,6 +251,28 @@
   signByIdentity(Data& data, const Name& identityName = Name(), WireFormat& wireFormat = *WireFormat::getDefaultWireFormat());
 
   /**
+   * Sign the byte array using an identity name and return a Signature object.
+   * @param buffer The byte array to be signed.
+   * @param bufferLength the length of buffer.
+   * @param identityName The identity name.
+   * @return The Signature.
+   */
+  ptr_lib::shared_ptr<Signature> 
+  signByIdentity(const uint8_t* buffer, size_t bufferLength, const Name& identityName);
+
+  /**
+   * Sign the byte array using an identity name and return a Signature object.
+   * @param buffer The byte array to be signed.
+   * @param identityName The identity name.
+   * @return The Signature.
+   */
+  ptr_lib::shared_ptr<Signature> 
+  signByIdentity(const std::vector<uint8_t>& buffer, const Name& identityName)
+  {
+    return signByIdentity(&buffer[0], buffer.size(), identityName);
+  }
+
+  /**
    * Check the signature on the Data object and call either onVerify or onVerifyFailed. 
    * We use callback functions because verify may fetch information to check the signature.
    * @param data The Data object with the signature to check. It is an error if data does not have a wireEncoding. 
diff --git a/ndn-cpp/security/identity/identity-manager.cpp b/ndn-cpp/security/identity/identity-manager.cpp
index c925f8f..eb9966e 100644
--- a/ndn-cpp/security/identity/identity-manager.cpp
+++ b/ndn-cpp/security/identity/identity-manager.cpp
@@ -166,13 +166,13 @@
 }
   
 ptr_lib::shared_ptr<Signature>
-IdentityManager::signByCertificate(const uint8_t* data, size_t dataLength, const Name& certificateName)
+IdentityManager::signByCertificate(const uint8_t* buffer, size_t bufferLength, const Name& certificateName)
 {    
   Name keyName = identityStorage_->getKeyNameForCertificate(certificateName);
   
   shared_ptr<PublicKey> publicKey = privateKeyStorage_->getPublicKey(keyName.toUri());
 
-  Blob sigBits = privateKeyStorage_->sign(data, dataLength, 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());
diff --git a/ndn-cpp/security/key-chain.cpp b/ndn-cpp/security/key-chain.cpp
index 3fc3f77..c17960d 100644
--- a/ndn-cpp/security/key-chain.cpp
+++ b/ndn-cpp/security/key-chain.cpp
@@ -104,6 +104,12 @@
   identityManager_->signByCertificate(data, certificateName, wireFormat);
 }
 
+shared_ptr<Signature> 
+KeyChain::sign(const uint8_t* buffer, size_t bufferLength, const Name& certificateName)
+{
+  return identityManager_->signByCertificate(buffer, bufferLength, certificateName);
+}
+
 void 
 KeyChain::signByIdentity(Data& data, const Name& identityName, WireFormat& wireFormat)
 {
@@ -128,6 +134,17 @@
   identityManager_->signByCertificate(data, signingCertificateName);  
 }
 
+  shared_ptr<Signature> 
+  KeyChain::signByIdentity(const uint8_t* buffer, size_t bufferLength, const Name& identityName)
+  {
+    Name signingCertificateName = identityManager_->getDefaultCertificateNameForIdentity(identityName);
+    
+    if (signingCertificateName.size() == 0)
+      throw SecurityException("No qualified certificate name found!");
+
+    return identityManager_->signByCertificate(buffer, bufferLength, signingCertificateName);
+  }
+
 void
 KeyChain::verifyData
   (const shared_ptr<Data>& data, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed, int stepCount)
