diff --git a/docs/release-notes/release-notes-0.2.0.rst b/docs/release-notes/release-notes-0.2.0.rst
index 8529024..194c94b 100644
--- a/docs/release-notes/release-notes-0.2.0.rst
+++ b/docs/release-notes/release-notes-0.2.0.rst
@@ -37,14 +37,14 @@
 
   + New :ndn-cxx:`SignatureSha256WithEcdsa` signature type
 
-  + Updates in :ndn-cxx:`Signature` data structure to reflect changes in `NDN-TLV spec
-    0.1.1 <https://named-data.net/doc/NDN-packet-spec/0.1.1/>`_
+  + Updates in ``Signature`` data structure to reflect changes in the `NDN-TLV spec v0.1.1
+    <https://named-data.net/doc/NDN-packet-spec/0.1.1/>`_
 
 - **Wire encoding**
 
-  + ``Data::getFullName()`` method to get the Data packet name including the implicit digest
+  + :ndn-cxx:`Data::getFullName` method to get the Data packet name including the implicit digest
 
-  + ``Name::getSuccessor()`` method to get name successor (:issue:`1677`)
+  + :ndn-cxx:`Name::getSuccessor` method to get name successor (:issue:`1677`)
 
   + New in-wire refreshing of Interest's nonce (:issue:`1758`)
 
@@ -78,7 +78,7 @@
 
 - **Base**
 
-  + Serialization of socket write operations (:issue:`1707`)
+  + Serialization of socket write operations (:issue:`1769`)
 
   + Enforcing limit on Interest and Data packet size in :ndn-cxx:`Face::expressInterest` and
     :ndn-cxx:`Face::put` methods (:issue:`1774`)
@@ -86,7 +86,7 @@
   + Cleaning up transport state on communication failure, so Face can try to reconnect
     in the future
 
-  + Fix bug in ``Face::removePendingInterest`` (:issue:`1917`)
+  + Fix bug in ``Face::removePendingInterest()`` (:issue:`1917`)
 
 - **Wire encoding**
 
diff --git a/ndn-cxx/data.cpp b/ndn-cxx/data.cpp
index f5eb8b9..52ae571 100644
--- a/ndn-cxx/data.cpp
+++ b/ndn-cxx/data.cpp
@@ -20,7 +20,6 @@
  */
 
 #include "ndn-cxx/data.hpp"
-#include "ndn-cxx/signature.hpp"
 #include "ndn-cxx/util/sha256.hpp"
 
 namespace ndn {
@@ -291,21 +290,6 @@
   return *this;
 }
 
-Signature
-Data::getSignature() const
-{
-  return Signature(m_signatureInfo, m_signatureValue);
-}
-
-Data&
-Data::setSignature(const Signature& signature)
-{
-  m_signatureInfo = signature.getSignatureInfo();
-  m_signatureValue = signature.getValue();
-  resetWire();
-  return *this;
-}
-
 Data&
 Data::setSignatureInfo(const SignatureInfo& info)
 {
diff --git a/ndn-cxx/data.hpp b/ndn-cxx/data.hpp
index 838df88..beca2cd 100644
--- a/ndn-cxx/data.hpp
+++ b/ndn-cxx/data.hpp
@@ -31,8 +31,6 @@
 
 namespace ndn {
 
-class Signature;
-
 /** @brief Represents a %Data packet.
  *  @sa https://named-data.net/doc/NDN-packet-spec/0.3/data.html
  */
@@ -210,21 +208,6 @@
   Data&
   unsetContent();
 
-  /** @brief Get Signature
-   *  @deprecated Use getSignatureInfo and getSignatureValue
-   */
-  [[deprecated("use getSignatureInfo and getSignatureValue")]]
-  Signature
-  getSignature() const;
-
-  /** @brief Set Signature
-   *  @deprecated Use setSignatureInfo and setSignatureValue
-   *  @return a reference to this Data, to allow chaining
-   */
-  [[deprecated("use setSignatureInfo and setSignatureValue")]]
-  Data&
-  setSignature(const Signature& signature);
-
   /** @brief Get SignatureInfo
    */
   const SignatureInfo&
@@ -333,7 +316,7 @@
   Block m_signatureValue;
 
   mutable Block m_wire;
-  mutable Name m_fullName; ///< cached FullName computed from m_wire
+  mutable Name m_fullName; // cached FullName computed from m_wire
 };
 
 #ifndef DOXYGEN
diff --git a/ndn-cxx/security/digest-sha256.cpp b/ndn-cxx/security/digest-sha256.cpp
deleted file mode 100644
index 6332d1b..0000000
--- a/ndn-cxx/security/digest-sha256.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2019 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "ndn-cxx/security/digest-sha256.hpp"
-
-namespace ndn {
-
-DigestSha256::DigestSha256()
-  : Signature(SignatureInfo(tlv::DigestSha256))
-{
-}
-
-DigestSha256::DigestSha256(const Signature& signature)
-  : Signature(signature)
-{
-  if (getType() != tlv::DigestSha256)
-    NDN_THROW(Error("Cannot construct DigestSha256 from SignatureType " + to_string(getType())));
-}
-
-} // namespace ndn
diff --git a/ndn-cxx/security/digest-sha256.hpp b/ndn-cxx/security/digest-sha256.hpp
deleted file mode 100644
index 3f2a2c7..0000000
--- a/ndn-cxx/security/digest-sha256.hpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2020 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#ifndef NDN_SECURITY_DIGEST_SHA256_HPP
-#define NDN_SECURITY_DIGEST_SHA256_HPP
-
-#include "ndn-cxx/signature.hpp"
-
-namespace ndn {
-
-/** @brief Represents a signature of DigestSha256 type
- *  @deprecated Use SignatureInfo with type DigestSha256 instead
- *
- *  This signature type provides integrity protection using SHA-256 digest, but no provenance of a
- *  Data packet or any kind of guarantee that packet is from the original source.
- */
-class
-#ifndef DOXYGEN // Older versions of doxygen can't parse deprecated decorators on classes
-[[deprecated("use SignatureInfo with type DigestSha256 instead")]]
-#endif // DOXYGEN
-DigestSha256 : public Signature
-{
-public:
-  /** @brief Create empty DigestSha256 signature
-   */
-  DigestSha256();
-
-  /** @brief Convert base Signature to DigestSha256 signature
-   *  @throw Signature::Error SignatureType is not DigestSha256
-   */
-  explicit
-  DigestSha256(const Signature& signature);
-};
-
-} // namespace ndn
-
-#endif // NDN_SECURITY_DIGEST_SHA256_HPP
diff --git a/ndn-cxx/security/key-chain.cpp b/ndn-cxx/security/key-chain.cpp
index 8fbf9cf..c6ec639 100644
--- a/ndn-cxx/security/key-chain.cpp
+++ b/ndn-cxx/security/key-chain.cpp
@@ -143,16 +143,6 @@
   return s_defaultTpmLocator;
 }
 
-
-// Other defaults
-
-const SigningInfo&
-KeyChain::getDefaultSigningInfo()
-{
-  static SigningInfo signingInfo;
-  return signingInfo;
-}
-
 const KeyParams&
 KeyChain::getDefaultKeyParams()
 {
@@ -497,17 +487,6 @@
   }
 }
 
