diff --git a/tests/identity-management-fixture.hpp b/tests/identity-management-fixture.hpp
index f96a24c..d2d1473 100644
--- a/tests/identity-management-fixture.hpp
+++ b/tests/identity-management-fixture.hpp
@@ -23,61 +23,121 @@
 #define NDN_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP
 
 #include "security/v1/key-chain.hpp"
+#include "security/v2/key-chain.hpp"
 #include "security/signing-helpers.hpp"
 #include <vector>
 
 #include "boost-test.hpp"
+#include "test-home-fixture.hpp"
 
 namespace ndn {
 namespace tests {
 
-/**
- * @brief IdentityManagementFixture is a test suite level fixture.
- * Test cases in the suite can use this fixture to create identities.
- * Identities added via addIdentity method are automatically deleted
- * during test teardown.
- */
-class IdentityManagementFixture
+class IdentityManagementBaseFixture : public TestHomeFixture<DefaultPibDir>
 {
 public:
-  IdentityManagementFixture();
+  ~IdentityManagementBaseFixture();
 
-  ~IdentityManagementFixture();
-
-  /// @brief add identity, return true if succeed.
   bool
+  saveCertToFile(const Data& obj, const std::string& filename);
+
+protected:
+  std::set<Name> m_identities;
+  std::set<std::string> m_certFiles;
+};
+
+/**
+ * @brief A test suite level fixture to help with identity management
+ *
+ * Test cases in the suite can use this fixture to create identities.  Identities,
+ * certificates, and saved certificates are automatically removed during test teardown.
+ *
+ * @deprecated Use IdentityManagementV2Fixture
+ */
+class IdentityManagementV1Fixture : public IdentityManagementBaseFixture
+{
+public:
+  ~IdentityManagementV1Fixture();
+
+  /**
+   * @brief Add identity
+   * @return name of the created self-signed certificate
+   */
+  Name
   addIdentity(const Name& identity, const KeyParams& params = security::v1::KeyChain::DEFAULT_KEY_PARAMS);
 
   /**
    *  @brief save identity certificate to a file
-   *  @param identity identity name
+   *  @param identity certificate name
    *  @param filename file name, should be writable
-   *  @param wantAdd if true, add new identity when necessary
    *  @return whether successful
    */
   bool
-  saveIdentityCertificate(const Name& identity, const std::string& filename, bool wantAdd = false);
+  saveIdentityCertificate(const Name& certName, const std::string& filename);
 
-  /** \brief issue a certificate for \p identity signed by \p issuer
+  /**
+   * @brief issue a certificate for \p subIdentity signed by \p issuer
    *
    *  If identity does not exist, it is created.
    *  A new key is generated as the default key for identity.
    *  A default certificate for the key is signed by the issuer using its default certificate.
    *
-   *  \return whether success
+   *  @return whether success
    */
   bool
-  addSubCertificate(const Name& identity, const Name& issuer,
+  addSubCertificate(const Name& subIdentity, const Name& issuer,
                     const KeyParams& params = security::v1::KeyChain::DEFAULT_KEY_PARAMS);
 
 protected:
   security::v1::KeyChain m_keyChain;
-
-private:
-  std::vector<Name> m_identities;
-  std::vector<std::string> m_certFiles;
 };
 
+/**
+ * @brief A test suite level fixture to help with identity management
+ *
+ * Test cases in the suite can use this fixture to create identities.  Identities,
+ * certificates, and saved certificates are automatically removed during test teardown.
+ */
+class IdentityManagementV2Fixture : public IdentityManagementBaseFixture
+{
+public:
+  IdentityManagementV2Fixture();
+
+  /**
+   * @brief Add identity @p identityName
+   * @return name of the created self-signed certificate
+   */
+  security::Identity
+  addIdentity(const Name& identityName, const KeyParams& params = security::v2::KeyChain::getDefaultKeyParams());
+
+  /**
+   *  @brief Save identity certificate to a file
+   *  @param identity identity
+   *  @param filename file name, should be writable
+   *  @return whether successful
+   */
+  bool
+  saveIdentityCertificate(const security::Identity& identity, const std::string& filename);
+
+  /**
+   * @brief Issue a certificate for \p subIdentityName signed by \p issuer
+   *
+   *  If identity does not exist, it is created.
+   *  A new key is generated as the default key for identity.
+   *  A default certificate for the key is signed by the issuer using its default certificate.
+   *
+   *  @return the sub identity
+   */
+  security::Identity
+  addSubCertificate(const Name& subIdentityName, const security::Identity& issuer,
+                    const KeyParams& params = security::v2::KeyChain::getDefaultKeyParams());
+
+protected:
+  security::v2::KeyChain m_keyChain;
+};
+
+using IdentityManagementFixture = IdentityManagementV1Fixture;
+
 } // namespace tests
 } // namespace ndn
 
