System::Security::Cryptography::CryptoStream class

CryptoStream class

Stream implementation that wraps existing stream with a cryptographic function. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

class CryptoStream : public System::IO::Stream

Methods

MethodDescription
Close() overrideCloses connection.
CryptoStream(const SharedPtr<System::IO::Stream>&, const SharedPtr<ICryptoTransform>&, CryptoStreamMode)Constructor.
Flush() overrideEmpties buffer into wrapped stream. Does nothing as transform algorithm can be still waiting for more data.
FlushFinalBlock()Writes the data which is still in the buffer to stream.
get_CanRead() const overrideChecks if stream is readable.
get_CanSeek() const overrideChecks if stream is seekable.
get_CanWrite() const overrideChecks if stream is writable.
get_Length() const overrideGets length of stream. Not supported.
get_Position() const overrideGets current position in stream. Not supported.
Read(const ArrayPtr<uint8_t>&, int32_t, int32_t) overrideReads data from stream.
Read(const System::Details::ArrayView<uint8_t>&, int32_t, int32_t) overrideReads data from stream.
Seek(int64_t, IO::SeekOrigin) overrideSeeks position in stream. Not supported.
set_Position(int64_t) overrideSeeks position in stream. Not supported.
SetLength(int64_t) overrideSeeks size of stream. Not supported.
Write(const ArrayPtr<uint8_t>&, int32_t, int32_t) overrideWrites data to stream.
Write(const System::Details::ArrayView<uint8_t>&, int32_t, int32_t) overrideWrites data to stream.

Fields

FieldDescription
static NullA stream with no underlying storage.

See Also