public void Decrypt_Different_Version() { c = Crypter.Default(() => "password"); VersionedCrypterProvider provider = vsn => Crypter.Default(() => vsn); // 違うバージョンで読み出しても復号化できる var k1 = KeyValueStorage.Secure("test", "1", provider); k1.Upsert("key", "value"); Assert.AreEqual("value", k1.GetString("key")); var k2 = KeyValueStorage.Secure("test", "2", provider); Assert.AreEqual("value", k2.GetString("key")); // k2 -> k1 k2.Upsert("key2", "value2"); Assert.AreEqual("value2", k1.GetString("key2")); }
public void SetUp() { kvs = KeyValueStorage.Secure("Test", Application.version, version => Crypter.Default(() => "password")); }