poke and pingserver: use new signing API and helpers
refs #2919
Change-Id: I0770fc8ee553448f30b2e7a3ba902add441b9659
diff --git a/core/common.hpp b/core/common.hpp
index c2f833f..2b031cc 100644
--- a/core/common.hpp
+++ b/core/common.hpp
@@ -49,6 +49,8 @@
#include <ndn-cxx/face.hpp>
#include <ndn-cxx/interest.hpp>
#include <ndn-cxx/security/key-chain.hpp>
+#include <ndn-cxx/security/signing-helpers.hpp>
+#include <ndn-cxx/security/signing-info.hpp>
#include <ndn-cxx/util/scheduler.hpp>
#include <ndn-cxx/util/signal.hpp>
diff --git a/tools/peek/ndn-poke.cpp b/tools/peek/ndn-poke.cpp
index 9f285a0..9ef3c53 100644
--- a/tools/peek/ndn-poke.cpp
+++ b/tools/peek/ndn-poke.cpp
@@ -164,13 +164,16 @@
}
}
- if (m_isUseDigestSha256Set)
- m_keyChain.signWithSha256(*dataPacket);
+ if (m_isUseDigestSha256Set) {
+ m_keyChain.sign(*dataPacket, signingWithSha256());
+ }
else {
- if (m_identityName == nullptr)
+ if (m_identityName == nullptr) {
m_keyChain.sign(*dataPacket);
- else
- m_keyChain.signByIdentity(*dataPacket, *m_identityName);
+ }
+ else {
+ m_keyChain.sign(*dataPacket, signingByIdentity(*m_identityName));
+ }
}
return dataPacket;
diff --git a/tools/ping/server/ping-server.cpp b/tools/ping/server/ping-server.cpp
index 699da5b..f919113 100644
--- a/tools/ping/server/ping-server.cpp
+++ b/tools/ping/server/ping-server.cpp
@@ -66,7 +66,7 @@
shared_ptr<Data> data = make_shared<Data>(interestName);
data->setFreshnessPeriod(m_options.freshnessPeriod);
data->setContent(m_payload);
- m_keyChain.signWithSha256(*data);
+ m_keyChain.sign(*data, signingWithSha256());
m_face.put(*data);
++m_nPings;