-Block
-KeyChain::sign(const uint8_t* buffer, size_t bufferLength, const SigningInfo& params)
-{
-  Name keyName;
-  SignatureInfo sigInfo;
-  std::tie(keyName, sigInfo) = prepareSignatureInfo(params);
-
-  return Block(tlv::SignatureValue,
-               sign({{buffer, bufferLength}}, keyName, params.getDigestAlgorithm()));
-}
-
 // public: PIB/TPM creation helpers
 
 static inline std::tuple<std::string/*type*/, std::string/*location*/>
@@ -534,7 +513,7 @@
 
   auto pibFactory = getPibFactories().find(pibScheme);
   if (pibFactory == getPibFactories().end()) {
-    NDN_THROW(KeyChain::Error("PIB scheme `" + pibScheme + "` is not supported"));
+    NDN_THROW(Error("PIB scheme `" + pibScheme + "` is not supported"));
   }
 
   return std::make_tuple(pibScheme, pibLocation);
@@ -559,9 +538,10 @@
   if (tpmScheme.empty()) {
     tpmScheme = getDefaultTpmScheme();
   }
+
   auto tpmFactory = getTpmFactories().find(tpmScheme);
   if (tpmFactory == getTpmFactories().end()) {
-    NDN_THROW(KeyChain::Error("TPM scheme `" + tpmScheme + "` is not supported"));
+    NDN_THROW(Error("TPM scheme `" + tpmScheme + "` is not supported"));
   }
 
   return std::make_tuple(tpmScheme, tpmLocation);
diff --git a/ndn-cxx/security/key-chain.hpp b/ndn-cxx/security/key-chain.hpp
index 2c8b079..123f1eb 100644
--- a/ndn-cxx/security/key-chain.hpp
+++ b/ndn-cxx/security/key-chain.hpp
@@ -96,17 +96,20 @@
   ~KeyChain();
 
   const Pib&
-  getPib() const
+  getPib() const noexcept
   {
     return *m_pib;
   }
 
   const Tpm&
-  getTpm() const
+  getTpm() const noexcept
   {
     return *m_tpm;
   }
 
+  static const KeyParams&
+  getDefaultKeyParams();
+
 public: // Identity management
   /**
    * @brief Create an identity @p identityName.
@@ -287,25 +290,6 @@
   void
   sign(Interest& interest, const SigningInfo& params = SigningInfo());
 
-  /**
-   * @brief Sign buffer according to the supplied signing information @p params
-   * @deprecated Sign Interests and Data directly
-   *
-   * If @p params refers to an identity, the method selects the default key of the identity.
-   * If @p params refers to a key or certificate, the method select the corresponding key.
-   *
-   * @param buffer The buffer to sign
-   * @param bufferLength The buffer size
-   * @param params The signing parameters
-   * @return SignatureValue TLV block
-   * @throw Error Signing failed
-   * @see SigningInfo
-   * @see SignatureInfo
-   */
-  [[deprecated("sign Interests and Data directly")]]
-  Block
-  sign(const uint8_t* buffer, size_t bufferLength, const SigningInfo& params = SigningInfo());
-
 public: // export & import
   /**
    * @brief Export a certificate and its corresponding private key.
@@ -343,13 +327,6 @@
   void
   importPrivateKey(const Name& keyName, shared_ptr<transform::PrivateKey> key);
 
-NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-  /**
-   * @brief Derive SignatureTypeValue according to key type and digest algorithm.
-   */
-  static tlv::SignatureTypeValue
-  getSignatureType(KeyType keyType, DigestAlgorithm digestAlgorithm);
-
 public: // PIB & TPM backend registry
   /**
    * @brief Register a new PIB backend
@@ -359,7 +336,12 @@
    */
   template<class PibBackendType>
   static void
-  registerPibBackend(const std::string& scheme);
+  registerPibBackend(const std::string& scheme)
+  {
+    getPibFactories().emplace(scheme, [] (const std::string& locator) {
+      return shared_ptr<pib::PibImpl>(new PibBackendType(locator));
+    });
+  }
 
   /**
    * @brief Register a new TPM backend
@@ -369,11 +351,16 @@
    */
   template<class TpmBackendType>
   static void
-  registerTpmBackend(const std::string& scheme);
+  registerTpmBackend(const std::string& scheme)
+  {
+    getTpmFactories().emplace(scheme, [] (const std::string& locator) {
+      return unique_ptr<tpm::BackEnd>(new TpmBackendType(locator));
+    });
+  }
 
 private:
-  typedef std::map<std::string, function<std::shared_ptr<pib::PibImpl>(const std::string& location)>> PibFactories;
-  typedef std::map<std::string, function<unique_ptr<tpm::BackEnd>(const std::string& location)>> TpmFactories;
+  using PibFactories = std::map<std::string, std::function<shared_ptr<pib::PibImpl>(const std::string&)>>;
+  using TpmFactories = std::map<std::string, std::function<unique_ptr<tpm::BackEnd>(const std::string&)>>;
 
   static PibFactories&
   getPibFactories();
@@ -412,6 +399,12 @@
   static const std::string&
   getDefaultTpmLocator();
 
+  /**
+   * @brief Derive SignatureTypeValue according to key type and digest algorithm.
+   */
+  static tlv::SignatureTypeValue
+  getSignatureType(KeyType keyType, DigestAlgorithm digestAlgorithm);
+
 private: // signing
   /**
    * @brief Generate a self-signed certificate for a public key.
@@ -439,43 +432,14 @@
   ConstBufferPtr
   sign(const InputBuffers& bufs, const Name& keyName, DigestAlgorithm digestAlgorithm) const;
 
-public:
-  /**
-   * @deprecated Use default constructor for SigningInfo
-   */
-  [[deprecated("use default constructor for SigningInfo")]]
-  static const SigningInfo&
-  getDefaultSigningInfo();
-
-  static const KeyParams&
-  getDefaultKeyParams();
-
 private:
-  std::unique_ptr<Pib> m_pib;
-  std::unique_ptr<Tpm> m_tpm;
+  unique_ptr<Pib> m_pib;
+  unique_ptr<Tpm> m_tpm;
 
   static std::string s_defaultPibLocator;
   static std::string s_defaultTpmLocator;
 };
 
