using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// Computes masks according to PKCS #1 for use by key exchange algorithms.
// Token: 0x02000512 RID: 1298
[ComVisible(true)]
public class PKCS1MaskGenerationMethod : MaskGenerationMethod
{
/// Initializes a new instance of the class.
// Token: 0x06002FB4 RID: 12212 RVA: 0x0009A36C File Offset: 0x0009856C
public PKCS1MaskGenerationMethod()
{
this.hashName = "SHA1";
}
/// Gets or sets the name of the hash algorithm type to use for generating the mask.
/// The name of the type that implements the hash algorithm to use for computing the mask.
// Token: 0x1700096D RID: 2413
// (get) Token: 0x06002FB5 RID: 12213 RVA: 0x0009A380 File Offset: 0x00098580
// (set) Token: 0x06002FB6 RID: 12214 RVA: 0x0009A388 File Offset: 0x00098588
public string HashName
{
get
{
return this.hashName;
}
set
{
this.hashName = ((value != null) ? value : "SHA1");
}
}
/// Generates and returns a mask from the specified random seed of the specified length.
/// A randomly generated mask whose length is equal to the parameter.
/// The random seed to use for computing the mask.
/// The length of the generated mask in bytes.
// Token: 0x06002FB7 RID: 12215 RVA: 0x0009A3A4 File Offset: 0x000985A4
public override byte[] GenerateMask(byte[] rgbSeed, int cbReturn)
{
HashAlgorithm hashAlgorithm = HashAlgorithm.Create(this.hashName);
return PKCS1.MGF1(hashAlgorithm, rgbSeed, cbReturn);
}
// Token: 0x04001370 RID: 4976
private string hashName;
}
}