diff --git a/ndn-cpp/c/encoding/binary-xml-data.h b/ndn-cpp/c/encoding/binary-xml-data.h
index 1cc6efb..3e4747e 100644
--- a/ndn-cpp/c/encoding/binary-xml-data.h
+++ b/ndn-cpp/c/encoding/binary-xml-data.h
@@ -17,7 +17,7 @@
 
 /**
  * Encode the data packet as binary XML.
- * @param data Pointer to the data object the encode.
+ * @param data Pointer to the data object to encode.
  * @param signedFieldsBeginOffset Return the offset in the encoding of the beginning of the fields which are signed.
  * If you are not encoding in order to sign, you can ignore this returned value.
  * @param signedFieldsEndOffset Return the offset in the encoding of the end of the fields which are signed.
@@ -29,8 +29,8 @@
   (struct ndn_Data *data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset, struct ndn_BinaryXmlEncoder *encoder);
 
 /**
- * Decode the data packet as binary XML.
- * @param data Pointer to the data object the decode.
+ * Decode the data packet as binary XML and set the fields in the data object.
+ * @param data Pointer to the data object whose fields are updated.
  * @param signedFieldsBeginOffset Return the offset in the input buffer of the beginning of the fields which are signed.
  * If you are not decoding in order to verify, you can ignore this returned value.
  * @param signedFieldsEndOffset Return the offset in the input buffer of the end of the fields which are signed.
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.cpp b/ndn-cpp/encoding/binary-xml-wire-format.cpp
index 43e09bc..574a374 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.cpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.cpp
@@ -57,7 +57,8 @@
   interest.set(interestStruct);
 }
 
-ptr_lib::shared_ptr<vector<unsigned char> > BinaryXmlWireFormat::encodeData(const Data &data) 
+ptr_lib::shared_ptr<vector<unsigned char> > BinaryXmlWireFormat::encodeData
+  (const Data &data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_Data dataStruct;
@@ -66,15 +67,15 @@
   data.get(dataStruct);
 
   BinaryXmlEncoder encoder;
-  unsigned int dummyBeginOffset, dummyEndOffset;
   ndn_Error error;
-  if ((error = ndn_encodeBinaryXmlData(&dataStruct, &dummyBeginOffset, &dummyEndOffset, &encoder)))
+  if ((error = ndn_encodeBinaryXmlData(&dataStruct, signedFieldsBeginOffset, signedFieldsEndOffset, &encoder)))
     throw std::runtime_error(ndn_getErrorString(error));
      
   return encoder.getOutput();
 }
 
-void BinaryXmlWireFormat::decodeData(Data &data, const unsigned char *input, unsigned int inputLength)
+void BinaryXmlWireFormat::decodeData
+  (Data &data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset)
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_Data dataStruct;
@@ -82,9 +83,8 @@
     (&dataStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]));
     
   BinaryXmlDecoder decoder(input, inputLength);  
-  unsigned int dummyBeginOffset, dummyEndOffset;
   ndn_Error error;
-  if ((error = ndn_decodeBinaryXmlData(&dataStruct, &dummyBeginOffset, &dummyEndOffset, &decoder)))
+  if ((error = ndn_decodeBinaryXmlData(&dataStruct, signedFieldsBeginOffset, signedFieldsEndOffset, &decoder)))
     throw std::runtime_error(ndn_getErrorString(error));
 
   data.set(dataStruct);
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.hpp b/ndn-cpp/encoding/binary-xml-wire-format.hpp
index c327d17..7266957 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.hpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.hpp
@@ -10,13 +10,41 @@
 
 namespace ndn {
 
+/**
+ * A BinaryXmlWireFormat extends WireFormat to override its virtual methods to implement encoding and decoding
+ * using binary XML.
+ */
 class BinaryXmlWireFormat : public WireFormat {
 public:
   virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeInterest(const Interest &interest);
   virtual void decodeInterest(Interest &interest, const unsigned char *input, unsigned int inputLength);
 
-  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeData(const Data &data);
-  virtual void decodeData(Data &data, const unsigned char *input, unsigned int inputLength);
+  /**
+   * Encode data with binary XML and return the encoding.
+   * @param data The Data object to encode.
+   * @param signedFieldsBeginOffset Return the offset in the encoding of the beginning of the fields which are signed.
+   * If you are not encoding in order to sign, you can call encodeData(const Data &data) to ignore this returned value.
+   * @param signedFieldsEndOffset Return the offset in the encoding of the end of the fields which are signed.
+   * If you are not encoding in order to sign, you can call encodeData(const Data &data) to ignore this returned value.
+   * @return A shared_ptr with the vector<unsigned char> containing the encoding.
+   */
+  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeData
+    (const Data &data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
+  
+  /**
+   * Decode input as a data packet in binary XML and set the fields in the data object.
+   * @param data The Data object whose fields are updated.
+   * @param input A pointer to the input buffer to decode.
+   * @param inputLength The number of bytes in input.
+   * @param signedFieldsBeginOffset Return the offset in the input buffer of the beginning of the fields which are signed.
+   * If you are not decoding in order to verify, you can call 
+   * decodeData(Data &data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
+   * @param signedFieldsEndOffset Return the offset in the input buffer of the end of the fields which are signed.
+   * If you are not decoding in order to verify, you can call 
+   * decodeData(Data &data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
+   */  
+  virtual void decodeData
+    (Data &data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
 };
   
 }
diff --git a/ndn-cpp/encoding/wire-format.cpp b/ndn-cpp/encoding/wire-format.cpp
index 60e3f19..703795a 100644
--- a/ndn-cpp/encoding/wire-format.cpp
+++ b/ndn-cpp/encoding/wire-format.cpp
@@ -35,11 +35,13 @@
   throw logic_error("unimplemented");
 }
 