-template<class PibType>
-inline void
-KeyChain::registerPibBackend(const std::string& scheme)
-{
-  getPibFactories().emplace(scheme, [] (const std::string& locator) {
-      return std::shared_ptr<pib::PibImpl>(new PibType(locator));
-    });
-}
-
-template<class TpmType>
-inline void
-KeyChain::registerTpmBackend(const std::string& scheme)
-{
-  getTpmFactories().emplace(scheme, [] (const std::string& locator) {
-      return unique_ptr<tpm::BackEnd>(new TpmType(locator));
-    });
-}
-
 /**
  * @brief Register Pib backend class in KeyChain
  *
diff --git a/ndn-cxx/security/signature-sha256-with-ecdsa.cpp b/ndn-cxx/security/signature-sha256-with-ecdsa.cpp
deleted file mode 100644
index 4c92514..0000000
--- a/ndn-cxx/security/signature-sha256-with-ecdsa.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2019 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "ndn-cxx/security/signature-sha256-with-ecdsa.hpp"
-
-namespace ndn {
-
-SignatureSha256WithEcdsa::SignatureSha256WithEcdsa(const KeyLocator& keyLocator)
-  : Signature(SignatureInfo(tlv::SignatureSha256WithEcdsa, keyLocator))
-{
-}
-
-SignatureSha256WithEcdsa::SignatureSha256WithEcdsa(const Signature& signature)
-  : Signature(signature)
-{
-  if (getType() != tlv::SignatureSha256WithEcdsa)
-    NDN_THROW(Error("Cannot construct Sha256WithEcdsa from SignatureType " + to_string(getType())));
-
-  if (!hasKeyLocator()) {
-    NDN_THROW(Error("KeyLocator is missing in Sha256WithEcdsa signature"));
-  }
-}
-
-void
-SignatureSha256WithEcdsa::unsetKeyLocator()
-{
-  NDN_THROW(Error("KeyLocator cannot be unset in Sha256WithEcdsa signature"));
-}
-
-} // namespace ndn
diff --git a/ndn-cxx/security/signature-sha256-with-ecdsa.hpp b/ndn-cxx/security/signature-sha256-with-ecdsa.hpp
deleted file mode 100644
index 61f2d6d..0000000
--- a/ndn-cxx/security/signature-sha256-with-ecdsa.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2020 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#ifndef NDN_SECURITY_SIGNATURE_SHA256_WITH_ECDSA_HPP
-#define NDN_SECURITY_SIGNATURE_SHA256_WITH_ECDSA_HPP
-
-#include "ndn-cxx/signature.hpp"
-
-namespace ndn {
-
-/** @brief Represents a signature of Sha256WithEcdsa type
- *  @deprecated Use SignatureInfo with type SignatureSha256WithEcdsa instead
- *
- *  This signature type provides integrity and provenance protection using an ECDSA signature over a
- *  SHA-256 digest.
- */
-class
-#ifndef DOXYGEN // Older versions of doxygen can't parse deprecated decorators on classes
-[[deprecated("use SignatureInfo with type SignatureSha256WithRsa instead")]]
-#endif // DOXYGEN
-SignatureSha256WithEcdsa : public Signature
-{
-public:
-  /** @brief Create Sha256WithEcdsa signature with specified KeyLocator
-   */
-  explicit
-  SignatureSha256WithEcdsa(const KeyLocator& keyLocator = KeyLocator());
-
-  /** @brief Convert base Signature to Sha256WithEcdsa signature
-   *  @throw Signature::Error SignatureType is not Sha256WithEcdsa
-   */
-  explicit
-  SignatureSha256WithEcdsa(const Signature& signature);
-
-private:
-  /** @brief Prevent unsetting KeyLocator
-   */
-  void
-  unsetKeyLocator();
-};
-
-} // namespace ndn
-
-#endif // NDN_SECURITY_SIGNATURE_SHA256_WITH_ECDSA_HPP
diff --git a/ndn-cxx/security/signature-sha256-with-rsa.cpp b/ndn-cxx/security/signature-sha256-with-rsa.cpp
deleted file mode 100644
index 5fd1aed..0000000
--- a/ndn-cxx/security/signature-sha256-with-rsa.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2019 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "ndn-cxx/security/signature-sha256-with-rsa.hpp"
-
-namespace ndn {
-
-SignatureSha256WithRsa::SignatureSha256WithRsa(const KeyLocator& keyLocator)
-  : Signature(SignatureInfo(tlv::SignatureSha256WithRsa, keyLocator))
-{
-}
-
-SignatureSha256WithRsa::SignatureSha256WithRsa(const Signature& signature)
-  : Signature(signature)
-{
-  if (getType() != tlv::SignatureSha256WithRsa)
-    NDN_THROW(Error("Cannot construct Sha256WithRsa from SignatureType " + to_string(getType())));
-
-  if (!hasKeyLocator()) {
-    NDN_THROW(Error("KeyLocator is missing in Sha256WithRsa signature"));
-  }
-}
-
-void
-SignatureSha256WithRsa::unsetKeyLocator()
-{
-  NDN_THROW(Error("KeyLocator cannot be unset in Sha256WithRsa signature"));
-}
-
-} // namespace ndn
diff --git a/ndn-cxx/security/signature-sha256-with-rsa.hpp b/ndn-cxx/security/signature-sha256-with-rsa.hpp
deleted file mode 100644
index 3064119..0000000
--- a/ndn-cxx/security/signature-sha256-with-rsa.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2020 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#ifndef NDN_SECURITY_SIGNATURE_SHA256_WITH_RSA_HPP
-#define NDN_SECURITY_SIGNATURE_SHA256_WITH_RSA_HPP
-
-#include "ndn-cxx/signature.hpp"
-
-namespace ndn {
-
-/** @brief Represents a signature of Sha256WithRsa type
- *  @deprecated Use SignatureInfo with type SignatureSha256WithRsa instead
- *
- *  This signature type provides integrity and provenance protection using a RSA signature over a
- *  SHA-256 digest.
- */
-class
-#ifndef DOXYGEN // Older versions of doxygen can't parse deprecated decorators on classes
-[[deprecated("use SignatureInfo with type SignatureSha256WithRsa instead")]]
-#endif // DOXYGEN
-SignatureSha256WithRsa : public Signature
-{
-public:
-  /** @brief Create Sha256WithRsa signature with specified KeyLocator
-   */
-  explicit
-  SignatureSha256WithRsa(const KeyLocator& keyLocator = KeyLocator());
-
-  /** @brief Convert base Signature to Sha256WithRsa signature
-   *  @throw Signature::Error SignatureType is not Sha256WithRsa
-   */
-  explicit
-  SignatureSha256WithRsa(const Signature& signature);
-
-private:
-  /** @brief Prevent unsetting KeyLocator
-   */
-  void
-  unsetKeyLocator();
-};
-
-} // namespace ndn
-
-#endif // NDN_SECURITY_SIGNATURE_SHA256_WITH_RSA_HPP
diff --git a/ndn-cxx/security/signing-info.cpp b/ndn-cxx/security/signing-info.cpp
index 70c5b8e..81724f4 100644
--- a/ndn-cxx/security/signing-info.cpp
+++ b/ndn-cxx/security/signing-info.cpp
@@ -31,20 +31,6 @@
 namespace security {
 
 const Name&
-SigningInfo::getEmptyName()
-{
-  static Name emptyName;
-  return emptyName;
-}
-
-const SignatureInfo&
-SigningInfo::getEmptySignatureInfo()
-{
-  static SignatureInfo emptySignatureInfo;
-  return emptySignatureInfo;
-}
-
-const Name&
 SigningInfo::getDigestSha256Identity()
 {
   static Name digestSha256Identity("/localhost/identity/digest-sha256");
@@ -215,8 +201,7 @@
     case SigningInfo::SIGNER_TYPE_HMAC:
       return os << "id:" << si.getSignerName();
   }
-  NDN_THROW(std::invalid_argument("Unknown signer type"));
-  return os;
+  return os << "Unknown signer type " << to_underlying(si.getSignerType());
 }
 
 std::ostream&
