public void TestKsiSignatureIdentity() { IKsiSignature signature = GetKsiSignatureFromFile(Resources.KsiSignature_Ok_With_Mixed_Aggregation_Chains); IIdentity[] identity = signature.GetIdentity().ToArray(); Assert.AreEqual(4, identity.Length, "Unexpected identity count."); Assert.AreEqual("GT", identity[0].ClientId, "Unexpected client id in 1st identity element"); Assert.AreEqual("testA", identity[1].ClientId, "Unexpected client id in 2nd last identity element"); Assert.AreEqual("taavi-test", identity[2].ClientId, "Unexpected client id in 3rd last identity element"); Assert.AreEqual("anon", identity[3].ClientId, "Unexpected client id in last identity element"); Assert.AreEqual("127.0.0.1", identity[3].MachineId, "Unexpected machine id last identity element"); Assert.AreEqual(1426671056028078, identity[3].RequestTime, "Unexpected request time in last identity element"); Assert.AreEqual(0, identity[3].SequenceNumber, "Unexpected sequence number in last identity element"); Assert.AreEqual(IdentityType.Metadata, identity[3].IdentityType, "Unexpected identity type in last identity element"); }
public void PrintIdentity() { IKsiSignature signature = LoadExtendedSignature(); Console.WriteLine("PrintIdentity > " + string.Join("::", signature.GetIdentity().Select(i => i.ClientId).ToArray())); }