using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the algorithm. This class cannot be inherited.
// Token: 0x02000516 RID: 1302
[ComVisible(true)]
public sealed class RC2CryptoServiceProvider : RC2
{
/// Gets or sets the effective size, in bits, of the secret key used by the algorithm.
/// The effective key size, in bits, used by the algorithm.
/// The property was set to a value other than the property.
// Token: 0x17000973 RID: 2419
// (get) Token: 0x06002FD4 RID: 12244 RVA: 0x0009AA64 File Offset: 0x00098C64
// (set) Token: 0x06002FD5 RID: 12245 RVA: 0x0009AA6C File Offset: 0x00098C6C
public override int EffectiveKeySize
{
get
{
return base.EffectiveKeySize;
}
set
{
if (value != this.KeySizeValue)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("Effective key size must match key size for compatibility"));
}
base.EffectiveKeySize = value;
}
}
/// Creates a symmetric decryptor object with the specified key ()and initialization vector ().
/// A symmetric decryptor object.
/// The secret key to use for the symmetric algorithm.
/// The initialization vector to use for the symmetric algorithm.
/// An cipher mode was used.-or-A cipher mode with a feedback size other than 8 bits was used.-or-An invalid key size was used.-or-The algorithm key size was not available.
///
///
///
// Token: 0x06002FD6 RID: 12246 RVA: 0x0009AA94 File Offset: 0x00098C94
public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV)
{
return new RC2Transform(this, false, rgbKey, rgbIV);
}
/// Creates a symmetric encryptor object with the specified key () and initialization vector ().
/// A symmetric encryptor object.
/// The secret key to use for the symmetric algorithm.
/// The initialization vector to use for the symmetric algorithm.
/// An cipher mode was used.-or-A cipher mode with a feedback size other than 8 bits was used.-or-An invalid key size was used.-or-The algorithm key size was not available.
///
///
///
// Token: 0x06002FD7 RID: 12247 RVA: 0x0009AAA0 File Offset: 0x00098CA0
public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV)
{
return new RC2Transform(this, true, rgbKey, rgbIV);
}
/// Generates a random initialization vector () to use for the algorithm.
// Token: 0x06002FD8 RID: 12248 RVA: 0x0009AAAC File Offset: 0x00098CAC
public override void GenerateIV()
{
this.IVValue = KeyBuilder.IV(this.BlockSizeValue >> 3);
}
/// Generates a random key () to be used for the algorithm.
// Token: 0x06002FD9 RID: 12249 RVA: 0x0009AAC4 File Offset: 0x00098CC4
public override void GenerateKey()
{
this.KeyValue = KeyBuilder.Key(this.KeySizeValue >> 3);
}
/// Gets or sets a value that determines whether to create a key with an 11-byte-long, zero-value salt.
/// true if the key should be created with an 11-byte-long, zero-value salt; otherwise, false. The default is false.
// Token: 0x17000974 RID: 2420
// (get) Token: 0x06002FDA RID: 12250 RVA: 0x0009AADC File Offset: 0x00098CDC
// (set) Token: 0x06002FDB RID: 12251 RVA: 0x0009AAE4 File Offset: 0x00098CE4
[ComVisible(false)]
[MonoTODO("Use salt in algorithm")]
public bool UseSalt
{
get
{
return this._useSalt;
}
set
{
this._useSalt = value;
}
}
// Token: 0x04001382 RID: 4994
private bool _useSalt;
}
}