mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
* CryptoConfig.cs: Added full classes name for MapNameToOID. * PKCS1.cs: New. Internal class for the various primitives defined in PKCS#1 v.2.1. * PKCS1MaskGenerationFunction.cs: Modified to use PKCS1.cs. * RSA.cs: Added internal class RSAHandler (which implements IHandler interface for MiniParser) to import RSA keypairs from XML strings. * RSACryptoServiceProvider.cs: Crypto implemented using BigInteger. Key generation is VERY LONG. * RSAOAEPKeyExchangeDeformatter.cs: Completed using PKCS1. Not sure of the results as this is not available in all versions of Windows. * RSAOAEPKeyExchangeFormatter.cs: Completed using PKCS1. Not sure of the results as this is not available in all versions of Windows. * RSAPKCS1KeyExchangeDeformatter.cs: Completed using PKCS1. * RSAPKCS1KeyExchangeFormatter.cs: Completed using PKCS1. * RSAPKCS1SignatureDeformatter.cs: Completed using PKCS1. * RSAPKCS1SignatureFormatter.cs: Completed using PKCS1. svn path=/trunk/mcs/; revision=9035
46 lines
884 B
C#
46 lines
884 B
C#
//
|
|
// PKCS1MaskGenerationMethod.cs: Handles PKCS#1 mask generation.
|
|
//
|
|
// Author:
|
|
// Sebastien Pouliot ([email protected])
|
|
//
|
|
// (C) 2002 Motus Technologies Inc. (http://www.motus.com)
|
|
//
|
|
|
|
using System;
|
|
using System.Security.Cryptography;
|
|
|
|
namespace System.Security.Cryptography {
|
|
|
|
// References:
|
|
// a. PKCS#1: RSA Cryptography Standard
|
|
// http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/index.html
|
|
|
|
public class PKCS1MaskGenerationMethod : MaskGenerationMethod {
|
|
private string hashName;
|
|
|
|
public PKCS1MaskGenerationMethod()
|
|
{
|
|
hashName = "SHA1";
|
|
}
|
|
|
|
public string HashName
|
|
{
|
|
get { return hashName; }
|
|
set {
|
|
if (value == null)
|
|
hashName = "SHA1";
|
|
else
|
|
hashName = value;
|
|
}
|
|
}
|
|
|
|
public override byte[] GenerateMask (byte[] mgfSeed, int maskLen)
|
|
{
|
|
HashAlgorithm hash = HashAlgorithm.Create (hashName);
|
|
return PKCS1.MGF1 (hash, mgfSeed, maskLen);
|
|
}
|
|
}
|
|
|
|
}
|