public virtual void TestConfiguration() { Configuration conf = new Configuration(false); conf.Set("a", "A"); TestKeyProvider.MyKeyProvider kp = new TestKeyProvider.MyKeyProvider(conf); Assert.Equal("A", kp.GetConf().Get("a")); }
public virtual void TestMaterialGeneration() { TestKeyProvider.MyKeyProvider kp = new TestKeyProvider.MyKeyProvider(new Configuration ()); KeyProvider.Options options = new KeyProvider.Options(new Configuration()); options.SetCipher(Cipher); options.SetBitLength(128); kp.CreateKey("hello", options); Assert.Equal(128, kp.size); Assert.Equal(Cipher, kp.algorithm); NUnit.Framework.Assert.IsNotNull(kp.material); kp = new TestKeyProvider.MyKeyProvider(new Configuration()); kp.RollNewVersion("hello"); Assert.Equal(128, kp.size); Assert.Equal(Cipher, kp.algorithm); NUnit.Framework.Assert.IsNotNull(kp.material); }