Renamed SignedInfo to MetaInfo (except for encoding binary XML).
diff --git a/ndn-cpp/c/encoding/binary-xml-data.c b/ndn-cpp/c/encoding/binary-xml-data.c
index 31354d4..ebc9987 100644
--- a/ndn-cpp/c/encoding/binary-xml-data.c
+++ b/ndn-cpp/c/encoding/binary-xml-data.c
@@ -56,9 +56,9 @@
return NDN_ERROR_success;
}
-static ndn_Error encodeSignedInfo(struct ndn_SignedInfo *signedInfo, struct ndn_BinaryXmlEncoder *encoder)
+static ndn_Error encodeSignedInfo(struct ndn_MetaInfo *metaInfo, struct ndn_BinaryXmlEncoder *encoder)
{
- if (signedInfo->type < 0)
+ if (metaInfo->type < 0)
return NDN_ERROR_success;
ndn_Error error;
@@ -66,26 +66,26 @@
return error;
// This will skip encoding if there is no publisherPublicKeyDigest.
- if ((error = ndn_encodeBinaryXmlPublisherPublicKeyDigest(&signedInfo->publisherPublicKeyDigest, encoder)))
+ if ((error = ndn_encodeBinaryXmlPublisherPublicKeyDigest(&metaInfo->publisherPublicKeyDigest, encoder)))
return error;
if ((error = ndn_BinaryXmlEncoder_writeOptionalTimeMillisecondsDTagElement
- (encoder, ndn_BinaryXml_DTag_Timestamp, signedInfo->timestampMilliseconds)))
+ (encoder, ndn_BinaryXml_DTag_Timestamp, metaInfo->timestampMilliseconds)))
return error;
- if (!(signedInfo->type < 0 || signedInfo->type == ndn_ContentType_DATA)) {
+ if (!(metaInfo->type < 0 || metaInfo->type == ndn_ContentType_DATA)) {
// Not the default of DATA, so we need to encode the type.
unsigned char *typeBytes;
unsigned int typeBytesLength = 3;
- if (signedInfo->type == ndn_ContentType_ENCR)
+ if (metaInfo->type == ndn_ContentType_ENCR)
typeBytes = "\x10\xD0\x91";
- else if (signedInfo->type == ndn_ContentType_GONE)
+ else if (metaInfo->type == ndn_ContentType_GONE)
typeBytes = "\x18\xE3\x44";
- else if (signedInfo->type == ndn_ContentType_KEY)
+ else if (metaInfo->type == ndn_ContentType_KEY)
typeBytes = "\x28\x46\x3F";
- else if (signedInfo->type == ndn_ContentType_LINK)
+ else if (metaInfo->type == ndn_ContentType_LINK)
typeBytes = "\x2C\x83\x4A";
- else if (signedInfo->type == ndn_ContentType_NACK)
+ else if (metaInfo->type == ndn_ContentType_NACK)
typeBytes = "\x34\x00\x8A";
else
return NDN_ERROR_unrecognized_ndn_ContentType;
@@ -96,15 +96,15 @@
}
if ((error = ndn_BinaryXmlEncoder_writeOptionalUnsignedDecimalIntDTagElement
- (encoder, ndn_BinaryXml_DTag_FreshnessSeconds, signedInfo->freshnessSeconds)))
+ (encoder, ndn_BinaryXml_DTag_FreshnessSeconds, metaInfo->freshnessSeconds)))
return error;
if ((error = ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement
- (encoder, ndn_BinaryXml_DTag_FinalBlockID, signedInfo->finalBlockID, signedInfo->finalBlockIDLength)))
+ (encoder, ndn_BinaryXml_DTag_FinalBlockID, metaInfo->finalBlockID, metaInfo->finalBlockIDLength)))
return error;
// This will skip encoding if there is no key locator.
- if ((error = ndn_encodeBinaryXmlKeyLocator(&signedInfo->keyLocator, encoder)))
+ if ((error = ndn_encodeBinaryXmlKeyLocator(&metaInfo->keyLocator, encoder)))
return error;
if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
@@ -113,17 +113,17 @@
return NDN_ERROR_success;
}
-static ndn_Error decodeSignedInfo(struct ndn_SignedInfo *signedInfo, struct ndn_BinaryXmlDecoder *decoder)
+static ndn_Error decodeSignedInfo(struct ndn_MetaInfo *metaInfo, struct ndn_BinaryXmlDecoder *decoder)
{
ndn_Error error;
if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_SignedInfo)))
return error;
- if ((error = ndn_decodeOptionalBinaryXmlPublisherPublicKeyDigest(&signedInfo->publisherPublicKeyDigest, decoder)))
+ if ((error = ndn_decodeOptionalBinaryXmlPublisherPublicKeyDigest(&metaInfo->publisherPublicKeyDigest, decoder)))
return error;
if (error= ndn_BinaryXmlDecoder_readOptionalTimeMillisecondsDTagElement
- (decoder, ndn_BinaryXml_DTag_Timestamp, &signedInfo->timestampMilliseconds))
+ (decoder, ndn_BinaryXml_DTag_Timestamp, &metaInfo->timestampMilliseconds))
return error;
unsigned char *typeBytes;
@@ -133,21 +133,21 @@
return error;
if (typeBytesLength == 0)
// The default Type is DATA.
- signedInfo->type = ndn_ContentType_DATA;
+ metaInfo->type = ndn_ContentType_DATA;
else if (typeBytesLength == 3) {
// All the recognized content types are 3 bytes.
if (ndn_memcmp(typeBytes, "\x0C\x04\xC0", typeBytesLength) == 0)
- signedInfo->type = ndn_ContentType_DATA;
+ metaInfo->type = ndn_ContentType_DATA;
else if (ndn_memcmp(typeBytes, "\x10\xD0\x91", typeBytesLength) == 0)
- signedInfo->type = ndn_ContentType_ENCR;
+ metaInfo->type = ndn_ContentType_ENCR;
else if (ndn_memcmp(typeBytes, "\x18\xE3\x44", typeBytesLength) == 0)
- signedInfo->type = ndn_ContentType_GONE;
+ metaInfo->type = ndn_ContentType_GONE;
else if (ndn_memcmp(typeBytes, "\x28\x46\x3F", typeBytesLength) == 0)
- signedInfo->type = ndn_ContentType_KEY;
+ metaInfo->type = ndn_ContentType_KEY;
else if (ndn_memcmp(typeBytes, "\x2C\x83\x4A", typeBytesLength) == 0)
- signedInfo->type = ndn_ContentType_LINK;
+ metaInfo->type = ndn_ContentType_LINK;
else if (ndn_memcmp(typeBytes, "\x34\x00\x8A", typeBytesLength) == 0)
- signedInfo->type = ndn_ContentType_NACK;
+ metaInfo->type = ndn_ContentType_NACK;
else
return NDN_ERROR_unrecognized_ndn_ContentType;
}
@@ -155,14 +155,14 @@
return NDN_ERROR_unrecognized_ndn_ContentType;
if ((error = ndn_BinaryXmlDecoder_readOptionalUnsignedIntegerDTagElement
- (decoder, ndn_BinaryXml_DTag_FreshnessSeconds, &signedInfo->freshnessSeconds)))
+ (decoder, ndn_BinaryXml_DTag_FreshnessSeconds, &metaInfo->freshnessSeconds)))
return error;
if ((error = ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
- (decoder, ndn_BinaryXml_DTag_FinalBlockID, 0, &signedInfo->finalBlockID, &signedInfo->finalBlockIDLength)))
+ (decoder, ndn_BinaryXml_DTag_FinalBlockID, 0, &metaInfo->finalBlockID, &metaInfo->finalBlockIDLength)))
return error;
- if ((error = ndn_decodeOptionalBinaryXmlKeyLocator(&signedInfo->keyLocator, decoder)))
+ if ((error = ndn_decodeOptionalBinaryXmlKeyLocator(&metaInfo->keyLocator, decoder)))
return error;
if ((error = ndn_BinaryXmlDecoder_readElementClose(decoder)))
@@ -186,7 +186,7 @@
if ((error = ndn_encodeBinaryXmlName(&data->name, encoder)))
return error;
- if ((error = encodeSignedInfo(&data->signedInfo, encoder)))
+ if ((error = encodeSignedInfo(&data->metaInfo, encoder)))
return error;
if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
@@ -226,11 +226,11 @@
if ((error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_SignedInfo, &gotExpectedTag)))
return error;
if (gotExpectedTag) {
- if ((error = decodeSignedInfo(&data->signedInfo, decoder)))
+ if ((error = decodeSignedInfo(&data->metaInfo, decoder)))
return error;
}
else
- ndn_SignedInfo_initialize(&data->signedInfo, data->signedInfo.keyLocator.keyName.components, data->signedInfo.keyLocator.keyName.maxComponents);
+ ndn_MetaInfo_initialize(&data->metaInfo, data->metaInfo.keyLocator.keyName.components, data->metaInfo.keyLocator.keyName.maxComponents);
// Require a Content element, but set allowNull to allow a missing BLOB.
if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement