In ndn_encodeBinaryXmlData, return signedFieldsBeginOffset and signedFieldsEndOffset
diff --git a/ndn-cpp/c/encoding/binary-xml-data.c b/ndn-cpp/c/encoding/binary-xml-data.c
index 4533fd0..b2d391a 100644
--- a/ndn-cpp/c/encoding/binary-xml-data.c
+++ b/ndn-cpp/c/encoding/binary-xml-data.c
@@ -129,7 +129,8 @@
return NDN_ERROR_success;
}
-ndn_Error ndn_encodeBinaryXmlData(struct ndn_Data *data, struct ndn_BinaryXmlEncoder *encoder)
+ndn_Error ndn_encodeBinaryXmlData
+ (struct ndn_Data *data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset, struct ndn_BinaryXmlEncoder *encoder)
{
ndn_Error error;
if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_ContentObject)))
@@ -137,17 +138,21 @@
if ((error = encodeSignature(&data->signature, encoder)))
return NDN_ERROR_success;
+
+ *signedFieldsBeginOffset = encoder->offset;
if ((error = ndn_encodeBinaryXmlName(&data->name, encoder)))
return error;
-
+
if ((error = encodeSignedInfo(&data->signedInfo, encoder)))
return NDN_ERROR_success;
if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
(encoder, ndn_BinaryXml_DTag_Content, data->content, data->contentLength)))
return error;
-
+
+ *signedFieldsEndOffset = encoder->offset;
+
if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
return error;