CryptoStream Constructors

Definition

Overloads

CryptoStream(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.

CryptoStream(Stream, ICryptoTransform, CryptoStreamMode, Boolean)

Initializes a new instance of the CryptoStream class.

CryptoStream(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.

public:
 CryptoStream(System::IO::Stream ^ stream, System::Security::Cryptography::ICryptoTransform ^ transform, System::Security::Cryptography::CryptoStreamMode mode);
public CryptoStream (System.IO.Stream stream, System.Security.Cryptography.ICryptoTransform transform, System.Security.Cryptography.CryptoStreamMode mode);
new System.Security.Cryptography.CryptoStream : System.IO.Stream * System.Security.Cryptography.ICryptoTransform * System.Security.Cryptography.CryptoStreamMode -> System.Security.Cryptography.CryptoStream

Parameters

stream
Stream

The stream on which to perform the cryptographic transformation.

transform
ICryptoTransform

The cryptographic transformation that is to be performed on the stream.

mode
CryptoStreamMode

One of the CryptoStreamMode values.

Exceptions

stream is invalid.

Remarks

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.

See also

CryptoStream(Stream, ICryptoTransform, CryptoStreamMode, Boolean)

Initializes a new instance of the CryptoStream class.

public:
 CryptoStream(System::IO::Stream ^ stream, System::Security::Cryptography::ICryptoTransform ^ transform, System::Security::Cryptography::CryptoStreamMode mode, bool leaveOpen);
public CryptoStream (System.IO.Stream stream, System.Security.Cryptography.ICryptoTransform transform, System.Security.Cryptography.CryptoStreamMode mode, bool leaveOpen);
new System.Security.Cryptography.CryptoStream : System.IO.Stream * System.Security.Cryptography.ICryptoTransform * System.Security.Cryptography.CryptoStreamMode * bool -> System.Security.Cryptography.CryptoStream

Parameters

stream
Stream

The stream on which to perform the cryptographic transformation.

transform
ICryptoTransform

The cryptographic transformation that is to be performed on the stream.

mode
CryptoStreamMode

The mode of the stream.

leaveOpen
Boolean

true to not close the underlying stream when the CryptoStream object is disposed; otherwise, false.

Exceptions

mode is invalid.

Applies to