Implement timestampMilliseconds
diff --git a/ndn-cpp/c/ContentObject.h b/ndn-cpp/c/ContentObject.h
index 4d46e53..36ede14 100644
--- a/ndn-cpp/c/ContentObject.h
+++ b/ndn-cpp/c/ContentObject.h
@@ -44,11 +44,11 @@
struct ndn_SignedInfo {
struct ndn_PublisherPublicKeyDigest publisherPublicKeyDigest;
- // TODO: Implement timestamp
- int type; /**< default is ndn_ContentType_DATA. -1 for none */
- int freshnessSeconds; /**< -1 for none */
- unsigned char *finalBlockID; /**< pointer to pre-allocated buffer. 0 for none */
- unsigned int finalBlockIDLength; /**< length of finalBlockID. 0 for none */
+ double timestampMilliseconds; /**< milliseconds since 1/1/1970. -1 for none */
+ int type; /**< default is ndn_ContentType_DATA. -1 for none */
+ int freshnessSeconds; /**< -1 for none */
+ unsigned char *finalBlockID; /**< pointer to pre-allocated buffer. 0 for none */
+ unsigned int finalBlockIDLength; /**< length of finalBlockID. 0 for none */
struct ndn_KeyLocator keyLocator;
};
diff --git a/ndn-cpp/c/encoding/BinaryXMLContentObject.c b/ndn-cpp/c/encoding/BinaryXMLContentObject.c
index ef50532..29b2065 100644
--- a/ndn-cpp/c/encoding/BinaryXMLContentObject.c
+++ b/ndn-cpp/c/encoding/BinaryXMLContentObject.c
@@ -103,7 +103,9 @@
if (error = ndn_decodeOptionalBinaryXMLPublisherPublicKeyDigest(&signedInfo->publisherPublicKeyDigest, decoder))
return error;
- // TODO: Implement timeStamp
+ if (error= ndn_BinaryXMLDecoder_readOptionalTimeMillisecondsDTagElement
+ (decoder, ndn_BinaryXML_DTag_Timestamp, &signedInfo->timestampMilliseconds))
+ return error;
// TODO: Implement reading the type and converting to an int.
signedInfo->type = ndn_ContentType_DATA;