Files
27Aug2021-Cpp2IL-Dump/mscorlib/System/Security/Cryptography/CryptoStream.cs
T
niko c12fbe3fc6 m
2026-04-12 16:51:38 +02:00

406 lines
20 KiB
C#

using System;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Cpp2IlInjected;
namespace System.Security.Cryptography
{
/// <summary>Defines a stream that links data streams to cryptographic transformations.</summary>
// Token: 0x020003FA RID: 1018
[Token(Token = "0x20003FA")]
[ComVisible(true)]
public class CryptoStream : Stream, IDisposable
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CryptoStream" /> class with a target data stream, the transformation to use, and the mode of the stream.</summary>
/// <param name="stream">The stream on which to perform the cryptographic transformation.</param>
/// <param name="transform">The cryptographic transformation that is to be performed on the stream.</param>
/// <param name="mode">One of the <see cref="T:System.Security.Cryptography.CryptoStreamMode" /> values.</param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="stream" /> is invalid.</exception>
// Token: 0x06002365 RID: 9061 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002365")]
[Address(RVA = "0xC03230", Offset = "0xC02230", VA = "0x180C03230")]
public CryptoStream(Stream stream, ICryptoTransform transform, CryptoStreamMode mode)
{
}
/// <summary>Gets a value indicating whether the current <see cref="T:System.Security.Cryptography.CryptoStream" /> is readable.</summary>
/// <returns>
/// <see langword="true" /> if the current stream is readable; otherwise, <see langword="false" />.</returns>
// Token: 0x17000506 RID: 1286
// (get) Token: 0x06002366 RID: 9062 RVA: 0x00016BC0 File Offset: 0x00014DC0
[Token(Token = "0x17000506")]
public override bool CanRead
{
[Token(Token = "0x6002366")]
[Address(RVA = "0x497580", Offset = "0x496580", VA = "0x180497580", Slot = "7")]
get
{
return default(bool);
}
}
/// <summary>Gets a value indicating whether you can seek within the current <see cref="T:System.Security.Cryptography.CryptoStream" />.</summary>
/// <returns>Always <see langword="false" />.</returns>
// Token: 0x17000507 RID: 1287
// (get) Token: 0x06002367 RID: 9063 RVA: 0x00016BD8 File Offset: 0x00014DD8
[Token(Token = "0x17000507")]
public override bool CanSeek
{
[Token(Token = "0x6002367")]
[Address(RVA = "0x424690", Offset = "0x423690", VA = "0x180424690", Slot = "8")]
get
{
return default(bool);
}
}
/// <summary>Gets a value indicating whether the current <see cref="T:System.Security.Cryptography.CryptoStream" /> is writable.</summary>
/// <returns>
/// <see langword="true" /> if the current stream is writable; otherwise, <see langword="false" />.</returns>
// Token: 0x17000508 RID: 1288
// (get) Token: 0x06002368 RID: 9064 RVA: 0x00016BF0 File Offset: 0x00014DF0
[Token(Token = "0x17000508")]
public override bool CanWrite
{
[Token(Token = "0x6002368")]
[Address(RVA = "0xC034A0", Offset = "0xC024A0", VA = "0x180C034A0", Slot = "9")]
get
{
return default(bool);
}
}
/// <summary>Gets the length in bytes of the stream.</summary>
/// <returns>This property is not supported.</returns>
/// <exception cref="T:System.NotSupportedException">This property is not supported.</exception>
// Token: 0x17000509 RID: 1289
// (get) Token: 0x06002369 RID: 9065 RVA: 0x00016C08 File Offset: 0x00014E08
[Token(Token = "0x17000509")]
public override long Length
{
[Token(Token = "0x6002369")]
[Address(RVA = "0xC034C0", Offset = "0xC024C0", VA = "0x180C034C0", Slot = "10")]
get
{
return 0L;
}
}
/// <summary>Gets or sets the position within the current stream.</summary>
/// <returns>This property is not supported.</returns>
/// <exception cref="T:System.NotSupportedException">This property is not supported.</exception>
// Token: 0x1700050A RID: 1290
// (get) Token: 0x0600236A RID: 9066 RVA: 0x00016C20 File Offset: 0x00014E20
// (set) Token: 0x0600236B RID: 9067 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x1700050A")]
public override long Position
{
[Token(Token = "0x600236A")]
[Address(RVA = "0xC03530", Offset = "0xC02530", VA = "0x180C03530", Slot = "11")]
get
{
return 0L;
}
[Token(Token = "0x600236B")]
[Address(RVA = "0xC035A0", Offset = "0xC025A0", VA = "0x180C035A0", Slot = "12")]
set
{
}
}
/// <summary>Gets a value indicating whether the final buffer block has been written to the underlying stream.</summary>
/// <returns>
/// <see langword="true" /> if the final block has been flushed; otherwise, <see langword="false" />.</returns>
// Token: 0x1700050B RID: 1291
// (get) Token: 0x0600236C RID: 9068 RVA: 0x00016C38 File Offset: 0x00014E38
[Token(Token = "0x1700050B")]
public bool HasFlushedFinalBlock
{
[Token(Token = "0x600236C")]
[Address(RVA = "0xC034B0", Offset = "0xC024B0", VA = "0x180C034B0")]
get
{
return default(bool);
}
}
/// <summary>Updates the underlying data source or repository with the current state of the buffer, then clears the buffer.</summary>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key is corrupt which can cause invalid padding to the stream.</exception>
/// <exception cref="T:System.NotSupportedException">The current stream is not writable.
/// -or-
/// The final block has already been transformed.</exception>
// Token: 0x0600236D RID: 9069 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x600236D")]
[Address(RVA = "0xC01CB0", Offset = "0xC00CB0", VA = "0x180C01CB0")]
public void FlushFinalBlock()
{
}
/// <summary>Clears all buffers for the current stream and causes any buffered data to be written to the underlying device.</summary>
// Token: 0x0600236E RID: 9070 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x600236E")]
[Address(RVA = "0x4242D0", Offset = "0x4232D0", VA = "0x1804242D0", Slot = "17")]
public override void Flush()
{
}
/// <summary>Clears all buffers for the current stream asynchronously, causes any buffered data to be written to the underlying device, and monitors cancellation requests.</summary>
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" />.</param>
/// <returns>A task that represents the asynchronous flush operation.</returns>
/// <exception cref="T:System.ObjectDisposedException">The stream has been disposed.</exception>
// Token: 0x0600236F RID: 9071 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x600236F")]
[Address(RVA = "0xC01B90", Offset = "0xC00B90", VA = "0x180C01B90", Slot = "18")]
public override Task FlushAsync(CancellationToken cancellationToken)
{
return null;
}
/// <summary>Sets the position within the current stream.</summary>
/// <param name="offset">A byte offset relative to the <paramref name="origin" /> parameter.</param>
/// <param name="origin">A <see cref="T:System.IO.SeekOrigin" /> object indicating the reference point used to obtain the new position.</param>
/// <returns>This method is not supported.</returns>
/// <exception cref="T:System.NotSupportedException">This method is not supported.</exception>
// Token: 0x06002370 RID: 9072 RVA: 0x00016C50 File Offset: 0x00014E50
[Token(Token = "0x6002370")]
[Address(RVA = "0xC02900", Offset = "0xC01900", VA = "0x180C02900", Slot = "25")]
public override long Seek(long offset, SeekOrigin origin)
{
return 0L;
}
/// <summary>Sets the length of the current stream.</summary>
/// <param name="value">The desired length of the current stream in bytes.</param>
/// <exception cref="T:System.NotSupportedException">This property exists only to support inheritance from <see cref="T:System.IO.Stream" />, and cannot be used.</exception>
// Token: 0x06002371 RID: 9073 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002371")]
[Address(RVA = "0xC02970", Offset = "0xC01970", VA = "0x180C02970", Slot = "26")]
public override void SetLength(long value)
{
}
/// <summary>Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.</summary>
/// <param name="buffer">An array of bytes. A maximum of <paramref name="count" /> bytes are read from the current stream and stored in <paramref name="buffer" />.</param>
/// <param name="offset">The byte offset in <paramref name="buffer" /> at which to begin storing the data read from the current stream.</param>
/// <param name="count">The maximum number of bytes to be read from the current stream.</param>
/// <returns>The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero if the end of the stream has been reached.</returns>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Security.Cryptography.CryptoStreamMode" /> associated with current <see cref="T:System.Security.Cryptography.CryptoStream" /> object does not match the underlying stream. For example, this exception is thrown when using <see cref="F:System.Security.Cryptography.CryptoStreamMode.Read" /> with an underlying stream that is write only.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> parameter is less than zero.
/// -or-
/// The <paramref name="count" /> parameter is less than zero.</exception>
/// <exception cref="T:System.ArgumentException">Thesum of the <paramref name="count" /> and <paramref name="offset" /> parameters is longer than the length of the buffer.</exception>
// Token: 0x06002372 RID: 9074 RVA: 0x00016C68 File Offset: 0x00014E68
[Token(Token = "0x6002372")]
[Address(RVA = "0xC023A0", Offset = "0xC013A0", VA = "0x180C023A0", Slot = "27")]
public override int Read([In] [Out] byte[] buffer, int offset, int count)
{
return 0;
}
/// <summary>Reads a sequence of bytes from the current stream asynchronously, advances the position within the stream by the number of bytes read, and monitors cancellation requests.</summary>
/// <param name="buffer">The buffer to write the data into.</param>
/// <param name="offset">The byte offset in <paramref name="buffer" /> at which to begin writing data from the stream.</param>
/// <param name="count">The maximum number of bytes to read.</param>
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" />.</param>
/// <returns>A task that represents the asynchronous read operation. The value of the task object's <paramref name="TResult" /> parameter contains the total number of bytes read into the buffer. The result can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached.</returns>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="buffer" /> is <see langword="null" />.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="offset" /> or <paramref name="count" /> is negative.</exception>
/// <exception cref="T:System.ArgumentException">The sum of <paramref name="offset" /> and <paramref name="count" /> is larger than the buffer length.</exception>
/// <exception cref="T:System.NotSupportedException">The stream does not support reading.</exception>
/// <exception cref="T:System.ObjectDisposedException">The stream has been disposed.</exception>
/// <exception cref="T:System.InvalidOperationException">The stream is currently in use by a previous read operation.</exception>
// Token: 0x06002373 RID: 9075 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6002373")]
[Address(RVA = "0xC02040", Offset = "0xC01040", VA = "0x180C02040", Slot = "21")]
public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
return null;
}
// Token: 0x06002374 RID: 9076 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6002374")]
[Address(RVA = "0xC01F20", Offset = "0xC00F20", VA = "0x180C01F20")]
private Task<int> ReadAsyncInternal(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
return null;
}
/// <summary>Writes a sequence of bytes to the current <see cref="T:System.Security.Cryptography.CryptoStream" /> and advances the current position within the stream by the number of bytes written.</summary>
/// <param name="buffer">An array of bytes. This method copies <paramref name="count" /> bytes from <paramref name="buffer" /> to the current stream.</param>
/// <param name="offset">The byte offset in <paramref name="buffer" /> at which to begin copying bytes to the current stream.</param>
/// <param name="count">The number of bytes to be written to the current stream.</param>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Security.Cryptography.CryptoStreamMode" /> associated with current <see cref="T:System.Security.Cryptography.CryptoStream" /> object does not match the underlying stream. For example, this exception is thrown when using <see cref="F:System.Security.Cryptography.CryptoStreamMode.Write" /> with an underlying stream that is read only.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> parameter is less than zero.
/// -or-
/// The <paramref name="count" /> parameter is less than zero.</exception>
/// <exception cref="T:System.ArgumentException">The sum of the <paramref name="count" /> and <paramref name="offset" /> parameters is longer than the length of the buffer.</exception>
// Token: 0x06002375 RID: 9077 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002375")]
[Address(RVA = "0xC02E40", Offset = "0xC01E40", VA = "0x180C02E40", Slot = "29")]
public override void Write(byte[] buffer, int offset, int count)
{
}
/// <summary>Writes a sequence of bytes to the current stream asynchronously, advances the current position within the stream by the number of bytes written, and monitors cancellation requests.</summary>
/// <param name="buffer">The buffer to write data from.</param>
/// <param name="offset">The zero-based byte offset in <paramref name="buffer" /> from which to begin writing bytes to the stream.</param>
/// <param name="count">The maximum number of bytes to write.</param>
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" />.</param>
/// <returns>A task that represents the asynchronous write operation.</returns>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="buffer" /> is <see langword="null" />.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="offset" /> or <paramref name="count" /> is negative.</exception>
/// <exception cref="T:System.ArgumentException">The sum of <paramref name="offset" /> and <paramref name="count" /> is larger than the buffer length.</exception>
/// <exception cref="T:System.NotSupportedException">The stream does not support writing.</exception>
/// <exception cref="T:System.ObjectDisposedException">The stream has been disposed.</exception>
/// <exception cref="T:System.InvalidOperationException">The stream is currently in use by a previous write operation.</exception>
// Token: 0x06002376 RID: 9078 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6002376")]
[Address(RVA = "0xC02AF0", Offset = "0xC01AF0", VA = "0x180C02AF0", Slot = "24")]
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
return null;
}
// Token: 0x06002377 RID: 9079 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6002377")]
[Address(RVA = "0xC029E0", Offset = "0xC019E0", VA = "0x180C029E0")]
private Task WriteAsyncInternal(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
return null;
}
/// <summary>Releases all resources used by the <see cref="T:System.Security.Cryptography.CryptoStream" />.</summary>
// Token: 0x06002378 RID: 9080 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002378")]
[Address(RVA = "0x9DE1B0", Offset = "0x9DD1B0", VA = "0x1809DE1B0")]
public void Clear()
{
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.CryptoStream" /> and optionally releases the managed resources.</summary>
/// <param name="disposing">
/// <see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
// Token: 0x06002379 RID: 9081 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002379")]
[Address(RVA = "0xC01A50", Offset = "0xC00A50", VA = "0x180C01A50", Slot = "16")]
protected override void Dispose(bool disposing)
{
}
// Token: 0x0600237A RID: 9082 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x600237A")]
[Address(RVA = "0xC01E90", Offset = "0xC00E90", VA = "0x180C01E90")]
private void InitializeBuffer()
{
}
// Token: 0x040013E3 RID: 5091
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x40013E3")]
private Stream _stream;
// Token: 0x040013E4 RID: 5092
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x40013E4")]
private ICryptoTransform _Transform;
// Token: 0x040013E5 RID: 5093
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x40013E5")]
private byte[] _InputBuffer;
// Token: 0x040013E6 RID: 5094
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x40013E6")]
private int _InputBufferIndex;
// Token: 0x040013E7 RID: 5095
[global::Cpp2IlInjected.FieldOffset(Offset = "0x44")]
[Token(Token = "0x40013E7")]
private int _InputBlockSize;
// Token: 0x040013E8 RID: 5096
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x40013E8")]
private byte[] _OutputBuffer;
// Token: 0x040013E9 RID: 5097
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
[Token(Token = "0x40013E9")]
private int _OutputBufferIndex;
// Token: 0x040013EA RID: 5098
[global::Cpp2IlInjected.FieldOffset(Offset = "0x54")]
[Token(Token = "0x40013EA")]
private int _OutputBlockSize;
// Token: 0x040013EB RID: 5099
[global::Cpp2IlInjected.FieldOffset(Offset = "0x58")]
[Token(Token = "0x40013EB")]
private CryptoStreamMode _transformMode;
// Token: 0x040013EC RID: 5100
[global::Cpp2IlInjected.FieldOffset(Offset = "0x5C")]
[Token(Token = "0x40013EC")]
private bool _canRead;
// Token: 0x040013ED RID: 5101
[global::Cpp2IlInjected.FieldOffset(Offset = "0x5D")]
[Token(Token = "0x40013ED")]
private bool _canWrite;
// Token: 0x040013EE RID: 5102
[global::Cpp2IlInjected.FieldOffset(Offset = "0x5E")]
[Token(Token = "0x40013EE")]
private bool _finalBlockTransformed;
// Token: 0x020003FB RID: 1019
[Token(Token = "0x20003FB")]
private struct HopToThreadPoolAwaitable : INotifyCompletion
{
// Token: 0x0600237B RID: 9083 RVA: 0x00016C80 File Offset: 0x00014E80
[Token(Token = "0x600237B")]
[Address(RVA = "0x634740", Offset = "0x633740", VA = "0x180634740")]
public CryptoStream.HopToThreadPoolAwaitable GetAwaiter()
{
return default(CryptoStream.HopToThreadPoolAwaitable);
}
// Token: 0x1700050C RID: 1292
// (get) Token: 0x0600237C RID: 9084 RVA: 0x00016C98 File Offset: 0x00014E98
[Token(Token = "0x1700050C")]
public bool IsCompleted
{
[Token(Token = "0x600237C")]
[Address(RVA = "0x424690", Offset = "0x423690", VA = "0x180424690")]
get
{
return default(bool);
}
}
// Token: 0x0600237D RID: 9085 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x600237D")]
[Address(RVA = "0xC0C4B0", Offset = "0xC0B4B0", VA = "0x180C0C4B0", Slot = "4")]
public void OnCompleted(Action continuation)
{
}
// Token: 0x0600237E RID: 9086 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x600237E")]
[Address(RVA = "0x4242D0", Offset = "0x4232D0", VA = "0x1804242D0")]
public void GetResult()
{
}
}
}
}