diff --git a/tests/unit/security/v2/certificate.t.cpp b/tests/unit/security/v2/certificate.t.cpp
index 0d848fd..91bb5c1 100644
--- a/tests/unit/security/v2/certificate.t.cpp
+++ b/tests/unit/security/v2/certificate.t.cpp
@@ -151,7 +151,7 @@
   BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(certificate.getValidityPeriod()),
                     "(20150814T223739, 20150818T223738)");
 
-  BOOST_CHECK_THROW(certificate.getExtension(12345), ndn::SignatureInfo::Error);
+  BOOST_CHECK_THROW(certificate.getExtension(12345), ndn::Data::Error);
   BOOST_CHECK_NO_THROW(certificate.getPublicKey());
 
   Data data(block);
@@ -177,7 +177,7 @@
   BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(certificate.getValidityPeriod()),
                     "(20141111T050000, 20141111T060000)");
 
-  BOOST_CHECK_THROW(certificate.getExtension(12345), ndn::SignatureInfo::Error);
+  BOOST_CHECK_THROW(certificate.getExtension(12345), ndn::Data::Error);
   BOOST_CHECK_NO_THROW(certificate.getPublicKey());
 }
 
diff --git a/tests/unit/signature-info.t.cpp b/tests/unit/signature-info.t.cpp
index 1b0fe58..ee8c826 100644
--- a/tests/unit/signature-info.t.cpp
+++ b/tests/unit/signature-info.t.cpp
@@ -30,7 +30,7 @@
 
 BOOST_AUTO_TEST_SUITE(TestSignatureInfo)
 
-const uint8_t sigInfoRsa[] = {
+const uint8_t sigInfoDataRsa[] = {
   0x16, 0x1b, // SignatureInfo
     0x1b, 0x01, // SignatureType
       0x01, // Sha256WithRsa
@@ -44,96 +44,56 @@
           0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
 };
 
+const uint8_t sigInfoInterestRsa[] = {
+  0x2c, 0x33, // InterestSignatureInfo
+    0x1b, 0x01, // SignatureType
+      0x01, // Sha256WithRsa
+    0x1c, 0x16, // KeyLocator
+      0x07, 0x14, // Name
+        0x08, 0x04,
+          0x74, 0x65, 0x73, 0x74,
+        0x08, 0x03,
+          0x6b, 0x65, 0x79,
+        0x08, 0x07,
+          0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72,
+    0x26, 0x08, // SignatureNonce
+      0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+    0x28, 0x08, // SignatureTime
+      0x00, 0x00, 0x01, 0x72, 0x3d, 0x77, 0x00, 0x00,
+    0x2a, 0x02, // SignatureSeqNum
+      0x10, 0x20,
+};
+
 BOOST_AUTO_TEST_CASE(Constructor)
 {
   SignatureInfo info;
   BOOST_CHECK_EQUAL(info.getSignatureType(), -1);
   BOOST_CHECK_EQUAL(info.hasKeyLocator(), false);
   BOOST_CHECK_THROW(info.getKeyLocator(), SignatureInfo::Error);
-  BOOST_CHECK_EQUAL(info.hasValidityPeriod(), false);
   BOOST_CHECK_THROW(info.getValidityPeriod(), SignatureInfo::Error);
-
-  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(info), "Invalid SignatureInfo");
+  BOOST_CHECK(!info.getNonce());
+  BOOST_CHECK(!info.getTime());
+  BOOST_CHECK(!info.getSeqNum());
 
   SignatureInfo sha256Info(tlv::DigestSha256);
   BOOST_CHECK_EQUAL(sha256Info.getSignatureType(), tlv::DigestSha256);
-  BOOST_CHECK_EQUAL(sha256Info.hasKeyLocator(), false);
   BOOST_CHECK_THROW(sha256Info.getKeyLocator(), SignatureInfo::Error);
-
-  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(sha256Info), "DigestSha256");
+  BOOST_CHECK(!info.getNonce());
+  BOOST_CHECK(!info.getTime());
+  BOOST_CHECK(!info.getSeqNum());
 
   KeyLocator keyLocator("/test/key/locator");
   SignatureInfo sha256RsaInfo(tlv::SignatureSha256WithRsa, keyLocator);
   BOOST_CHECK_EQUAL(sha256RsaInfo.getSignatureType(), tlv::SignatureSha256WithRsa);
   BOOST_CHECK_EQUAL(sha256RsaInfo.hasKeyLocator(), true);
   BOOST_CHECK_EQUAL(sha256RsaInfo.getKeyLocator().getName(), Name("/test/key/locator"));
