public void PrintPublicationInfo() { KSI.Ksi ksi = GetKsi(); PublicationRecord publicationRecord = ksi.GetPublicationsFile().GetNearestPublicationRecord(new DateTime(2016, 2, 1)); foreach (string s in publicationRecord.PublicationReferences) { Console.WriteLine("PrintPublicationInfo > publication reference > " + s); } }
public void ToStringInSignatureTest() { PublicationRecord tag = TestUtil.GetCompositeTag <PublicationRecordInSignature>(Constants.PublicationRecord.TagTypeInSignature, new ITlvTag[] { TestUtil.GetCompositeTag <PublicationData>(Constants.PublicationData.TagType, new ITlvTag[] { new IntegerTag(Constants.PublicationData.PublicationTimeTagType, false, false, 1), new ImprintTag(Constants.PublicationData.PublicationHashTagType, false, false, new DataHash(HashAlgorithm.Sha2256, new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 })), }), new StringTag(Constants.PublicationRecord.PublicationReferencesTagType, false, false, "Test publication reference 1"), new StringTag(Constants.PublicationRecord.PublicationReferencesTagType, false, false, "Test publication reference 2"), new StringTag(Constants.PublicationRecord.PublicationRepositoryUriTagType, false, false, "Test publication repository uri 1"), new StringTag(Constants.PublicationRecord.PublicationRepositoryUriTagType, false, false, "Test publication repository uri 2"), }); PublicationRecord tag2 = new PublicationRecordInSignature(new RawTag(tag.Type, tag.NonCritical, tag.Forward, tag.EncodeValue())); Assert.AreEqual(tag.ToString(), tag2.ToString()); }