CryptoStream Constructors
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |
- Source:
- CryptoStream.cs
- Source:
- CryptoStream.cs
- Source:
- CryptoStream.cs
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
Public Sub New (stream As Stream, transform As ICryptoTransform, mode As CryptoStreamMode)
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
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.3, 1.4, 1.6, 2.0, 2.1 |
- Source:
- CryptoStream.cs
- Source:
- CryptoStream.cs
- Source:
- CryptoStream.cs
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
Public Sub New (stream As Stream, transform As ICryptoTransform, mode As CryptoStreamMode, leaveOpen As Boolean)
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
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: