Example #1
0
        public void PutKeyTest()
        {
            File.Delete("foo.key");

            var target = new KeyFile();

            target.PutKey(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, "foo.key");

            Assert.IsTrue(File.Exists("foo.key"));

            File.Delete("foo.key");
        }
Example #2
0
        public void GetKeyTest()
        {
            File.Delete("foo.key");

            var target = new KeyFile();

            target.PutKey(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, "foo.key");

            Assert.IsTrue(File.Exists("foo.key"));

            var key = target.GetKey("foo.key");

            Assert.IsNotNull(key);
            Assert.IsTrue(key.SequenceEqual(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }));

            File.Delete("foo.key");
        }
Example #3
0
        public void PutKeyEmptyLocationTest()
        {
            var target = new KeyFile();

            target.PutKey(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, "");
        }