Added ndn_decodeOptionalBinaryXMLPublisherPublicKeyDigest
diff --git a/ndn-cpp/c/encoding/BinaryXMLPublisherPublicKeyDigest.c b/ndn-cpp/c/encoding/BinaryXMLPublisherPublicKeyDigest.c
index b1ee3f8..00e3582 100644
--- a/ndn-cpp/c/encoding/BinaryXMLPublisherPublicKeyDigest.c
+++ b/ndn-cpp/c/encoding/BinaryXMLPublisherPublicKeyDigest.c
@@ -33,3 +33,22 @@
return 0;
}
+
+ndn_Error ndn_decodeOptionalBinaryXMLPublisherPublicKeyDigest
+ (struct ndn_PublisherPublicKeyDigest *publisherPublicKeyDigest, struct ndn_BinaryXMLDecoder *decoder)
+{
+ int gotExpectedTag;
+ ndn_Error error;
+ if (error = ndn_BinaryXMLDecoder_peekDTag(decoder, ndn_BinaryXML_DTag_PublisherPublicKeyDigest, &gotExpectedTag))
+ return error;
+ if (gotExpectedTag) {
+ if (error = ndn_decodeBinaryXMLPublisherPublicKeyDigest(publisherPublicKeyDigest, decoder))
+ return error;
+ }
+ else {
+ publisherPublicKeyDigest->publisherPublicKeyDigest = 0;
+ publisherPublicKeyDigest->publisherPublicKeyDigestLength = 0;
+ }
+
+ return 0;
+}