public void TestFluentKey() { var n = new EncTest(); var s = new CeloClavis.TestServer(); ((IEncryptedType)n).KeyServer(s); ((IEncryptedType)n).Key(() => n.SSN, "Key1"); ((IEncryptedType)n).Integrity = n.IntegrityValue; n.SSN = "111-11-1111"; Assert.AreEqual("111-11-1111", ((IEncryptedType)n).AsClear(() => n.SSN)); }
public void TestAspect() { var n = new EncTest(); var s = new CeloClavis.TestServer(); ((IEncryptedType)n).KeyServer = s; ((IEncryptedType)n).EncryptionKeys = s.Map; ((IEncryptedType)n).Integrity = n.IntegrityValue; n.SSN = "111-11-1111"; Assert.AreNotEqual("111-11-1111", n.SSN); }
public void TestDecryption() { var n = new EncTest(); var s = new CeloClavis.TestServer(); ((IEncryptedType)n).KeyServer = s; ((IEncryptedType)n).EncryptionKeys = s.Map; ((IEncryptedType)n).Integrity = n.IntegrityValue; n.SSN = "111-11-1111"; Assert.AreEqual("111-11-1111", ((IEncryptedType)n).AsClear(() => n.SSN)); }
public void TestExtensionMenthods() { var n = new EncTest(); var s = new CeloClavis.TestServer(); n.SetKeyServer(s); n.SetKey(() => n.SSN, "Key1"); n.SetIntegrity(() => n.SSN, n.IntegrityValue); n.SSN = "111-11-1111"; var clear = n.GetClearText(() => n.SSN); Assert.AreEqual("111-11-1111", clear); }