コード例 #1
0
ファイル: ProtectedKeyCipher.cs プロジェクト: gkowieski/vm
        protected virtual CryptoStream CreateEncryptingStream(
            Stream encryptedStream)
        {
            if (encryptedStream == null)
            {
                throw new ArgumentNullException(nameof(encryptedStream));
            }
            if (!encryptedStream.CanWrite)
            {
                throw new ArgumentException(Resources.StreamNotWritable, nameof(encryptedStream));
            }

            return(new CryptoStream(
                       encryptedStream,
                       Symmetric.CreateEncryptor(),
                       CryptoStreamMode.Write));
        }