using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// Decrypts the PKCS #1 key exchange data.
// Token: 0x0200051F RID: 1311
[ComVisible(true)]
public class RSAPKCS1KeyExchangeDeformatter : AsymmetricKeyExchangeDeformatter
{
/// Initializes a new instance of the class.
// Token: 0x06003040 RID: 12352 RVA: 0x0009DE10 File Offset: 0x0009C010
public RSAPKCS1KeyExchangeDeformatter()
{
}
/// Initializes a new instance of the class with the specified key.
/// The instance of the algorithm that holds the private key.
///
/// is null.
// Token: 0x06003041 RID: 12353 RVA: 0x0009DE18 File Offset: 0x0009C018
public RSAPKCS1KeyExchangeDeformatter(AsymmetricAlgorithm key)
{
this.SetKey(key);
}
/// Gets the parameters for the PKCS #1 key exchange.
/// An XML string containing the parameters of the PKCS #1 key exchange operation.
// Token: 0x17000980 RID: 2432
// (get) Token: 0x06003042 RID: 12354 RVA: 0x0009DE28 File Offset: 0x0009C028
// (set) Token: 0x06003043 RID: 12355 RVA: 0x0009DE2C File Offset: 0x0009C02C
public override string Parameters
{
get
{
return null;
}
set
{
}
}
/// Gets or sets the random number generator algorithm to use in the creation of the key exchange.
/// The instance of a random number generator algorithm to use.
// Token: 0x17000981 RID: 2433
// (get) Token: 0x06003044 RID: 12356 RVA: 0x0009DE30 File Offset: 0x0009C030
// (set) Token: 0x06003045 RID: 12357 RVA: 0x0009DE38 File Offset: 0x0009C038
public RandomNumberGenerator RNG
{
get
{
return this.random;
}
set
{
this.random = value;
}
}
/// 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 is missing.
///
///
///
// Token: 0x06003046 RID: 12358 RVA: 0x0009DE44 File Offset: 0x0009C044
public override byte[] DecryptKeyExchange(byte[] rgbIn)
{
if (this.rsa == null)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("No key pair available."));
}
byte[] array = PKCS1.Decrypt_v15(this.rsa, rgbIn);
if (array != null)
{
return array;
}
throw new CryptographicException(Locale.GetText("PKCS1 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: 0x06003047 RID: 12359 RVA: 0x0009DE90 File Offset: 0x0009C090
public override void SetKey(AsymmetricAlgorithm key)
{
this.rsa = (RSA)key;
}
// Token: 0x0400139F RID: 5023
private RSA rsa;
// Token: 0x040013A0 RID: 5024
private RandomNumberGenerator random;
}
}