CryptoStream Constructor (Stream, ICryptoTransform, CryptoStreamMode)
.NET Framework (current version)
Initializes a new instance of the CryptoStream class with a target data stream, the transformation to use, and the mode of the stream.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- stream
-
Type:
System.IO.Stream
The stream on which to perform the cryptographic transformation.
- transform
-
Type:
System.Security.Cryptography.ICryptoTransform
The cryptographic transformation that is to be performed on the stream.
- mode
-
Type:
System.Security.Cryptography.CryptoStreamMode
One of the CryptoStreamMode values.
| Exception | Condition |
|---|---|
| ArgumentException | stream is not readable. |
| ArgumentException | stream is not writable. |
| ArgumentException | stream is invalid. |
Any object that derives from Stream can be passed into the stream parameter. Any object that implements ICryptoTransform (such as HashAlgorithm) can be passed into the transform parameter.
.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Show: