public TestSymmetricKeyProvider()
        {
            byte[] key;
            byte[] iv;

            using (var provider = new AesCryptoServiceProvider())
            {
                provider.GenerateIV();
                provider.GenerateKey();

                key = provider.Key;
                iv = provider.IV;

                provider.Clear();
            }

            _key = new TestSymmetricKey(key, iv);
        }
예제 #2
0
        public TestSymmetricKeyProvider()
        {
            byte[] key;
            byte[] iv;

            using (var provider = new AesCryptoServiceProvider())
            {
                provider.GenerateIV();
                provider.GenerateKey();

                key = provider.Key;
                iv  = provider.IV;

                provider.Clear();
            }

            _key = new TestSymmetricKey(key, iv);
        }