@@ -228,8 +213,7 @@
     case SignedInterestFormat::V02:
       return os << "Signed Interest v0.2";
   }
-  NDN_THROW(std::invalid_argument("Unknown signed Interest format"));
-  return os;
+  return os << "Unknown signed Interest format " << to_underlying(format);
 }
 
 } // namespace security
diff --git a/ndn-cxx/security/signing-info.hpp b/ndn-cxx/security/signing-info.hpp
index aa7c51f..1ac83fd 100644
--- a/ndn-cxx/security/signing-info.hpp
+++ b/ndn-cxx/security/signing-info.hpp
@@ -272,21 +272,6 @@
 
 public:
   /**
-   * @deprecated Use default constructor for Name
-   */
-  [[deprecated("use default constructor for Name")]]
-  static const Name&
-  getEmptyName();
-
-  /**
-   * @brief Get a SignatureInfo constructed with default values.
-   * @deprecated Use default constructor for SignatureInfo
-   */
-  [[deprecated("use default constructor for SignatureInfo")]]
-  static const SignatureInfo&
-  getEmptySignatureInfo();
-
-  /**
    * @brief A localhost identity to indicate that the signature is generated using SHA-256.
    */
   static const Name&
diff --git a/ndn-cxx/signature-info.cpp b/ndn-cxx/signature-info.cpp
index 59c93bc..18db237 100644
--- a/ndn-cxx/signature-info.cpp
+++ b/ndn-cxx/signature-info.cpp
@@ -205,12 +205,6 @@
   return *this;
 }
 
-void
-SignatureInfo::unsetKeyLocator()
-{
-  setKeyLocator(nullopt);
-}
-
 security::ValidityPeriod
 SignatureInfo::getValidityPeriod() const
 {
@@ -233,12 +227,6 @@
   return *this;
 }
 
-void
-SignatureInfo::unsetValidityPeriod()
-{
-  setValidityPeriod(nullopt);
-}
-
 optional<std::vector<uint8_t>>
 SignatureInfo::getNonce() const
 {
@@ -344,22 +332,6 @@
   }
 }
 
