Files
Aug2021-Cpp2IL-Dump/mscorlib/System/Security/Cryptography/RSA.cs
T
2026-04-10 22:50:51 +02:00

381 lines
21 KiB
C#

using System;
using System.IO;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace System.Security.Cryptography
{
/// <summary>Represents the base class from which all implementations of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm inherit.</summary>
// Token: 0x02000404 RID: 1028
[Token(Token = "0x2000404")]
[ComVisible(true)]
public abstract class RSA : AsymmetricAlgorithm
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSA" /> class.</summary>
// Token: 0x0600227C RID: 8828 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x600227C")]
[Address(RVA = "0x4093D0", Offset = "0x4081D0", VA = "0x1804093D0")]
protected RSA()
{
}
/// <summary>Creates an instance of the default implementation of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm.</summary>
/// <returns>A new instance of the default implementation of <see cref="T:System.Security.Cryptography.RSA" />.</returns>
// Token: 0x0600227D RID: 8829 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x600227D")]
[Address(RVA = "0x2DB6A80", Offset = "0x2DB5880", VA = "0x182DB6A80")]
public new static RSA Create()
{
return null;
}
/// <summary>Creates an instance of the specified implementation of <see cref="T:System.Security.Cryptography.RSA" />.</summary>
/// <param name="algName">The name of the implementation of <see cref="T:System.Security.Cryptography.RSA" /> to use.</param>
/// <returns>A new instance of the specified implementation of <see cref="T:System.Security.Cryptography.RSA" />.</returns>
// Token: 0x0600227E RID: 8830 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x600227E")]
[Address(RVA = "0x2DB69F0", Offset = "0x2DB57F0", VA = "0x182DB69F0")]
public new static RSA Create(string algName)
{
return null;
}
/// <summary>When overridden in a derived class, encrypts the input data using the specified padding mode.</summary>
/// <param name="data">The data to encrypt.</param>
/// <param name="padding">The padding mode.</param>
/// <returns>The encrypted data.</returns>
/// <exception cref="T:System.NotImplementedException">A derived class must override this method.</exception>
// Token: 0x0600227F RID: 8831 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x600227F")]
[Address(RVA = "0x2DB6C70", Offset = "0x2DB5A70", VA = "0x182DB6C70", Slot = "13")]
public virtual byte[] Encrypt(byte[] data, RSAEncryptionPadding padding)
{
return null;
}
/// <summary>When overridden in a derived class, decrypts the input data using the specified padding mode.</summary>
/// <param name="data">The data to decrypt.</param>
/// <param name="padding">The padding mode.</param>
/// <returns>The decrypted data.</returns>
/// <exception cref="T:System.NotImplementedException">A derived class must override this method.</exception>
// Token: 0x06002280 RID: 8832 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6002280")]
[Address(RVA = "0x2DB6B50", Offset = "0x2DB5950", VA = "0x182DB6B50", Slot = "14")]
public virtual byte[] Decrypt(byte[] data, RSAEncryptionPadding padding)
{
return null;
}
/// <summary>When overridden in a derived class, computes the signature for the specified hash value by encrypting it with the private key using the specified padding.</summary>
/// <param name="hash">The hash value of the data to be signed.</param>
/// <param name="hashAlgorithm">The hash algorithm used to create the hash value of the data.</param>
/// <param name="padding">The padding.</param>
/// <returns>The RSA signature for the specified hash value.</returns>
/// <exception cref="T:System.NotImplementedException">A derived class must override this method.</exception>
// Token: 0x06002281 RID: 8833 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6002281")]
[Address(RVA = "0x2DB77D0", Offset = "0x2DB65D0", VA = "0x182DB77D0", Slot = "15")]
public virtual byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
{
return null;
}
/// <summary>Verifies that a digital signature is valid by determining the hash value in the signature using the specified hash algorithm and padding, and comparing it to the provided hash value.</summary>
/// <param name="hash">The hash value of the signed data.</param>
/// <param name="signature">The signature data to be verified.</param>
/// <param name="hashAlgorithm">The hash algorithm used to create the hash value.</param>
/// <param name="padding">The padding mode.</param>
/// <returns>
/// <see langword="true" /> if the signature is valid; otherwise, <see langword="false" />.</returns>
/// <exception cref="T:System.NotImplementedException">A derived class must override this method.</exception>
// Token: 0x06002282 RID: 8834 RVA: 0x00014DA8 File Offset: 0x00012FA8
[Token(Token = "0x6002282")]
[Address(RVA = "0x2DB7F60", Offset = "0x2DB6D60", VA = "0x182DB7F60", Slot = "16")]
public virtual bool VerifyHash(byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
{
return default(bool);
}
/// <summary>When overridden in a derived class, computes the hash value of a specified portion of a byte array by using a specified hashing algorithm.</summary>
/// <param name="data">The data to be hashed.</param>
/// <param name="offset">The index of the first byte in <paramref name="data" /> that is to be hashed.</param>
/// <param name="count">The number of bytes to hash.</param>
/// <param name="hashAlgorithm">The algorithm to use in hash the data.</param>
/// <returns>The hashed data.</returns>
/// <exception cref="T:System.NotImplementedException">A derived class must override this method.</exception>
// Token: 0x06002283 RID: 8835 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6002283")]
[Address(RVA = "0x2DB7380", Offset = "0x2DB6180", VA = "0x182DB7380", Slot = "17")]
protected virtual byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm)
{
return null;
}
/// <summary>When overridden in a derived class, computes the hash value of a specified binary stream by using a specified hashing algorithm.</summary>
/// <param name="data">The binary stream to hash.</param>
/// <param name="hashAlgorithm">The hash algorithm.</param>
/// <returns>The hashed data.</returns>
/// <exception cref="T:System.NotImplementedException">A derived class must override this method.</exception>
// Token: 0x06002284 RID: 8836 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6002284")]
[Address(RVA = "0x2DB7340", Offset = "0x2DB6140", VA = "0x182DB7340", Slot = "18")]
protected virtual byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm)
{
return null;
}
/// <summary>Computes the hash value of the specified byte array using the specified hash algorithm and padding mode, and signs the resulting hash value.</summary>
/// <param name="data">The input data for which to compute the hash.</param>
/// <param name="hashAlgorithm">The hash algorithm to use to create the hash value.</param>
/// <param name="padding">The padding mode.</param>
/// <returns>The RSA signature for the specified data.</returns>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="data" /> is <see langword="null" />.
/// -or-
/// <paramref name="padding" /> is <see langword="null" />.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="hashAlgorithm" />.<see cref="P:System.Security.Cryptography.HashAlgorithmName.Name" /> is <see langword="null" /> or <see cref="F:System.String.Empty" />.</exception>
// Token: 0x06002285 RID: 8837 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6002285")]
[Address(RVA = "0x2DB73C0", Offset = "0x2DB61C0", VA = "0x182DB73C0")]
public byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
{
return null;
}
/// <summary>Computes the hash value of a portion of the specified byte array using the specified hash algorithm and padding mode, and signs the resulting hash value.</summary>
/// <param name="data">The input data for which to compute the hash.</param>
/// <param name="offset">The offset into the array at which to begin using data.</param>
/// <param name="count">The number of bytes in the array to use as data.</param>
/// <param name="hashAlgorithm">The hash algorithm to use to create the hash value.</param>
/// <param name="padding">The padding mode.</param>
/// <returns>The RSA signature for the specified data.</returns>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="data" /> is <see langword="null" />.
/// -or-
/// <paramref name="padding" /> is <see langword="null" />.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="hashAlgorithm" />.<see cref="P:System.Security.Cryptography.HashAlgorithmName.Name" /> is <see langword="null" /> or <see cref="F:System.String.Empty" />.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="offset" /> is less than zero.
/// -or-
/// <paramref name="count" /> is less than zero.
/// -or-
/// <paramref name="offset" /> + <paramref name="count" /> - 1 results in an index that is beyond the upper bound of <paramref name="data" />.</exception>
// Token: 0x06002286 RID: 8838 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6002286")]
[Address(RVA = "0x2DB7480", Offset = "0x2DB6280", VA = "0x182DB7480", Slot = "19")]
public virtual byte[] SignData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
{
return null;
}
/// <summary>Computes the hash value of the specified stream using the specified hash algorithm and padding mode, and signs the resulting hash value.</summary>
/// <param name="data">The input stream for which to compute the hash.</param>
/// <param name="hashAlgorithm">The hash algorithm to use to create the hash value.</param>
/// <param name="padding">The padding mode.</param>
/// <returns>The RSA signature for the specified data.</returns>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="data" /> is <see langword="null" />.
/// -or-
/// <paramref name="padding" /> is <see langword="null" />.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="hashAlgorithm" />.<see cref="P:System.Security.Cryptography.HashAlgorithmName.Name" /> is <see langword="null" /> or <see cref="F:System.String.Empty" />.</exception>
// Token: 0x06002287 RID: 8839 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6002287")]
[Address(RVA = "0x2DB7670", Offset = "0x2DB6470", VA = "0x182DB7670", Slot = "20")]
public virtual byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
{
return null;
}
/// <summary>Verifies that a digital signature is valid by calculating the hash value of the specified data using the specified hash algorithm and padding, and comparing it to the provided signature.</summary>
/// <param name="data">The signed data.</param>
/// <param name="signature">The signature data to be verified.</param>
/// <param name="hashAlgorithm">The hash algorithm used to create the hash value of the data.</param>
/// <param name="padding">The padding mode.</param>
/// <returns>
/// <see langword="true" /> if the signature is valid; otherwise, <see langword="false" />.</returns>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="data" /> is <see langword="null" />.
/// -or-
/// <paramref name="signature" /> is <see langword="null" />.
/// -or-
/// <paramref name="padding" /> is <see langword="null" />.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="hashAlgorithm" />.<see cref="P:System.Security.Cryptography.HashAlgorithmName.Name" /> is <see langword="null" /> or <see cref="F:System.String.Empty" />.</exception>
// Token: 0x06002288 RID: 8840 RVA: 0x00014DC0 File Offset: 0x00012FC0
[Token(Token = "0x6002288")]
[Address(RVA = "0x2DB7C70", Offset = "0x2DB6A70", VA = "0x182DB7C70")]
public bool VerifyData(byte[] data, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
{
return default(bool);
}
/// <summary>Verifies that a digital signature is valid by calculating the hash value of the data in a portion of a byte array using the specified hash algorithm and padding, and comparing it to the provided signature.</summary>
/// <param name="data">The signed data.</param>
/// <param name="offset">The starting index at which to compute the hash.</param>
/// <param name="count">The number of bytes to hash.</param>
/// <param name="signature">The signature data to be verified.</param>
/// <param name="hashAlgorithm">The hash algorithm used to create the hash value of the data.</param>
/// <param name="padding">The padding mode.</param>
/// <returns>
/// <see langword="true" /> if the signature is valid; otherwise, <see langword="false" />.</returns>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="data" /> is <see langword="null" />.
/// -or-
/// <paramref name="signature" /> is <see langword="null" />.
/// -or-
/// <paramref name="padding" /> is <see langword="null" />.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="hashAlgorithm" />.<see cref="P:System.Security.Cryptography.HashAlgorithmName.Name" /> is <see langword="null" /> or <see cref="F:System.String.Empty" />.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="offset" /> is less than zero.
/// -or-
/// <paramref name="count" /> is less than zero.
/// -or-
/// <paramref name="offset" /> + <paramref name="count" /> - 1 results in an index that is beyond the upper bound of <paramref name="data" />.</exception>
// Token: 0x06002289 RID: 8841 RVA: 0x00014DD8 File Offset: 0x00012FD8
[Token(Token = "0x6002289")]
[Address(RVA = "0x2DB7D30", Offset = "0x2DB6B30", VA = "0x182DB7D30", Slot = "21")]
public virtual bool VerifyData(byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
{
return default(bool);
}
/// <summary>Verifies that a digital signature is valid by calculating the hash value of the specified stream using the specified hash algorithm and padding, and comparing it to the provided signature.</summary>
/// <param name="data">The signed data.</param>
/// <param name="signature">The signature data to be verified.</param>
/// <param name="hashAlgorithm">The hash algorithm used to create the hash value of the data.</param>
/// <param name="padding">The padding mode.</param>
/// <returns>
/// <see langword="true" /> if the signature is valid; otherwise, <see langword="false" />.</returns>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="data" /> is <see langword="null" />.
/// -or-
/// <paramref name="signature" /> is <see langword="null" />.
/// -or-
/// <paramref name="padding" /> is <see langword="null" />.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="hashAlgorithm" />.<see cref="P:System.Security.Cryptography.HashAlgorithmName.Name" /> is <see langword="null" /> or <see cref="F:System.String.Empty" />.</exception>
// Token: 0x0600228A RID: 8842 RVA: 0x00014DF0 File Offset: 0x00012FF0
[Token(Token = "0x600228A")]
[Address(RVA = "0x2DB7AD0", Offset = "0x2DB68D0", VA = "0x182DB7AD0")]
public bool VerifyData(Stream data, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
{
return default(bool);
}
// Token: 0x0600228B RID: 8843 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x600228B")]
[Address(RVA = "0x2DB6B90", Offset = "0x2DB5990", VA = "0x182DB6B90")]
private static Exception DerivedClassMustOverride()
{
return null;
}
// Token: 0x0600228C RID: 8844 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x600228C")]
[Address(RVA = "0x2DB72D0", Offset = "0x2DB60D0", VA = "0x182DB72D0")]
internal static Exception HashAlgorithmNameNullOrEmpty()
{
return null;
}
/// <summary>When overridden in a derived class, decrypts the input data using the private key.</summary>
/// <param name="rgb">The cipher text to be decrypted.</param>
/// <returns>The resulting decryption of the <paramref name="rgb" /> parameter in plain text.</returns>
/// <exception cref="T:System.NotSupportedException">This method call is not supported. This exception is thrown starting with the .NET Framework 4.6.</exception>
// Token: 0x0600228D RID: 8845 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x600228D")]
[Address(RVA = "0x2DB6AE0", Offset = "0x2DB58E0", VA = "0x182DB6AE0", Slot = "22")]
public virtual byte[] DecryptValue(byte[] rgb)
{
return null;
}
/// <summary>When overridden in a derived class, encrypts the input data using the public key.</summary>
/// <param name="rgb">The plain text to be encrypted.</param>
/// <returns>The resulting encryption of the <paramref name="rgb" /> parameter as cipher text.</returns>
/// <exception cref="T:System.NotSupportedException">This method call is not supported. This exception is thrown starting with the .NET Framework 4.6.</exception>
// Token: 0x0600228E RID: 8846 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x600228E")]
[Address(RVA = "0x2DB6C00", Offset = "0x2DB5A00", VA = "0x182DB6C00", Slot = "23")]
public virtual byte[] EncryptValue(byte[] rgb)
{
return null;
}
/// <summary>Gets the name of the key exchange algorithm available with this implementation of <see cref="T:System.Security.Cryptography.RSA" />.</summary>
/// <returns>Returns "RSA".</returns>
// Token: 0x170004BF RID: 1215
// (get) Token: 0x0600228F RID: 8847 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x170004BF")]
public override string KeyExchangeAlgorithm
{
[Token(Token = "0x600228F")]
[Address(RVA = "0x2DB7FA0", Offset = "0x2DB6DA0", VA = "0x182DB7FA0", Slot = "10")]
get
{
return null;
}
}
/// <summary>Gets the name of the signature algorithm available with this implementation of <see cref="T:System.Security.Cryptography.RSA" />.</summary>
/// <returns>Returns "RSA".</returns>
// Token: 0x170004C0 RID: 1216
// (get) Token: 0x06002290 RID: 8848 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x170004C0")]
public override string SignatureAlgorithm
{
[Token(Token = "0x6002290")]
[Address(RVA = "0x2DB7FD0", Offset = "0x2DB6DD0", VA = "0x182DB7FD0", Slot = "9")]
get
{
return null;
}
}
/// <summary>Initializes an <see cref="T:System.Security.Cryptography.RSA" /> object from the key information from an XML string.</summary>
/// <param name="xmlString">The XML string containing <see cref="T:System.Security.Cryptography.RSA" /> key information.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="xmlString" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The format of the <paramref name="xmlString" /> parameter is not valid.</exception>
/// <exception cref="T:System.PlatformNotSupportedException">.NET Core only: This member is not supported.</exception>
// Token: 0x06002291 RID: 8849 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002291")]
[Address(RVA = "0x2DB6CB0", Offset = "0x2DB5AB0", VA = "0x182DB6CB0", Slot = "11")]
public override void FromXmlString(string xmlString)
{
}
/// <summary>Creates and returns an XML string containing the key of the current <see cref="T:System.Security.Cryptography.RSA" /> object.</summary>
/// <param name="includePrivateParameters">
/// <see langword="true" /> to include a public and private RSA key; <see langword="false" /> to include only the public key.</param>
/// <returns>An XML string containing the key of the current <see cref="T:System.Security.Cryptography.RSA" /> object.</returns>
/// <exception cref="T:System.PlatformNotSupportedException">.NET Core only: This member is not supported.</exception>
// Token: 0x06002292 RID: 8850 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6002292")]
[Address(RVA = "0x2DB7810", Offset = "0x2DB6610", VA = "0x182DB7810", Slot = "12")]
public override string ToXmlString(bool includePrivateParameters)
{
return null;
}
/// <summary>When overridden in a derived class, exports the <see cref="T:System.Security.Cryptography.RSAParameters" />.</summary>
/// <param name="includePrivateParameters">
/// <see langword="true" /> to include private parameters; otherwise, <see langword="false" />.</param>
/// <returns>The parameters for <see cref="T:System.Security.Cryptography.RSA" />.</returns>
// Token: 0x06002293 RID: 8851
[Token(Token = "0x6002293")]
[Address(Slot = "24")]
public abstract RSAParameters ExportParameters(bool includePrivateParameters);
/// <summary>When overridden in a derived class, imports the specified <see cref="T:System.Security.Cryptography.RSAParameters" />.</summary>
/// <param name="parameters">The parameters for <see cref="T:System.Security.Cryptography.RSA" />.</param>
// Token: 0x06002294 RID: 8852
[Token(Token = "0x6002294")]
[Address(Slot = "25")]
public abstract void ImportParameters(RSAParameters parameters);
}
}