diff --git a/src/security/signature-sha256-with-rsa.hpp b/src/security/signature-sha256-with-rsa.hpp
index 8acda6e..bd3fd32 100644
--- a/src/security/signature-sha256-with-rsa.hpp
+++ b/src/security/signature-sha256-with-rsa.hpp
@@ -22,67 +22,38 @@
 #ifndef NDN_SECURITY_SIGNATURE_SHA256_WITH_RSA_HPP
 #define NDN_SECURITY_SIGNATURE_SHA256_WITH_RSA_HPP
 
-#include "../data.hpp"
-#include "../encoding/tlv.hpp"
+#include "signature-with-public-key.hpp"
 
 namespace ndn {
 
 /**
- * Representing of SHA256-with-RSA signature in a data packet.
+ * Represent a SHA256-with-RSA signature.
  */
-class SignatureSha256WithRsa : public Signature
+class SignatureSha256WithRsa : public SignatureWithPublicKey
 {
 public:
-  class Error : public Signature::Error
+  class Error : public SignatureWithPublicKey::Error
   {
   public:
     explicit
     Error(const std::string& what)
-      : Signature::Error(what)
+      : SignatureWithPublicKey::Error(what)
     {
     }
   };
 
   SignatureSha256WithRsa()
+    : SignatureWithPublicKey(Tlv::SignatureSha256WithRsa)
   {
-    m_info = Block(Tlv::SignatureInfo);
-
-    m_type = Signature::Sha256WithRsa;
-    m_info.push_back(nonNegativeIntegerBlock(Tlv::SignatureType, Tlv::SignatureSha256WithRsa));
-    m_info.push_back(m_keyLocator.wireEncode());
   }
 
+  explicit
   SignatureSha256WithRsa(const Signature& signature)
-    : Signature(signature)
+    : SignatureWithPublicKey(signature)
   {
     if (getType() != Signature::Sha256WithRsa)
       throw Error("Incorrect signature type");
-
-    m_info.parse();
-    Block::element_const_iterator i = m_info.find(Tlv::KeyLocator);
-    if (i != m_info.elements_end())
-      {
-        m_keyLocator.wireDecode(*i);
-      }
   }
-
-  const KeyLocator&
-  getKeyLocator() const
-  {
-    return m_keyLocator;
-  }
-
-  void
-  setKeyLocator(const KeyLocator& keyLocator)
-  {
-    m_keyLocator = keyLocator;
-
-    m_info.remove(ndn::Tlv::KeyLocator);
-    m_info.push_back(m_keyLocator.wireEncode());
-  }
-
-private:
-  KeyLocator m_keyLocator;
 };
 
 } // namespace ndn