-ptr_lib::shared_ptr<vector<unsigned char> > WireFormat::encodeData(const Data &data) 
+ptr_lib::shared_ptr<vector<unsigned char> > WireFormat::encodeData
+  (const Data &data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
 {
   throw logic_error("unimplemented");
 }
-void WireFormat::decodeData(Data &data, const unsigned char *input, unsigned int inputLength) 
+void WireFormat::decodeData
+  (Data &data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
 {
   throw logic_error("unimplemented");
 }
diff --git a/ndn-cpp/encoding/wire-format.hpp b/ndn-cpp/encoding/wire-format.hpp
index c229131..e0ffdf0 100644
--- a/ndn-cpp/encoding/wire-format.hpp
+++ b/ndn-cpp/encoding/wire-format.hpp
@@ -19,8 +19,52 @@
   virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeInterest(const Interest &interest);
   virtual void decodeInterest(Interest &interest, const unsigned char *input, unsigned int inputLength);
 
-  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeData(const Data &data);
-  virtual void decodeData(Data &data, const unsigned char *input, unsigned int inputLength);
+  /**
+   * Encode data and return the encoding.  Your derived class should override.
+   * @param data The Data object to encode.
+   * @param signedFieldsBeginOffset Return the offset in the encoding of the beginning of the fields which are signed.
+   * If you are not encoding in order to sign, you can call encodeData(const Data &data) to ignore this returned value.
+   * @param signedFieldsEndOffset Return the offset in the encoding of the end of the fields which are signed.
+   * If you are not encoding in order to sign, you can call encodeData(const Data &data) to ignore this returned value.
+   * @return A shared_ptr with the vector<unsigned char> containing the encoding.
+   * @throw logic_error for unimplemented if the derived class does not override.
+   */
+  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeData
+    (const Data &data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
+
+  /**
+   * Encode data and return the encoding.
+   * @param data The Data object to encode.
+   * @return A shared_ptr with the vector<unsigned char> containing the encoding.
+   * @throw logic_error for unimplemented if the derived class does not override.
+   */
+  ptr_lib::shared_ptr<std::vector<unsigned char> > encodeData(const Data &data)
+  {
+    unsigned int dummyBeginOffset, dummyEndOffset;
+    return encodeData(data, &dummyBeginOffset, &dummyEndOffset);
+  }
+
+  /**
+   * Decode input as a data packet and set the fields in the data object.  Your derived class should override.
+   * @param data The Data object whose fields are updated.
+   * @param input A pointer to the input buffer to decode.
+   * @param inputLength The number of bytes in input.
+   * @param signedFieldsBeginOffset Return the offset in the input buffer of the beginning of the fields which are signed.
+   * If you are not decoding in order to verify, you can call 
+   * decodeData(Data &data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
+   * @param signedFieldsEndOffset Return the offset in the input buffer of the end of the fields which are signed.
+   * If you are not decoding in order to verify, you can call 
+   * decodeData(Data &data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
+   * @throw logic_error for unimplemented if the derived class does not override.
+   */  
+  virtual void decodeData
+    (Data &data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
+
+  void decodeData(Data &data, const unsigned char *input, unsigned int inputLength)
+  {
+    unsigned int dummyBeginOffset, dummyEndOffset;
+    decodeData(data, input, inputLength, &dummyBeginOffset, &dummyEndOffset);
+  }
   
   /**
    * Set the static default WireFormat used by default encoding and decoding methods.
