Adjust includes for the updated locations of ndn-cxx security headers
Change-Id: I4b527581a97f706e348096b4d77c8f13559c9224
diff --git a/tests/identity-management-fixture.cpp b/tests/identity-management-fixture.cpp
index f8b9c35..847bb6b 100644
--- a/tests/identity-management-fixture.cpp
+++ b/tests/identity-management-fixture.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2018, Regents of the University of California
+ * Copyright (c) 2014-2020, Regents of the University of California
*
* NAC 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
@@ -20,7 +20,7 @@
#include "identity-management-fixture.hpp"
#include <ndn-cxx/util/io.hpp>
-#include <ndn-cxx/security/v2/additional-description.hpp>
+#include <ndn-cxx/security/additional-description.hpp>
#include <boost/filesystem.hpp>
@@ -28,8 +28,6 @@
namespace nac {
namespace tests {
-namespace v2 = security::v2;
-
IdentityManagementFixture::IdentityManagementFixture()
: m_keyChain("pib-memory:", "tpm-memory:")
{
@@ -43,7 +41,7 @@
}
}
-security::Identity
+Identity
IdentityManagementFixture::addIdentity(const Name& identityName, const KeyParams& params)
{
auto identity = m_keyChain.createIdentity(identityName, params);
@@ -52,7 +50,7 @@
}
bool
-IdentityManagementFixture::saveIdentityCertificate(const security::Identity& identity,
+IdentityManagementFixture::saveIdentityCertificate(const Identity& identity,
const std::string& filename)
{
try {
@@ -64,13 +62,13 @@
}
}
-security::Identity
+Identity
IdentityManagementFixture::addSubCertificate(const Name& subIdentityName,
- const security::Identity& issuer, const KeyParams& params)
+ const Identity& issuer, const KeyParams& params)
{
auto subIdentity = addIdentity(subIdentityName, params);
- v2::Certificate request = subIdentity.getDefaultKey().getDefaultCertificate();
+ Certificate request = subIdentity.getDefaultKey().getDefaultCertificate();
request.setName(request.getKeyName().append("parent").appendVersion());
@@ -78,7 +76,7 @@
info.setValidityPeriod(security::ValidityPeriod(time::system_clock::now(),
time::system_clock::now() + time::days(7300)));
- v2::AdditionalDescription description;
+ security::AdditionalDescription description;
description.set("type", "sub-certificate");
info.appendTypeSpecificTlv(description.wireEncode());
@@ -88,14 +86,14 @@
return subIdentity;
}
-v2::Certificate
+Certificate
IdentityManagementFixture::addCertificate(const security::Key& key, const std::string& issuer)
{
Name certificateName = key.getName();
certificateName
.append(issuer)
.appendVersion();
- v2::Certificate certificate;
+ Certificate certificate;
certificate.setName(certificateName);
// set metainfo
diff --git a/tests/identity-management-fixture.hpp b/tests/identity-management-fixture.hpp
index 96cbc7f..d76e3fa 100644
--- a/tests/identity-management-fixture.hpp
+++ b/tests/identity-management-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2018, Regents of the University of California
+ * Copyright (c) 2014-2020, Regents of the University of California
*
* NAC 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
@@ -20,9 +20,11 @@
#ifndef NAC_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP
#define NAC_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP
+#include "common.hpp"
+
#include "boost-test.hpp"
-#include <ndn-cxx/security/v2/key-chain.hpp>
+#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/security/signing-helpers.hpp>
#include <vector>
@@ -48,8 +50,8 @@
* @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());
+ Identity
+ addIdentity(const Name& identityName, const KeyParams& params = KeyChain::getDefaultKeyParams());
/**
* @brief Save identity certificate to a file
@@ -58,7 +60,7 @@
* @return whether successful
*/
bool
- saveIdentityCertificate(const security::Identity& identity, const std::string& filename);
+ saveIdentityCertificate(const Identity& identity, const std::string& filename);
/**
* @brief Issue a certificate for \p subIdentityName signed by \p issuer
@@ -70,20 +72,20 @@
* @return the sub identity
*/
security::Identity
- addSubCertificate(const Name& subIdentityName, const security::Identity& issuer,
- const KeyParams& params = security::v2::KeyChain::getDefaultKeyParams());
+ addSubCertificate(const Name& subIdentityName, const Identity& issuer,
+ const KeyParams& params = KeyChain::getDefaultKeyParams());
/**
* @brief Add a self-signed certificate to @p key with issuer ID @p issuer
*/
- security::v2::Certificate
- addCertificate(const security::Key& key, const std::string& issuer);
+ Certificate
+ addCertificate(const Key& key, const std::string& issuer);
bool
saveCertToFile(const Data& obj, const std::string& filename);
protected:
- security::v2::KeyChain m_keyChain;
+ KeyChain m_keyChain;
std::set<Name> m_identities;
std::set<std::string> m_certFiles;
};