CryptoStream Constructor (Stream^, ICryptoTransform^, CryptoStreamMode)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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.

.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: