using System; using System.Runtime.InteropServices; using Mono.Security.Cryptography; namespace System.Security.Cryptography { /// Decrypts Optimal Asymmetric Encryption Padding (OAEP) key exchange data. // Token: 0x0200051D RID: 1309 [ComVisible(true)] public class RSAOAEPKeyExchangeDeformatter : AsymmetricKeyExchangeDeformatter { /// Initializes a new instance of the class. // Token: 0x06003030 RID: 12336 RVA: 0x0009DCC4 File Offset: 0x0009BEC4 public RSAOAEPKeyExchangeDeformatter() { } /// Initializes a new instance of the class with the specified key. /// The instance of the algorithm that holds the private key. /// /// is null. // Token: 0x06003031 RID: 12337 RVA: 0x0009DCCC File Offset: 0x0009BECC public RSAOAEPKeyExchangeDeformatter(AsymmetricAlgorithm key) { this.SetKey(key); } /// Gets the parameters for the Optimal Asymmetric Encryption Padding (OAEP) key exchange. /// An XML string containing the parameters of the OAEP key exchange operation. // Token: 0x1700097C RID: 2428 // (get) Token: 0x06003032 RID: 12338 RVA: 0x0009DCDC File Offset: 0x0009BEDC // (set) Token: 0x06003033 RID: 12339 RVA: 0x0009DCE0 File Offset: 0x0009BEE0 public override string Parameters { get { return null; } set { } } /// Extracts secret information from the encrypted key exchange data. /// The secret information derived from the key exchange data. /// The key exchange data within which the secret information is hidden. /// The key exchange data verification has failed. /// The key is missing. /// /// /// // Token: 0x06003034 RID: 12340 RVA: 0x0009DCE4 File Offset: 0x0009BEE4 public override byte[] DecryptKeyExchange(byte[] rgbData) { if (this.rsa == null) { string text = Locale.GetText("No RSA key specified"); throw new CryptographicUnexpectedOperationException(text); } SHA1 sha = SHA1.Create(); byte[] array = PKCS1.Decrypt_OAEP(this.rsa, sha, rgbData); if (array != null) { return array; } throw new CryptographicException(Locale.GetText("OAEP decoding error.")); } /// Sets the private key to use for decrypting the secret information. /// The instance of the algorithm that holds the private key. /// /// is null. // Token: 0x06003035 RID: 12341 RVA: 0x0009DD3C File Offset: 0x0009BF3C public override void SetKey(AsymmetricAlgorithm key) { this.rsa = (RSA)key; } // Token: 0x0400139B RID: 5019 private RSA rsa; } }