CryptoStream Constructor
Collapse the table of content
Expand the table of content

CryptoStream Constructor (Stream, ICryptoTransform, CryptoStreamMode)

 

Initializes a new instance of the CryptoStream class with a target data stream, the transformation to use, and the mode of the stream.

Namespace:   System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

public CryptoStream(
	Stream stream,
	ICryptoTransform transform,
	CryptoStreamMode mode
)

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.

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2016 Microsoft