-  BOOST_CHECK_EQUAL(sha256RsaInfo.hasValidityPeriod(), false);
   BOOST_CHECK_THROW(sha256RsaInfo.getValidityPeriod(), SignatureInfo::Error);
-
-  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(sha256RsaInfo),
-                    "SignatureSha256WithRsa Name=/test/key/locator");
-
-  auto encoded = sha256RsaInfo.wireEncode();
-  Block sigInfoBlock(sigInfoRsa, sizeof(sigInfoRsa));
-  BOOST_CHECK_EQUAL_COLLECTIONS(sigInfoBlock.wire(), sigInfoBlock.wire() + sigInfoBlock.size(),
-                                encoded.wire(), encoded.wire() + encoded.size());
-
-  sha256RsaInfo = SignatureInfo(sigInfoBlock);
-  BOOST_CHECK_EQUAL(sha256RsaInfo.getSignatureType(), tlv::SignatureSha256WithRsa);
-  BOOST_CHECK_EQUAL(sha256RsaInfo.hasKeyLocator(), true);
-  BOOST_CHECK_EQUAL(sha256RsaInfo.getKeyLocator().getName(), Name("/test/key/locator"));
+  BOOST_CHECK(!info.getNonce());
+  BOOST_CHECK(!info.getTime());
+  BOOST_CHECK(!info.getSeqNum());
 }
 
-BOOST_AUTO_TEST_CASE(ConstructorError)
-{
-  const uint8_t error1[] = {
-    0x15, 0x1b, // Wrong SignatureInfo (0x16, 0x1b)
-      0x1b, 0x01, // SignatureType
-        0x01, // Sha256WithRsa
-      0x1c, 0x16, // KeyLocator
-        0x07, 0x14, // Name
-          0x08, 0x04,
-            0x74, 0x65, 0x73, 0x74,
-          0x08, 0x03,
-            0x6b, 0x65, 0x79,
-          0x08, 0x07,
-            0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
-  };
-  Block errorBlock1(error1, sizeof(error1));
-  BOOST_CHECK_THROW(SignatureInfo info(errorBlock1), tlv::Error);
-
-  const uint8_t error2[] = {
-    0x16, 0x01, // SignatureInfo
-      0x01 // Wrong SignatureInfo value
-  };
-  Block errorBlock2(error2, sizeof(error2));
-  BOOST_CHECK_THROW(SignatureInfo info(errorBlock2), tlv::Error);
-
-  const uint8_t error3[] = {
-    0x16, 0x01, // SignatureInfo
-      0x1a, 0x01, // Wrong SignatureType (0x1b, 0x1b)
-        0x01, // Sha256WithRsa
-      0x1c, 0x16, // KeyLocator
-        0x07, 0x14, // Name
-          0x08, 0x04,
-            0x74, 0x65, 0x73, 0x74,
-          0x08, 0x03,
-            0x6b, 0x65, 0x79,
-          0x08, 0x07,
-            0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
-  };
-  Block errorBlock3(error3, sizeof(error3));
-  BOOST_CHECK_THROW(SignatureInfo info(errorBlock3), tlv::Error);
-
-  const uint8_t error4[] = {
-    0x16, 0x00 // Empty SignatureInfo
-  };
-  Block errorBlock4(error4, sizeof(error4));
-  BOOST_CHECK_THROW(SignatureInfo info(errorBlock4), tlv::Error);
-
-}
-
-BOOST_AUTO_TEST_CASE(GetSetSignatureType)
+BOOST_AUTO_TEST_CASE(SignatureType)
 {
   SignatureInfo info;
   BOOST_CHECK_EQUAL(info.getSignatureType(), -1);
@@ -153,7 +113,8 @@
   BOOST_CHECK_EQUAL(info.hasWire(), false);
 }
 
-BOOST_AUTO_TEST_CASE(GetSetKeyLocator)
+// We must name this test case differently to avoid naming conflicts
+BOOST_AUTO_TEST_CASE(KeyLocatorField)
 {
   SignatureInfo info(tlv::SignatureSha256WithEcdsa);
   BOOST_CHECK_EQUAL(info.hasKeyLocator(), false);
@@ -179,6 +140,230 @@
   BOOST_CHECK_EQUAL(info.hasWire(), false);
 }
 
+BOOST_AUTO_TEST_CASE(SignatureNonce)
+{
+  SignatureInfo info(tlv::SignatureSha256WithEcdsa);
+  BOOST_CHECK(!info.getNonce());
+  info.wireEncode();
+  BOOST_CHECK_EQUAL(info.hasWire(), true);
+  std::vector<uint8_t> nonce{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
+  info.setNonce(nonce);
+  BOOST_CHECK_EQUAL(info.hasWire(), false);
+  BOOST_CHECK(info.getNonce() == nonce);
+
+  info.wireEncode();
+  info.setNonce(nonce);
+  BOOST_CHECK_EQUAL(info.hasWire(), true);
+  nonce[2] = 0xFF;
+  info.setNonce(nonce);
+  BOOST_CHECK_EQUAL(info.hasWire(), false);
+  BOOST_CHECK(info.getNonce() == nonce);
+
+  info.wireEncode();
+  BOOST_CHECK_EQUAL(info.hasWire(), true);
+  info.setNonce(nullopt);
+  BOOST_CHECK_EQUAL(info.hasWire(), false);
+  BOOST_CHECK(!info.getNonce());
+}
+
+BOOST_AUTO_TEST_CASE(SignatureTime)
+{
+  SignatureInfo info(tlv::SignatureSha256WithEcdsa);
+  BOOST_CHECK(!info.getTime());
+  info.wireEncode();
+  BOOST_CHECK_EQUAL(info.hasWire(), true);
+  time::system_clock::time_point timePoint(1590169108480_ms);
+  info.setTime(timePoint);
+  BOOST_CHECK_EQUAL(info.hasWire(), false);
+  BOOST_CHECK(info.getTime() == timePoint);
+
+  info.wireEncode();
+  info.setTime(timePoint);
+  BOOST_CHECK_EQUAL(info.hasWire(), true);
+  info.setTime(timePoint + 2_s);
+  BOOST_CHECK_EQUAL(info.hasWire(), false);
+  BOOST_CHECK(info.getTime() == timePoint + 2_s);
+
+  info.wireEncode();
+  BOOST_CHECK_EQUAL(info.hasWire(), true);
+  info.setTime(nullopt);
+  BOOST_CHECK_EQUAL(info.hasWire(), false);
+  BOOST_CHECK(!info.getTime());
+}
+
+BOOST_AUTO_TEST_CASE(SignatureSeqNum)
+{
+  SignatureInfo info(tlv::SignatureSha256WithEcdsa);
+  BOOST_CHECK(!info.getSeqNum());
+  info.wireEncode();
+  BOOST_CHECK_EQUAL(info.hasWire(), true);
+  info.setSeqNum(256);
+  BOOST_CHECK_EQUAL(info.hasWire(), false);
+  BOOST_CHECK(info.getSeqNum() == 256UL);
+
+  info.wireEncode();
+  info.setSeqNum(256);
+  BOOST_CHECK_EQUAL(info.hasWire(), true);
+  info.setSeqNum(512);
+  BOOST_CHECK_EQUAL(info.hasWire(), false);
+  BOOST_CHECK(info.getSeqNum() == 512UL);
+
+  info.wireEncode();
+  BOOST_CHECK_EQUAL(info.hasWire(), true);
+  info.setSeqNum(nullopt);
+  BOOST_CHECK_EQUAL(info.hasWire(), false);
+  BOOST_CHECK(!info.getSeqNum());
+}
+
+BOOST_AUTO_TEST_CASE(EncodeDecode)
+{
+  KeyLocator keyLocator("/test/key/locator");
+  SignatureInfo info(tlv::SignatureSha256WithRsa, keyLocator);
+
+  // Encode as SignatureInfo (for Data packets)
+  auto encodedData = info.wireEncode(SignatureInfo::Type::Data);
+  Block sigInfoDataBlock(sigInfoDataRsa, sizeof(sigInfoDataRsa));
+
+  BOOST_CHECK_EQUAL_COLLECTIONS(sigInfoDataBlock.wire(), sigInfoDataBlock.wire() + sigInfoDataBlock.size(),
+                                encodedData.wire(), encodedData.wire() + encodedData.size());
+
+  // Decode as SignatureInfo (for Data packets)
+  info = SignatureInfo(sigInfoDataBlock, SignatureInfo::Type::Data);
+  BOOST_CHECK_EQUAL(info.getSignatureType(), tlv::SignatureSha256WithRsa);
+  BOOST_CHECK_EQUAL(info.hasKeyLocator(), true);
+  BOOST_CHECK_EQUAL(info.getKeyLocator().getName(), Name("/test/key/locator"));
+
+  BOOST_CHECK(!info.getNonce());
+  BOOST_CHECK(!info.getTime());
+  BOOST_CHECK(!info.getSeqNum());
+
+  // Encode as InterestSignatureInfo
+  std::vector<uint8_t> nonce{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
+  info.setNonce(nonce);
+  time::system_clock::time_point timePoint(1590169108480_ms);
+  info.setTime(timePoint);
+  info.setSeqNum(0x1020);
+  auto encodedInterest = info.wireEncode(SignatureInfo::Type::Interest);
+  Block sigInfoInterestBlock(sigInfoInterestRsa, sizeof(sigInfoInterestRsa));
+
+  BOOST_CHECK_EQUAL_COLLECTIONS(sigInfoInterestBlock.wire(),
+                                sigInfoInterestBlock.wire() + sigInfoInterestBlock.size(),
+                                encodedInterest.wire(),
+                                encodedInterest.wire() + encodedInterest.size());
+
+  // Decode as InterestSignatureInfo
+  info = SignatureInfo(sigInfoInterestBlock, SignatureInfo::Type::Interest);
+  BOOST_CHECK_EQUAL(info.getSignatureType(), tlv::SignatureSha256WithRsa);
+  BOOST_CHECK_EQUAL(info.hasKeyLocator(), true);
+  BOOST_CHECK_EQUAL(info.getKeyLocator().getName(), Name("/test/key/locator"));
+  BOOST_CHECK(info.getNonce() == nonce);
+  BOOST_CHECK(info.getTime() == timePoint);
+  BOOST_CHECK(info.getSeqNum() == 0x1020UL);
+}
+
+BOOST_AUTO_TEST_CASE(DecodeError)
+{
+  const uint8_t error1[] = {
+    0x15, 0x1b, // Wrong SignatureInfo (0x16, 0x1b)
+      0x1b, 0x01, // SignatureType
+        0x01, // Sha256WithRsa
+      0x1c, 0x16, // KeyLocator
+        0x07, 0x14, // Name
+          0x08, 0x04,
+            0x74, 0x65, 0x73, 0x74,
+          0x08, 0x03,
+            0x6b, 0x65, 0x79,
+          0x08, 0x07,
+            0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
+  };
+  Block errorBlock1(error1, sizeof(error1));
+  BOOST_CHECK_THROW(SignatureInfo(errorBlock1, SignatureInfo::Type::Data), tlv::Error);
+
+  const uint8_t error2[] = {
+    0x16, 0x05, // SignatureInfo
+      0x1b, 0x01, // SignatureType
+        0x01, // Sha256WithRsa
+      0x83, 0x00, // Unrecognized critical TLV
+  };
+  Block errorBlock2(error2, sizeof(error2));
+  BOOST_CHECK_THROW(SignatureInfo(errorBlock2, SignatureInfo::Type::Data), tlv::Error);
+
+  const uint8_t error3[] = {
+    0x16, 0x00 // Empty SignatureInfo
+  };
+  Block errorBlock3(error3, sizeof(error3));
+  BOOST_CHECK_THROW(SignatureInfo(errorBlock3, SignatureInfo::Type::Data), tlv::Error);
+
+  // Encoding is correct for SignatureInfo, but decoder is expecting InterestSignatureInfo
+  const uint8_t error4[] = {
+    0x16, 0x1b, // SignatureInfo
+      0x1b, 0x01, // SignatureType
+        0x01, // Sha256WithRsa
+      0x1c, 0x16, // KeyLocator
+        0x07, 0x14, // Name
+          0x08, 0x04,
+            0x74, 0x65, 0x73, 0x74,
+          0x08, 0x03,
+            0x6b, 0x65, 0x79,
+          0x08, 0x07,
+            0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
+  };
+  Block errorBlock4(error4, sizeof(error4));
+  BOOST_CHECK_THROW(SignatureInfo(errorBlock4, SignatureInfo::Type::Interest), tlv::Error);
+
+  // SignatureType and KeyLocator out-of-order
+  const uint8_t error5[] = {
+    0x2c, 0x1b, // SignatureInfo
+      0x1c, 0x16, // KeyLocator
+        0x07, 0x14, // Name
+          0x08, 0x04,
+            0x74, 0x65, 0x73, 0x74,
+          0x08, 0x03,
+            0x6b, 0x65, 0x79,
+          0x08, 0x07,
+            0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72,
+      0x1b, 0x01, // SignatureType
+        0x01, // Sha256WithRsa
+  };
+  Block errorBlock5(error5, sizeof(error5));
+  BOOST_CHECK_THROW(SignatureInfo(errorBlock5, SignatureInfo::Type::Interest), tlv::Error);
+
+  // Repeated KeyLocator
+  const uint8_t error6[] = {
+    0x2c, 0x33, // SignatureInfo
+      0x1b, 0x01, // SignatureType
+        0x01, // Sha256WithRsa
+      0x1c, 0x16, // KeyLocator
+        0x07, 0x14, // Name
+          0x08, 0x04,
+            0x74, 0x65, 0x73, 0x74,
+          0x08, 0x03,
+            0x6b, 0x65, 0x79,
+          0x08, 0x07,
+            0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72,
+      0x1c, 0x16, // KeyLocator
+        0x07, 0x14, // Name
+          0x08, 0x04,
+            0x74, 0x65, 0x73, 0x74,
+          0x08, 0x03,
+            0x6b, 0x65, 0x79,
+          0x08, 0x07,
+            0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
+  };
+  Block errorBlock6(error6, sizeof(error6));
+  BOOST_CHECK_THROW(SignatureInfo(errorBlock6, SignatureInfo::Type::Interest), tlv::Error);
+
+  // Zero-length SignatureNonce
+  const uint8_t error7[] = {
+    0x2c, 0x05, // SignatureInfo
+      0x1b, 0x01, // SignatureType
+        0x01, // Sha256WithRsa
+      0x26, 0x00 // SignatureNonce
+  };
+  Block errorBlock7(error7, sizeof(error7));
+  BOOST_CHECK_THROW(SignatureInfo(errorBlock7, SignatureInfo::Type::Interest), tlv::Error);
+}
+
 BOOST_AUTO_TEST_CASE(ValidityPeriod)
 {
   const uint8_t sigInfo[] = {
@@ -207,12 +392,10 @@
   security::ValidityPeriod vp1(notBefore, notAfter);
 
   SignatureInfo info(tlv::SignatureSha256WithRsa, KeyLocator("/test/key/locator"));
-  BOOST_CHECK_EQUAL(info.hasValidityPeriod(), false);
   BOOST_CHECK_THROW(info.getValidityPeriod(), SignatureInfo::Error);
 
   info.wireEncode();
   info.setValidityPeriod(vp1);
-  BOOST_CHECK_EQUAL(info.hasValidityPeriod(), true);
   BOOST_CHECK_EQUAL(info.getValidityPeriod(), vp1);
   BOOST_CHECK_EQUAL(info.hasWire(), false);
 
@@ -227,13 +410,11 @@
 
   // decode
   Block block(sigInfo, sizeof(sigInfo));
-  SignatureInfo info2(block);
-  BOOST_CHECK_EQUAL(info2.hasValidityPeriod(), true);
+  SignatureInfo info2(block, SignatureInfo::Type::Data);
   BOOST_CHECK_EQUAL(info2.getValidityPeriod(), vp1);
   BOOST_CHECK_EQUAL(info2.hasWire(), true);
 
   info2.setValidityPeriod(security::ValidityPeriod(notBefore, notBefore + 42_days));
-  BOOST_CHECK_EQUAL(info2.hasValidityPeriod(), true);
   BOOST_CHECK_NE(info2.getValidityPeriod(), vp1);
   BOOST_CHECK(info2.getValidityPeriod().getPeriod() == std::make_pair(notBefore, notBefore + 42_days));
   BOOST_CHECK_EQUAL(info2.hasWire(), false);
@@ -241,51 +422,93 @@
   info2.wireEncode();
   BOOST_CHECK_EQUAL(info2.hasWire(), true);
   info2.setValidityPeriod(nullopt);
-  BOOST_CHECK_EQUAL(info2.hasValidityPeriod(), false);
   BOOST_CHECK_THROW(info2.getValidityPeriod(), SignatureInfo::Error);
   BOOST_CHECK_EQUAL(info2.hasWire(), false);
 }
 
-BOOST_AUTO_TEST_CASE(OtherTlvs)
+BOOST_AUTO_TEST_CASE(CustomTlvs)
 {
   SignatureInfo info(tlv::SignatureSha256WithEcdsa);
-  info.appendTypeSpecificTlv("810101"_block);
-  BOOST_CHECK_THROW(info.getTypeSpecificTlv(0x82), SignatureInfo::Error);
-  BOOST_CHECK_EQUAL(info.getTypeSpecificTlv(0x81).type(), 0x81);
+  info.addCustomTlv("810101"_block);
+  BOOST_CHECK(!info.getCustomTlv(0x82));
+  BOOST_REQUIRE(info.getCustomTlv(0x81));
+  BOOST_CHECK_EQUAL(info.getCustomTlv(0x81)->type(), 0x81);
 
   info.wireEncode();
   BOOST_CHECK_EQUAL(info.hasWire(), true);
-  info.appendTypeSpecificTlv("82020202"_block);
+  info.addCustomTlv("82020202"_block);
   BOOST_CHECK_EQUAL(info.hasWire(), false);
+
+  info.wireEncode();
+  BOOST_CHECK_EQUAL(info.hasWire(), true);
+  info.removeCustomTlv(0x81);
+  BOOST_CHECK_EQUAL(info.hasWire(), false);
+  BOOST_CHECK(!info.getCustomTlv(0x81));
 }
 
-BOOST_AUTO_TEST_CASE(OtherTlvsEncoding) // Bug #3914
+BOOST_AUTO_TEST_CASE(CustomTlvsEncoding) // Bug #3914
 {
   SignatureInfo info1(tlv::SignatureSha256WithRsa);
-  info1.appendTypeSpecificTlv(makeStringBlock(101, "First"));
-  info1.appendTypeSpecificTlv(makeStringBlock(102, "Second"));
-  info1.appendTypeSpecificTlv(makeStringBlock(103, "Third"));
+  info1.appendTypeSpecificTlv(makeStringBlock(102, "First"));
+  info1.appendTypeSpecificTlv(makeStringBlock(104, "Second"));
+  info1.appendTypeSpecificTlv(makeStringBlock(106, "Third"));
 
-  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(info1), "SignatureSha256WithRsa { 101 102 103 }");
+  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(info1), "SignatureSha256WithRsa { 102 104 106 }");
 
   SignatureInfo info2;
-  info2.wireDecode(info1.wireEncode());
+  info2.wireDecode(info1.wireEncode(), SignatureInfo::Type::Data);
   BOOST_CHECK_EQUAL(info1, info2);
 
   const uint8_t infoBytes[] = {
     0x16, 0x19, // SignatureInfo
           0x1b, 0x01, 0x01, // SignatureType=1
-          0x65, 0x05, 0x46, 0x69, 0x72, 0x73, 0x74, // 101 "First"
-          0x66, 0x06, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, // 102 "Second"
-          0x67, 0x05, 0x54, 0x68, 0x69, 0x72, 0x64 // 103 "Third"
+          0x66, 0x05, 0x46, 0x69, 0x72, 0x73, 0x74, // 102 "First"
+          0x68, 0x06, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, // 104 "Second"
+          0x6a, 0x05, 0x54, 0x68, 0x69, 0x72, 0x64 // 106 "Third"
   };
 
-  SignatureInfo info3(Block(infoBytes, sizeof(infoBytes)));
+  SignatureInfo info3(Block(infoBytes, sizeof(infoBytes)), SignatureInfo::Type::Data);
   BOOST_CHECK_EQUAL(info3, info1);
   BOOST_CHECK_EQUAL_COLLECTIONS(infoBytes, infoBytes + sizeof(infoBytes),
                                 info1.wireEncode().begin(), info1.wireEncode().end());
 }
 
+BOOST_AUTO_TEST_CASE(OutputStream)
+{
+  SignatureInfo info;
+  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(info), "Invalid SignatureInfo");
+
+  info.setSignatureType(tlv::DigestSha256);
+  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(info), "DigestSha256");
+
+  info.setSignatureType(tlv::SignatureSha256WithRsa);
+  info.setKeyLocator(KeyLocator("/test/key/locator"));
+  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(info),
+                    "SignatureSha256WithRsa Name=/test/key/locator");
+
+  info.setNonce(std::vector<uint8_t>{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08});
+  info.setTime(time::system_clock::time_point(1590169108480_ms));
+  info.setSeqNum(0x1020);
+
+  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(info),
+                    "SignatureSha256WithRsa Name=/test/key/locator "
+                    "{ Nonce=0102030405060708 Time=1590169108480 SeqNum=4128 }");
+
+  info.setValidityPeriod(security::ValidityPeriod(time::getUnixEpoch(), time::getUnixEpoch() + 31_days));
+
+  info.addCustomTlv("82020102"_block);
+  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(info),
+                    "SignatureSha256WithRsa Name=/test/key/locator "
+                    "{ Nonce=0102030405060708 Time=1590169108480 SeqNum=4128 "
+                    "ValidityPeriod=(19700101T000000, 19700201T000000) 130 }");
+
+  info.addCustomTlv("84020102"_block);
+  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(info),
+                    "SignatureSha256WithRsa Name=/test/key/locator "
+                    "{ Nonce=0102030405060708 Time=1590169108480 SeqNum=4128 "
+                    "ValidityPeriod=(19700101T000000, 19700201T000000) 130 132 }");
+}
+
 BOOST_AUTO_TEST_SUITE_END() // TestSignatureInfo
 
 } // namespace tests
