security: clean up KeyChain and SigningInfo APIs
refs #4804
Change-Id: I55ad2b61f05aec8c75d5f6bafc4eea8e1e1100e9
diff --git a/tests/unit/security/signing-helpers.t.cpp b/tests/unit/security/signing-helpers.t.cpp
index f9a51b2..f4493fe 100644
--- a/tests/unit/security/signing-helpers.t.cpp
+++ b/tests/unit/security/signing-helpers.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -60,7 +60,7 @@
{
SigningInfo info = signingWithSha256();
BOOST_CHECK_EQUAL(info.getSignerType(), SigningInfo::SIGNER_TYPE_SHA256);
- BOOST_CHECK_EQUAL(info.getSignerName(), SigningInfo::getEmptyName());
+ BOOST_CHECK_EQUAL(info.getSignerName(), Name());
}
BOOST_AUTO_TEST_SUITE_END() // TestSigningHelpers
diff --git a/tests/unit/security/signing-info.t.cpp b/tests/unit/security/signing-info.t.cpp
index e32d5b1..9b59a13 100644
--- a/tests/unit/security/signing-info.t.cpp
+++ b/tests/unit/security/signing-info.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -42,7 +42,7 @@
SigningInfo info;
BOOST_CHECK_EQUAL(info.getSignerType(), SigningInfo::SIGNER_TYPE_NULL);
- BOOST_CHECK_EQUAL(info.getSignerName(), SigningInfo::getEmptyName());
+ BOOST_CHECK_EQUAL(info.getSignerName(), Name());
BOOST_CHECK_EQUAL(info.getDigestAlgorithm(), DigestAlgorithm::SHA256);
const SignatureInfo& sigInfo = info.getSignatureInfo();
@@ -81,12 +81,12 @@
info.setSha256Signing();
BOOST_CHECK_EQUAL(info.getSignerType(), SigningInfo::SIGNER_TYPE_SHA256);
- BOOST_CHECK_EQUAL(info.getSignerName(), SigningInfo::getEmptyName());
+ BOOST_CHECK_EQUAL(info.getSignerName(), Name());
BOOST_CHECK_EQUAL(info.getDigestAlgorithm(), DigestAlgorithm::SHA256);
SigningInfo infoSha(SigningInfo::SIGNER_TYPE_SHA256);
BOOST_CHECK_EQUAL(infoSha.getSignerType(), SigningInfo::SIGNER_TYPE_SHA256);
- BOOST_CHECK_EQUAL(infoSha.getSignerName(), SigningInfo::getEmptyName());
+ BOOST_CHECK_EQUAL(infoSha.getSignerName(), Name());
BOOST_CHECK_EQUAL(infoSha.getDigestAlgorithm(), DigestAlgorithm::SHA256);
std::string encodedKey("QjM3NEEyNkE3MTQ5MDQzN0FBMDI0RTRGQURENUI0OTdGRE"
@@ -111,7 +111,7 @@
BOOST_CHECK_EQUAL(info1.getSignatureInfo(), si);
- SigningInfo info2(SigningInfo::SIGNER_TYPE_NULL, SigningInfo::getEmptyName(), si);
+ SigningInfo info2(SigningInfo::SIGNER_TYPE_NULL, Name(), si);
BOOST_CHECK_EQUAL(info2.getSignatureInfo(), si);
}
@@ -119,7 +119,7 @@
{
SigningInfo infoDefault("");
BOOST_CHECK_EQUAL(infoDefault.getSignerType(), SigningInfo::SIGNER_TYPE_NULL);
- BOOST_CHECK_EQUAL(infoDefault.getSignerName(), SigningInfo::getEmptyName());
+ BOOST_CHECK_EQUAL(infoDefault.getSignerName(), Name());
BOOST_CHECK_EQUAL(infoDefault.getDigestAlgorithm(), DigestAlgorithm::SHA256);
SigningInfo infoId("id:/my-identity");
@@ -145,7 +145,7 @@
SigningInfo infoSha("id:/localhost/identity/digest-sha256");
BOOST_CHECK_EQUAL(infoSha.getSignerType(), SigningInfo::SIGNER_TYPE_SHA256);
- BOOST_CHECK_EQUAL(infoSha.getSignerName(), SigningInfo::getEmptyName());
+ BOOST_CHECK_EQUAL(infoSha.getSignerName(), Name());
BOOST_CHECK_EQUAL(infoSha.getDigestAlgorithm(), DigestAlgorithm::SHA256);
}