Exemplo n.º 1
0
        public void Terminate()
        {
            MemoryStream stream = new MemoryStream();

            using (var writer = new BinaryWriter(stream))
            {
                writer.Write(_algo.Key);

                if (_values.Count > 0)
                {
                    byte[] data = EncryptArray(_values.ToArray());
                    writer.Write(data);
                }
            }

            _encryptedData.SetInitalValue(stream.ToArray());
        }
Exemplo n.º 2
0
        public void Terminate()
        {
            if (_strings.Count == 0)
            {
                return;
            }

            MemoryStream stream = new MemoryStream();

            using (var writer = new BinaryWriter(stream))
            {
                writer.Write(_algo.Key);

                byte[] data = EncryptArray(_strings.ToArray());
                writer.Write(data);
            }

            _encryptedData.SetInitalValue(stream.ToArray());
        }