-const Block&
-SignatureInfo::getTypeSpecificTlv(uint32_t type) const
-{
-  auto it = findOtherTlv(type);
-  if (it == m_otherTlvs.end()) {
-    NDN_THROW(Error("TLV-TYPE " + to_string(type) + " sub-element does not exist in SignatureInfo"));
-  }
-  return *it;
-}
-
-void
-SignatureInfo::appendTypeSpecificTlv(const Block& block)
-{
-  addCustomTlv(block);
-}
-
 std::vector<Block>::const_iterator
 SignatureInfo::findOtherTlv(uint32_t type) const
 {
diff --git a/ndn-cxx/signature-info.hpp b/ndn-cxx/signature-info.hpp
index bcfa2ee..ad99258 100644
--- a/ndn-cxx/signature-info.hpp
+++ b/ndn-cxx/signature-info.hpp
@@ -143,13 +143,6 @@
   SignatureInfo&
   setKeyLocator(optional<KeyLocator> keyLocator);
 
-  /** @brief Remove KeyLocator
-   *  @deprecated Use `setKeyLocator(nullopt)`
-   */
-  [[deprecated("use setKeyLocator(nullopt)")]]
-  void
-  unsetKeyLocator();
-
   /** @brief Get ValidityPeriod
    *  @throw Error This SignatureInfo does not contain a ValidityPeriod
    */
@@ -164,13 +157,6 @@
   SignatureInfo&
   setValidityPeriod(optional<security::ValidityPeriod> validityPeriod);
 
-  /** @brief Remove ValidityPeriod
-   *  @deprecated Use `setValidityPeriod(nullopt)`
-   */
-  [[deprecated("use setValidityPeriod(nullopt)")]]
-  void
-  unsetValidityPeriod();
-
   /** @brief Get SignatureNonce
    *  @retval nullopt SignatureNonce is not set
    */
@@ -233,22 +219,6 @@
   void
   removeCustomTlv(uint32_t type);
 
-  /** @brief Get SignatureType-specific sub-element
-   *  @deprecated Use getCustomTlv
-   *  @param type TLV-TYPE of sub-element
-   *  @throw Error Sub-element of specified type does not exist
-   */
-  [[deprecated("use getCustomTlv")]]
-  const Block&
-  getTypeSpecificTlv(uint32_t type) const;
-
-  /** @brief Append SignatureType-specific sub-element
-   *  @deprecated Use addCustomTlv
-   */
-  [[deprecated("use addCustomTlv")]]
-  void
-  appendTypeSpecificTlv(const Block& block);
-
 private:
   std::vector<Block>::const_iterator
   findOtherTlv(uint32_t type) const;
diff --git a/ndn-cxx/signature.cpp b/ndn-cxx/signature.cpp
deleted file mode 100644
index e3a07eb..0000000
--- a/ndn-cxx/signature.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2019 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "ndn-cxx/signature.hpp"
-
-namespace ndn {
-
-static_assert(std::is_base_of<tlv::Error, Signature::Error>::value,
-              "Signature::Error must inherit from tlv::Error");
-
-Signature::Signature(const Block& info, const Block& value)
-  : m_info(info)
-  , m_value(value)
-{
-}
-
-
-Signature::Signature(const SignatureInfo& info, const Block& value)
-  : m_info(info)
-  , m_value(value)
-{
-}
-
-tlv::SignatureTypeValue
-Signature::getType() const
-{
-  if (!*this) {
-    NDN_THROW(Error("Signature is invalid"));
-  }
-  return static_cast<tlv::SignatureTypeValue>(m_info.getSignatureType());
-}
-
-void
-Signature::setInfo(const Block& info)
-{
-  m_info = SignatureInfo(info);
-}
-
-void
-Signature::setValue(const Block& value)
-{
-  if (value.type() != tlv::SignatureValue) {
-    NDN_THROW(Error("SignatureValue", value.type()));
-  }
-  m_value = value;
-}
-
-} // namespace ndn
diff --git a/ndn-cxx/signature.hpp b/ndn-cxx/signature.hpp
deleted file mode 100644
index ab536f3..0000000
--- a/ndn-cxx/signature.hpp
+++ /dev/null
@@ -1,161 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2020 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#ifndef NDN_SIGNATURE_HPP
-#define NDN_SIGNATURE_HPP
-
-#include "ndn-cxx/signature-info.hpp"
-
-namespace ndn {
-
-/** @brief Holds SignatureInfo and SignatureValue in a Data packet
- *  @deprecated Use Data::get/setSignatureInfo and Data::get/setSignatureValue directly
- *
- *  A Signature is not a TLV element itself. It collects SignatureInfo and SignatureValue TLV
- *  elements together for easy access.
- *  In most cases, an application should use a subclass of Signature such as @p DigestSha256 , @p
- *  SignatureSha256WithRsa , or @p SignatureSha256WithEcdsa instead of using @p Signature type
- *  directly.
- */
-class
-#ifndef DOXYGEN // Older versions of doxygen can't parse deprecated decorators on classes
-[[deprecated("use Data::get/setSignatureInfo and Data::get/setSignatureValue directly")]]
-#endif // DOXYGEN
-Signature
-{
-public:
-  class Error : public tlv::Error
-  {
-  public:
-    using tlv::Error::Error;
-  };
-
-  Signature() = default;
-
-  explicit
-  Signature(const Block& info, const Block& value = Block());
-
-  explicit
-  Signature(const SignatureInfo& info, const Block& value = Block());
-
-  /** @brief Determine whether SignatureInfo is valid
-   */
-  explicit
-  operator bool() const
-  {
-    return m_info.getSignatureType() != -1;
-  }
-
-  /** @brief Get SignatureInfo
-   */
-  const SignatureInfo&
-  getSignatureInfo() const
-  {
-    return m_info;
-  }
-
-  /** @brief Get SignatureInfo as wire format
-   */
-  const Block&
-  getInfo() const
-  {
-    return m_info.wireEncode();
-  }
-
-  /** @brief Decode SignatureInfo from wire format
-   *  @throw tlv::Error decode error
-   */
-  void
-  setInfo(const Block& info);
-
-  /** @brief Set SignatureInfo
-   */
-  void
-  setInfo(const SignatureInfo& info)
-  {
-    m_info = info;
-  }
-
-  /** @brief Get SignatureValue
-   */
-  const Block&
-  getValue() const
-  {
-    return m_value;
-  }
-
-  /** @brief Set SignatureValue
-   *  @throws tlv::Error TLV-TYPE of supplied block is not SignatureValue, or the block does not have TLV-VALUE
-   */
-  void
-  setValue(const Block& value);
-
-public: // SignatureInfo fields
-  /** @brief Get SignatureType
-   *  @throw Error signature is invalid
-   */
-  tlv::SignatureTypeValue
-  getType() const;
-
-  /** @brief Check if KeyLocator exists in SignatureInfo
-   */
-  bool
-  hasKeyLocator() const
-  {
-    return m_info.hasKeyLocator();
-  }
-
-  /** @brief Get KeyLocator
-   *  @throw tlv::Error KeyLocator does not exist in SignatureInfo
-   */
-  const KeyLocator&
-  getKeyLocator() const
-  {
-    return m_info.getKeyLocator();
-  }
-
-  /** @brief Set KeyLocator
-   */
-  void
-  setKeyLocator(const KeyLocator& keyLocator)
-  {
-    m_info.setKeyLocator(keyLocator);
-  }
-
-  /** @brief Unset KeyLocator
-   *
-   *  @note Subclasses of Signature may provide advisory (non-virtual) override to prevent unsetting
-   *        KeyLocator if it is required by the specification.
-   */
-  void
-  unsetKeyLocator()
-  {
-    m_info.setKeyLocator(nullopt);
-  }
-
-protected:
-  SignatureInfo m_info;
-  mutable Block m_value;
-};
-
-} // namespace ndn
-
-#endif // NDN_SIGNATURE_HPP
diff --git a/tests/unit/security/digest-sha256.t.cpp b/tests/unit/security/digest-sha256.t.cpp
deleted file mode 100644
index 83d2ca7..0000000
--- a/tests/unit/security/digest-sha256.t.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2020 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "ndn-cxx/security/digest-sha256.hpp"
-#include "ndn-cxx/security/verification-helpers.hpp"
-#include "ndn-cxx/util/sha256.hpp"
-#include "ndn-cxx/util/string-helper.hpp"
-
-#include "tests/boost-test.hpp"
-#include "tests/key-chain-fixture.hpp"
-
-namespace ndn {
-namespace security {
-namespace tests {
-
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_FIXTURE_TEST_SUITE(TestDigestSha256, ndn::tests::KeyChainFixture)
-
-BOOST_AUTO_TEST_CASE(Sha256)
-{
-  char content[6] = "1234\n";
-  ConstBufferPtr buf = util::Sha256::computeDigest(reinterpret_cast<uint8_t*>(content), 5);
-
-  BOOST_CHECK_EQUAL(toHex(buf->data(), buf->size(), false),
-                    "a883dafc480d466ee04e0d6da986bd78eb1fdd2178d04693723da3a8f95d42f4");
-}
-
-BOOST_AUTO_TEST_CASE(DataSignature)
-{
-  Name name("/TestSignatureSha/Basic");
-  Data testData(name);
-  char content[5] = "1234";
-  testData.setContent(reinterpret_cast<uint8_t*>(content), 5);
-  m_keyChain.sign(testData, security::SigningInfo(security::SigningInfo::SIGNER_TYPE_SHA256));
-
-  BOOST_CHECK_THROW(testData.getSignatureInfo().getKeyLocator(), ndn::SignatureInfo::Error);
-  verifyDigest(testData, DigestAlgorithm::SHA256);
-}
-
-BOOST_AUTO_TEST_CASE(InterestSignature)
-{
-  Name name("/SecurityTestDigestSha256/InterestSignature/Interest1");
-  Interest testInterest(name);
-  testInterest.setCanBePrefix(false);
-
-  m_keyChain.sign(testInterest, security::SigningInfo(security::SigningInfo::SIGNER_TYPE_SHA256));
-  verifyDigest(testInterest, DigestAlgorithm::SHA256);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestDigestSha256
-BOOST_AUTO_TEST_SUITE_END() // Security
-
-} // namespace tests
-} // namespace security
-} // namespace ndn
diff --git a/tests/unit/security/signature-sha256-with-ecdsa.t.cpp b/tests/unit/security/signature-sha256-with-ecdsa.t.cpp
deleted file mode 100644
index de5edb9..0000000
--- a/tests/unit/security/signature-sha256-with-ecdsa.t.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2020 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "ndn-cxx/security/signature-sha256-with-ecdsa.hpp"
-#include "ndn-cxx/security/verification-helpers.hpp"
-#include "ndn-cxx/util/scheduler.hpp"
-
-#include "tests/test-common.hpp"
-#include "tests/unit/io-key-chain-fixture.hpp"
-
-namespace ndn {
-namespace security {
-namespace tests {
-
-using namespace ndn::tests;
-
-class SignatureSha256EcdsaTimeFixture : public IoKeyChainFixture
-{
-public:
-  SignatureSha256EcdsaTimeFixture()
-    : scheduler(m_io)
-  {
-  }
-
-public:
-  Scheduler scheduler;
-};
-
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_FIXTURE_TEST_SUITE(TestSignatureSha256WithEcdsa, SignatureSha256EcdsaTimeFixture)
-
-const uint8_t sigInfo[] = {
-  0x16, 0x1b, // SignatureInfo
-    0x1b, 0x01, // SignatureType
-      0x03,
-    0x1c, 0x16, // KeyLocator
-      0x07, 0x14, // Name: /test/key/locator
-        0x08, 0x04,
-          0x74, 0x65, 0x73, 0x74,
-        0x08, 0x03,
-          0x6b, 0x65, 0x79,
-        0x08, 0x07,
-          0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
-};
-
-const uint8_t sigValue[] = {
-  0x17, 0x40, // SignatureValue
-    0x2f, 0xd6, 0xf1, 0x6e, 0x80, 0x6f, 0x10, 0xbe, 0xb1, 0x6f, 0x3e, 0x31, 0xec,
-    0xe3, 0xb9, 0xea, 0x83, 0x30, 0x40, 0x03, 0xfc, 0xa0, 0x13, 0xd9, 0xb3, 0xc6,
-    0x25, 0x16, 0x2d, 0xa6, 0x58, 0x41, 0x69, 0x62, 0x56, 0xd8, 0xb3, 0x6a, 0x38,
-    0x76, 0x56, 0xea, 0x61, 0xb2, 0x32, 0x70, 0x1c, 0xb6, 0x4d, 0x10, 0x1d, 0xdc,
-    0x92, 0x8e, 0x52, 0xa5, 0x8a, 0x1d, 0xd9, 0x96, 0x5e, 0xc0, 0x62, 0x0b
-};
-
-
-BOOST_AUTO_TEST_CASE(Decoding)
-{
-  Block sigInfoBlock(sigInfo, sizeof(sigInfo));
-  Block sigValueBlock(sigValue, sizeof(sigValue));
-
-  Signature sig(sigInfoBlock, sigValueBlock);
-  BOOST_CHECK_NO_THROW(SignatureSha256WithEcdsa{sig});
-  BOOST_CHECK_NO_THROW(sig.getKeyLocator());
-}
-
-BOOST_AUTO_TEST_CASE(Encoding)
-{
-  Name name("/test/key/locator");
-  KeyLocator keyLocator(name);
-
-  SignatureSha256WithEcdsa sig(keyLocator);
-
-  BOOST_CHECK_NO_THROW(sig.getKeyLocator());
-
-  const Block& encodeSigInfoBlock = sig.getInfo();
-
-  Block sigInfoBlock(sigInfo, sizeof(sigInfo));
-
-  BOOST_CHECK_EQUAL_COLLECTIONS(sigInfoBlock.wire(),
-                                sigInfoBlock.wire() + sigInfoBlock.size(),
-                                encodeSigInfoBlock.wire(),
-                                encodeSigInfoBlock.wire() + encodeSigInfoBlock.size());
-
-  sig.setKeyLocator(Name("/test/another/key/locator"));
-
-  const Block& encodeSigInfoBlock2 = sig.getInfo();
-  BOOST_CHECK_NE(sigInfoBlock, encodeSigInfoBlock2);
-}
-
-BOOST_AUTO_TEST_CASE(DataSignature)
-{
-  Identity identity = m_keyChain.createIdentity("/SecurityTestSignatureSha256WithEcdsa/DataSignature", EcKeyParams());
-
-  Data testData("/SecurityTestSignatureSha256WithEcdsa/DataSignature/Data1");
-  char content[5] = "1234";
-  testData.setContent(reinterpret_cast<uint8_t*>(content), 5);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(testData, security::SigningInfo(identity)));
-  Block dataBlock(testData.wireEncode().wire(), testData.wireEncode().size());
-
-  Data testData2;
-  testData2.wireDecode(dataBlock);
-  BOOST_CHECK(verifySignature(testData2, identity.getDefaultKey()));
-}
-
-BOOST_AUTO_TEST_CASE(InterestSignature)
-{
-  Identity identity = m_keyChain.createIdentity("/SecurityTestSignatureSha256WithEcdsa/InterestSignature", EcKeyParams());
-
-  auto interest = makeInterest("/SecurityTestSignatureSha256WithEcdsa/InterestSignature/Interest1");
-  auto interest11 = makeInterest("/SecurityTestSignatureSha256WithEcdsa/InterestSignature/Interest1");
-
-  scheduler.schedule(100_ms, [&] { m_keyChain.sign(*interest, security::SigningInfo(identity)); });
-  advanceClocks(100_ms);
-  scheduler.schedule(100_ms, [&] { m_keyChain.sign(*interest11, security::SigningInfo(identity)); });
-  advanceClocks(100_ms);
-
-  Block interestBlock(interest->wireEncode().wire(), interest->wireEncode().size());
-
-  Interest interest2;
-  interest2.wireDecode(interestBlock);
-  BOOST_CHECK(verifySignature(interest2, identity.getDefaultKey()));
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestSignatureSha256WithEcdsa
-BOOST_AUTO_TEST_SUITE_END() // Security
-
-} // namespace tests
-} // namespace security
-} // namespace ndn
diff --git a/tests/unit/security/signature-sha256-with-rsa.t.cpp b/tests/unit/security/signature-sha256-with-rsa.t.cpp
deleted file mode 100644
index d52d923..0000000
--- a/tests/unit/security/signature-sha256-with-rsa.t.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2020 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "ndn-cxx/security/signature-sha256-with-rsa.hpp"
-#include "ndn-cxx/security/verification-helpers.hpp"
-#include "ndn-cxx/util/scheduler.hpp"
-
-#include "tests/test-common.hpp"
-#include "tests/unit/io-key-chain-fixture.hpp"
-
-namespace ndn {
-namespace security {
-namespace tests {
-
-using namespace ndn::tests;
-
-class SignatureSha256RsaTimeFixture : public IoKeyChainFixture
-{
-public:
-  SignatureSha256RsaTimeFixture()
-    : scheduler(m_io)
-  {
-  }
-
-public:
-  Scheduler scheduler;
-};
-
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_FIXTURE_TEST_SUITE(TestSignatureSha256WithRsa, SignatureSha256RsaTimeFixture)
-
-const uint8_t sigInfo[] = {
-  0x16, 0x1b, // SignatureInfo
-    0x1b, 0x01, // SignatureType
-      0x01,
-    0x1c, 0x16, // KeyLocator
-      0x07, 0x14, // Name
-        0x08, 0x04,
-          0x74, 0x65, 0x73, 0x74,
-        0x08, 0x03,
-          0x6b, 0x65, 0x79,
-        0x08, 0x07,
-          0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
-};
-
-const uint8_t sigValue[] = {
-0x17, 0x80, // SignatureValue
-  0x2f, 0xd6, 0xf1, 0x6e, 0x80, 0x6f, 0x10, 0xbe, 0xb1, 0x6f, 0x3e, 0x31, 0xec,
-  0xe3, 0xb9, 0xea, 0x83, 0x30, 0x40, 0x03, 0xfc, 0xa0, 0x13, 0xd9, 0xb3, 0xc6,
-  0x25, 0x16, 0x2d, 0xa6, 0x58, 0x41, 0x69, 0x62, 0x56, 0xd8, 0xb3, 0x6a, 0x38,
-  0x76, 0x56, 0xea, 0x61, 0xb2, 0x32, 0x70, 0x1c, 0xb6, 0x4d, 0x10, 0x1d, 0xdc,
-  0x92, 0x8e, 0x52, 0xa5, 0x8a, 0x1d, 0xd9, 0x96, 0x5e, 0xc0, 0x62, 0x0b, 0xcf,
-  0x3a, 0x9d, 0x7f, 0xca, 0xbe, 0xa1, 0x41, 0x71, 0x85, 0x7a, 0x8b, 0x5d, 0xa9,
-  0x64, 0xd6, 0x66, 0xb4, 0xe9, 0x8d, 0x0c, 0x28, 0x43, 0xee, 0xa6, 0x64, 0xe8,
-  0x55, 0xf6, 0x1c, 0x19, 0x0b, 0xef, 0x99, 0x25, 0x1e, 0xdc, 0x78, 0xb3, 0xa7,
-  0xaa, 0x0d, 0x14, 0x58, 0x30, 0xe5, 0x37, 0x6a, 0x6d, 0xdb, 0x56, 0xac, 0xa3,
-  0xfc, 0x90, 0x7a, 0xb8, 0x66, 0x9c, 0x0e, 0xf6, 0xb7, 0x64, 0xd1
-};
-
-
-BOOST_AUTO_TEST_CASE(Decoding)
-{
-  Block sigInfoBlock(sigInfo, sizeof(sigInfo));
-  Block sigValueBlock(sigValue, sizeof(sigValue));
-
-  Signature sig(sigInfoBlock, sigValueBlock);
-  BOOST_CHECK_NO_THROW(SignatureSha256WithRsa{sig});
-  BOOST_CHECK_NO_THROW(sig.getKeyLocator());
-}
-
-BOOST_AUTO_TEST_CASE(Encoding)
-{
-  Name name("/test/key/locator");
-  KeyLocator keyLocator(name);
-
-  SignatureSha256WithRsa sig(keyLocator);
-
-  BOOST_CHECK_NO_THROW(sig.getKeyLocator());
-
-  const Block& encodeSigInfoBlock = sig.getInfo();
-
-  Block sigInfoBlock(sigInfo, sizeof(sigInfo));
-
-  BOOST_CHECK_EQUAL_COLLECTIONS(sigInfoBlock.wire(),
-                                sigInfoBlock.wire() + sigInfoBlock.size(),
-                                encodeSigInfoBlock.wire(),
-                                encodeSigInfoBlock.wire() + encodeSigInfoBlock.size());
-
-  sig.setKeyLocator(Name("/test/another/key/locator"));
-
-  const Block& encodeSigInfoBlock2 = sig.getInfo();
-  BOOST_CHECK_NE(sigInfoBlock, encodeSigInfoBlock2);
-}
-
-BOOST_AUTO_TEST_CASE(DataSignature)
-{
-  Identity identity = m_keyChain.createIdentity("/SecurityTestSignatureSha256WithRsa/DataSignature", RsaKeyParams());
-
-  Data testData("/SecurityTestSignatureSha256WithRsa/DataSignature/Data1");
-  char content[5] = "1234";
-  testData.setContent(reinterpret_cast<uint8_t*>(content), 5);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(testData, security::SigningInfo(identity)));
-  Block dataBlock(testData.wireEncode().wire(), testData.wireEncode().size());
-
-  Data testData2;
-  testData2.wireDecode(dataBlock);
-  BOOST_CHECK(verifySignature(testData2, identity.getDefaultKey()));
-}
-
-BOOST_AUTO_TEST_CASE(InterestSignature)
-{
-  Identity identity = m_keyChain.createIdentity("/SecurityTestSignatureSha256WithRsa/InterestSignature", RsaKeyParams());
-
-  auto interest = makeInterest("/SecurityTestSignatureSha256WithRsa/InterestSignature/Interest1");
-  auto interest11 = makeInterest("/SecurityTestSignatureSha256WithRsa/InterestSignature/Interest1");
-
-  scheduler.schedule(100_ms, [&] { m_keyChain.sign(*interest, security::SigningInfo(identity)); });
-  advanceClocks(100_ms);
-  scheduler.schedule(100_ms, [&] { m_keyChain.sign(*interest11, security::SigningInfo(identity)); });
-  advanceClocks(100_ms);
-
-  Block interestBlock(interest->wireEncode().wire(), interest->wireEncode().size());
-
-  Interest interest2;
-  interest2.wireDecode(interestBlock);
-  BOOST_CHECK(verifySignature(interest2, identity.getDefaultKey()));
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestSignatureSha256WithRsa
-BOOST_AUTO_TEST_SUITE_END() // Security
-
-} // namespace tests
-} // namespace security
-} // namespace ndn
diff --git a/tests/unit/signature-info.t.cpp b/tests/unit/signature-info.t.cpp
index ee8c826..eb08285 100644
--- a/tests/unit/signature-info.t.cpp
+++ b/tests/unit/signature-info.t.cpp
@@ -30,40 +30,6 @@
 
 BOOST_AUTO_TEST_SUITE(TestSignatureInfo)
 
-const uint8_t sigInfoDataRsa[] = {
-  0x16, 0x1b, // SignatureInfo
-    0x1b, 0x01, // SignatureType
-      0x01, // Sha256WithRsa
-    0x1c, 0x16, // KeyLocator
-      0x07, 0x14, // Name
-        0x08, 0x04,
-          0x74, 0x65, 0x73, 0x74,
-        0x08, 0x03,
-          0x6b, 0x65, 0x79,
-        0x08, 0x07,
-          0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
-};
-
-const uint8_t sigInfoInterestRsa[] = {
-  0x2c, 0x33, // InterestSignatureInfo
-    0x1b, 0x01, // SignatureType
-      0x01, // Sha256WithRsa
-    0x1c, 0x16, // KeyLocator
-      0x07, 0x14, // Name
-        0x08, 0x04,
-          0x74, 0x65, 0x73, 0x74,
-        0x08, 0x03,
-          0x6b, 0x65, 0x79,
-        0x08, 0x07,
-          0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72,
-    0x26, 0x08, // SignatureNonce
-      0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
-    0x28, 0x08, // SignatureTime
-      0x00, 0x00, 0x01, 0x72, 0x3d, 0x77, 0x00, 0x00,
-    0x2a, 0x02, // SignatureSeqNum
-      0x10, 0x20,
-};
-
 BOOST_AUTO_TEST_CASE(Constructor)
 {
   SignatureInfo info;
@@ -215,50 +181,119 @@
   BOOST_CHECK(!info.getSeqNum());
 }
 
+const uint8_t sigInfoDataRsa[] = {
+  0x16, 0x1b, // SignatureInfo
+    0x1b, 0x01, // SignatureType
+      0x01, // Sha256WithRsa
+    0x1c, 0x16, // KeyLocator
+      0x07, 0x14, // Name
+        0x08, 0x04,
+          0x74, 0x65, 0x73, 0x74,
+        0x08, 0x03,
+          0x6b, 0x65, 0x79,
+        0x08, 0x07,
+          0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72,
+};
+
+const uint8_t sigInfoInterestRsa[] = {
+  0x2c, 0x33, // InterestSignatureInfo
+    0x1b, 0x01, // SignatureType
+      0x01, // Sha256WithRsa
+    0x1c, 0x16, // KeyLocator
+      0x07, 0x14, // Name
+        0x08, 0x04,
+          0x74, 0x65, 0x73, 0x74,
+        0x08, 0x03,
+          0x6b, 0x65, 0x79,
+        0x08, 0x07,
+          0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72,
+    0x26, 0x08, // SignatureNonce
+      0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+    0x28, 0x08, // SignatureTime
+      0x00, 0x00, 0x01, 0x72, 0x3d, 0x77, 0x00, 0x00,
+    0x2a, 0x02, // SignatureSeqNum
+      0x10, 0x20,
+};
+
+const uint8_t sigInfoDataEcdsa[] = {
+  0x16, 0x1b, // SignatureInfo
+    0x1b, 0x01, // SignatureType
+      0x03, // Sha256WithEcdsa
+    0x1c, 0x16, // KeyLocator
+      0x07, 0x14, // Name
+        0x08, 0x04,
+          0x74, 0x65, 0x73, 0x74,
+        0x08, 0x03,
+          0x6b, 0x65, 0x79,
+        0x08, 0x07,
+          0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72,
+};
+
 BOOST_AUTO_TEST_CASE(EncodeDecode)
 {
-  KeyLocator keyLocator("/test/key/locator");
+  const KeyLocator keyLocator("/test/key/locator");
+
+  // RSA
   SignatureInfo info(tlv::SignatureSha256WithRsa, keyLocator);
 
-  // Encode as SignatureInfo (for Data packets)
+  // Encode as (Data)SignatureInfo
   auto encodedData = info.wireEncode(SignatureInfo::Type::Data);
-  Block sigInfoDataBlock(sigInfoDataRsa, sizeof(sigInfoDataRsa));
 
-  BOOST_CHECK_EQUAL_COLLECTIONS(sigInfoDataBlock.wire(), sigInfoDataBlock.wire() + sigInfoDataBlock.size(),
-                                encodedData.wire(), encodedData.wire() + encodedData.size());
+  BOOST_CHECK_EQUAL_COLLECTIONS(sigInfoDataRsa, sigInfoDataRsa + sizeof(sigInfoDataRsa),
+                                encodedData.begin(), encodedData.end());
 
-  // Decode as SignatureInfo (for Data packets)
-  info = SignatureInfo(sigInfoDataBlock, SignatureInfo::Type::Data);
+  // Decode as (Data)SignatureInfo
+  info = SignatureInfo(Block(sigInfoDataRsa, sizeof(sigInfoDataRsa)),
+                       SignatureInfo::Type::Data);
+
   BOOST_CHECK_EQUAL(info.getSignatureType(), tlv::SignatureSha256WithRsa);
   BOOST_CHECK_EQUAL(info.hasKeyLocator(), true);
   BOOST_CHECK_EQUAL(info.getKeyLocator().getName(), Name("/test/key/locator"));
-
   BOOST_CHECK(!info.getNonce());
   BOOST_CHECK(!info.getTime());
   BOOST_CHECK(!info.getSeqNum());
 
   // Encode as InterestSignatureInfo
-  std::vector<uint8_t> nonce{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
+  const std::vector<uint8_t> nonce{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
   info.setNonce(nonce);
-  time::system_clock::time_point timePoint(1590169108480_ms);
+  const time::system_clock::time_point timePoint(1590169108480_ms);
   info.setTime(timePoint);
   info.setSeqNum(0x1020);
   auto encodedInterest = info.wireEncode(SignatureInfo::Type::Interest);
-  Block sigInfoInterestBlock(sigInfoInterestRsa, sizeof(sigInfoInterestRsa));
 
-  BOOST_CHECK_EQUAL_COLLECTIONS(sigInfoInterestBlock.wire(),
-                                sigInfoInterestBlock.wire() + sigInfoInterestBlock.size(),
-                                encodedInterest.wire(),
-                                encodedInterest.wire() + encodedInterest.size());
+  BOOST_CHECK_EQUAL_COLLECTIONS(sigInfoInterestRsa, sigInfoInterestRsa + sizeof(sigInfoInterestRsa),
+                                encodedInterest.begin(), encodedInterest.end());
 
   // Decode as InterestSignatureInfo
-  info = SignatureInfo(sigInfoInterestBlock, SignatureInfo::Type::Interest);
+  info = SignatureInfo(Block(sigInfoInterestRsa, sizeof(sigInfoInterestRsa)),
+                       SignatureInfo::Type::Interest);
+
   BOOST_CHECK_EQUAL(info.getSignatureType(), tlv::SignatureSha256WithRsa);
   BOOST_CHECK_EQUAL(info.hasKeyLocator(), true);
   BOOST_CHECK_EQUAL(info.getKeyLocator().getName(), Name("/test/key/locator"));
   BOOST_CHECK(info.getNonce() == nonce);
   BOOST_CHECK(info.getTime() == timePoint);
   BOOST_CHECK(info.getSeqNum() == 0x1020UL);
+
+  // ECDSA
+  info = SignatureInfo(tlv::SignatureSha256WithEcdsa, keyLocator);
+
+  // Encode as (Data)SignatureInfo
+  auto encodedDataEcdsa = info.wireEncode(SignatureInfo::Type::Data);
+
+  BOOST_CHECK_EQUAL_COLLECTIONS(sigInfoDataEcdsa, sigInfoDataEcdsa + sizeof(sigInfoDataEcdsa),
+                                encodedDataEcdsa.begin(), encodedDataEcdsa.end());
+
+  // Decode as (Data)SignatureInfo
+  info = SignatureInfo(Block(sigInfoDataEcdsa, sizeof(sigInfoDataEcdsa)),
+                       SignatureInfo::Type::Data);
+
+  BOOST_CHECK_EQUAL(info.getSignatureType(), tlv::SignatureSha256WithEcdsa);
+  BOOST_CHECK_EQUAL(info.hasKeyLocator(), true);
+  BOOST_CHECK_EQUAL(info.getKeyLocator().getName(), Name("/test/key/locator"));
+  BOOST_CHECK(!info.getNonce());
+  BOOST_CHECK(!info.getTime());
+  BOOST_CHECK(!info.getSeqNum());
 }
 
 BOOST_AUTO_TEST_CASE(DecodeError)
@@ -449,11 +484,12 @@
 BOOST_AUTO_TEST_CASE(CustomTlvsEncoding) // Bug #3914
 {
   SignatureInfo info1(tlv::SignatureSha256WithRsa);
-  info1.appendTypeSpecificTlv(makeStringBlock(102, "First"));
-  info1.appendTypeSpecificTlv(makeStringBlock(104, "Second"));
-  info1.appendTypeSpecificTlv(makeStringBlock(106, "Third"));
+  info1.addCustomTlv(makeStringBlock(102, "First"));
+  info1.addCustomTlv(makeStringBlock(104, "Second"));
+  info1.addCustomTlv(makeStringBlock(106, "Third"));
 
-  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(info1), "SignatureSha256WithRsa { 102 104 106 }");
+  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(info1),
+                    "SignatureSha256WithRsa { 102 104 106 }");
 
   SignatureInfo info2;
   info2.wireDecode(info1.wireEncode(), SignatureInfo::Type::Data);
