In Face.registerPrefix, need to pass keyChain, signerName, etc. so that it can sign the Data packet with the ForwardingEntry.
diff --git a/ndn-cpp/face.hpp b/ndn-cpp/face.hpp
index 2b202ef..6e47ff7 100644
--- a/ndn-cpp/face.hpp
+++ b/ndn-cpp/face.hpp
@@ -85,12 +85,21 @@
* @param prefix A reference to a Name for the prefix to register. This copies the Name.
* @param onInterest A function object to call when a matching interest is received. This copies the function object, so you may need to
* use func_lib::ref() as appropriate.
+ * @param onRegisterFailed A function object to call if failed to retrieve the connected hub’s ID or failed to register the prefix.
+ * This calls onRegisterFailed(prefix) where prefix is the prefix given to registerPrefix.
+ * @param keyChain The KeyChain object whose signData is called to sign the Data packet with the ForwardingEntry to register the prefix.
+ * @param signerName The signing identity or certificate name, depending on byKeyName. This is used to sign the Data packet
+ * with the ForwardingEntry to register the prefix.This copies the function object, so you may need to use func_lib::ref() as appropriate.
+ * @param byKeyName If true, the signerName is the key name, otherwise it is the certificate name. If omitted, the default is true.
* @param flags The flags for finer control of which interests are forward to the application.
+ * @param wireFormat A WireFormat object used to encode the input. If omitted, use WireFormat getDefaultWireFormat().
*/
void
- registerPrefix(const Name& prefix, const OnInterest& onInterest, int flags = 0)
+ registerPrefix
+ (const Name& prefix, const OnInterest& onInterest, const OnRegisterFailed& onRegisterFailed, KeyChain &keyChain,
+ const Name& signerName, bool byKeyName = true, int flags = 0, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat())
{
- node_.registerPrefix(prefix, onInterest, flags);
+ node_.registerPrefix(prefix, onInterest, onRegisterFailed, keyChain, signerName, byKeyName, flags, wireFormat);
}
/**