This documentation is archived and is not being maintained.

CryptoStream Constructor

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

[Visual Basic]
Public Sub New( _
   ByVal stream As Stream, _
   ByVal transform As ICryptoTransform, _
   ByVal mode As CryptoStreamMode _
public CryptoStream(
   Stream stream,
 ICryptoTransform transform,
 CryptoStreamMode mode
public: CryptoStream(
   Stream* stream,
 ICryptoTransform* transform,
 CryptoStreamMode mode
public function CryptoStream(
   stream : Stream,
 transform : ICryptoTransform,
 mode : CryptoStreamMode


The stream on which to perform the cryptographic transformation.
The cryptographic transformation that is to be performed on the stream.
One of the CryptoStreamMode values.


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.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

CryptoStream Class | CryptoStream Members | System.Security.Cryptography Namespace | Cryptographic Services