using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// Represents the abstract base class from which all implementations of asymmetric algorithms must inherit.
// Token: 0x020004E5 RID: 1253
[ComVisible(true)]
public abstract class AsymmetricAlgorithm : IDisposable
{
/// For a description of this member, see .
// Token: 0x06002E7C RID: 11900 RVA: 0x000950A8 File Offset: 0x000932A8
void IDisposable.Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// When overridden in a derived class, gets the name of the key exchange algorithm.
/// The name of the key exchange algorithm.
// Token: 0x1700092A RID: 2346
// (get) Token: 0x06002E7D RID: 11901
public abstract string KeyExchangeAlgorithm { get; }
/// Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm.
/// The size, in bits, of the key modulus used by the asymmetric algorithm.
/// The key modulus size is invalid.
// Token: 0x1700092B RID: 2347
// (get) Token: 0x06002E7E RID: 11902 RVA: 0x000950B8 File Offset: 0x000932B8
// (set) Token: 0x06002E7F RID: 11903 RVA: 0x000950C0 File Offset: 0x000932C0
public virtual int KeySize
{
get
{
return this.KeySizeValue;
}
set
{
if (!KeySizes.IsLegalKeySize(this.LegalKeySizesValue, value))
{
throw new CryptographicException(Locale.GetText("Key size not supported by algorithm."));
}
this.KeySizeValue = value;
}
}
/// Gets the key sizes that are supported by the asymmetric algorithm.
/// An array that contains the key sizes supported by the asymmetric algorithm.
// Token: 0x1700092C RID: 2348
// (get) Token: 0x06002E80 RID: 11904 RVA: 0x000950F8 File Offset: 0x000932F8
public virtual KeySizes[] LegalKeySizes
{
get
{
return this.LegalKeySizesValue;
}
}
/// Gets the name of the signature algorithm.
/// The name of the signature algorithm.
// Token: 0x1700092D RID: 2349
// (get) Token: 0x06002E81 RID: 11905
public abstract string SignatureAlgorithm { get; }
/// Releases all resources used by the class.
// Token: 0x06002E82 RID: 11906 RVA: 0x00095100 File Offset: 0x00093300
public void Clear()
{
this.Dispose(false);
}
/// When overridden in a derived class, releases the unmanaged resources used by the and optionally releases the managed resources.
/// true to release both managed and unmanaged resources; false to release only unmanaged resources.
// Token: 0x06002E83 RID: 11907
protected abstract void Dispose(bool disposing);
/// When overridden in a derived class, reconstructs an object from an XML string.
/// The XML string to use to reconstruct the object.
// Token: 0x06002E84 RID: 11908
public abstract void FromXmlString(string xmlString);
/// When overridden in a derived class, creates and returns an XML string representation of the current object.
/// An XML string encoding of the current object.
/// true to include private parameters; otherwise, false.
// Token: 0x06002E85 RID: 11909
public abstract string ToXmlString(bool includePrivateParameters);
/// Creates an instance of the default implementation of an asymmetric algorithm.
/// A new instance, unless the default settings have been changed with the <cryptoClass> element.
///
///
///
// Token: 0x06002E86 RID: 11910 RVA: 0x0009510C File Offset: 0x0009330C
public static AsymmetricAlgorithm Create()
{
return AsymmetricAlgorithm.Create("System.Security.Cryptography.AsymmetricAlgorithm");
}
/// Creates an instance of the specified implementation of an asymmetric algorithm.
/// A new instance of the specified asymmetric algorithm implementation.
/// The asymmetric algorithm implementation to use. The following table shows the valid values for the parameter and the algorithms they map to.Parameter valueImplements System.Security.Cryptography.AsymmetricAlgorithmRSASystem.Security.Cryptography.RSADSASystem.Security.Cryptography.DSAECDsaECDsaCngSystem.Security.Cryptography.ECDsaCngECDHECDiffieHellmanECDiffieHellmanCngSystem.Security.Cryptography.ECDiffieHellmanCng
// Token: 0x06002E87 RID: 11911 RVA: 0x00095118 File Offset: 0x00093318
public static AsymmetricAlgorithm Create(string algName)
{
return (AsymmetricAlgorithm)CryptoConfig.CreateFromName(algName);
}
// Token: 0x06002E88 RID: 11912 RVA: 0x00095128 File Offset: 0x00093328
internal static byte[] GetNamedParam(string xml, string param)
{
string text = "<" + param + ">";
int num = xml.IndexOf(text);
if (num == -1)
{
return null;
}
string text2 = "" + param + ">";
int num2 = xml.IndexOf(text2);
if (num2 == -1 || num2 <= num)
{
return null;
}
num += text.Length;
string text3 = xml.Substring(num, num2 - num);
return Convert.FromBase64String(text3);
}
/// Represents the size, in bits, of the key modulus used by the asymmetric algorithm.
// Token: 0x04001267 RID: 4711
protected int KeySizeValue;
/// Specifies the key sizes that are supported by the asymmetric algorithm.
// Token: 0x04001268 RID: 4712
protected KeySizes[] LegalKeySizesValue;
}
}