MtCipherStream

Namespace: SharpPluginLoader.Core.IO

Represents a cipher stream. Can be used to encrypt/decrypt data from a stream.

public class MtCipherStream : MtStream, System.IDisposable

Inheritance ObjectNativeWrapperMtObjectMtStreamMtCipherStream
Implements IDisposable

Properties

Flags

The flags of the stream.

public UInt32& Flags { get; }

Property Value

UInt32&

IsReadable

Whether the stream is readable.

public bool IsReadable { get; }

Property Value

Boolean

IsWritable

Whether the stream is writable.

public bool IsWritable { get; }

Property Value

Boolean

IsSeekable

Whether the stream is seekable.

public bool IsSeekable { get; }

Property Value

Boolean

Position

Gets the position of the stream.

public long Position { get; }

Property Value

Int64

Length

Gets or sets the length of the stream.

public long Length { get; set; }

Property Value

Int64

Instance

The native pointer.

public nint Instance { get; set; }

Property Value

IntPtr

Constructors

MtCipherStream(IntPtr)

public MtCipherStream(nint instance)

Parameters

instance IntPtr

MtCipherStream()

public MtCipherStream()

Methods

FromStream(MtStream, CipherStreamMode, String)

Creates a new cipher stream from the specified stream and key.

public MtCipherStream FromStream(MtStream stream, CipherStreamMode mode, string key)

Parameters

stream MtStream
The stream to encrypt/decrypt.

mode CipherStreamMode
The mode to use.

key String
The key to use.

Returns

MtCipherStream
The cipher stream, or null if it could not be created.

Dispose()

public void Dispose()

Finalize()

protected void Finalize()