73 lines
2.6 KiB
C#
73 lines
2.6 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
|
|
{
|
|
// Token: 0x02001784 RID: 6020
|
|
[Token(Token = "0x2001784")]
|
|
[StructLayout(3)]
|
|
public class Pkcs5Scheme2Utf8PbeKey : CmsPbeKey
|
|
{
|
|
// Token: 0x0600A29F RID: 41631 RVA: 0x0025E24C File Offset: 0x0025C44C
|
|
[Token(Token = "0x600A29F")]
|
|
[Address(RVA = "0x6625A0", Offset = "0x660FA0", VA = "0x1806625A0")]
|
|
[Obsolete]
|
|
public Pkcs5Scheme2Utf8PbeKey(string password, byte[] salt, int iterationCount)
|
|
{
|
|
char[] array = password.ToCharArray();
|
|
base..ctor(array, salt, iterationCount);
|
|
}
|
|
|
|
// Token: 0x0600A2A0 RID: 41632 RVA: 0x0025E270 File Offset: 0x0025C470
|
|
[Token(Token = "0x600A2A0")]
|
|
[Address(RVA = "0x662620", Offset = "0x661020", VA = "0x180662620")]
|
|
[Obsolete]
|
|
public Pkcs5Scheme2Utf8PbeKey(string password, AlgorithmIdentifier keyDerivationAlgorithm)
|
|
{
|
|
char[] array = password.ToCharArray();
|
|
base..ctor(array, keyDerivationAlgorithm);
|
|
}
|
|
|
|
// Token: 0x0600A2A1 RID: 41633 RVA: 0x0025E294 File Offset: 0x0025C494
|
|
[Token(Token = "0x600A2A1")]
|
|
[Address(RVA = "0x662600", Offset = "0x661000", VA = "0x180662600")]
|
|
public Pkcs5Scheme2Utf8PbeKey(char[] password, byte[] salt, int iterationCount)
|
|
: base(password, salt, iterationCount)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600A2A2 RID: 41634 RVA: 0x0025E2AC File Offset: 0x0025C4AC
|
|
[Token(Token = "0x600A2A2")]
|
|
[Address(RVA = "0x662610", Offset = "0x661010", VA = "0x180662610")]
|
|
public Pkcs5Scheme2Utf8PbeKey(char[] password, AlgorithmIdentifier keyDerivationAlgorithm)
|
|
: base(password, keyDerivationAlgorithm)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600A2A3 RID: 41635 RVA: 0x0025E2C4 File Offset: 0x0025C4C4
|
|
[Token(Token = "0x600A2A3")]
|
|
[Address(RVA = "0x662670", Offset = "0x661070", VA = "0x180662670", Slot = "4")]
|
|
internal override KeyParameter GetEncoded(string algorithmOid)
|
|
{
|
|
ICipherParameters cipherParameters;
|
|
do
|
|
{
|
|
Pkcs5S2ParametersGenerator pkcs5S2ParametersGenerator = new Pkcs5S2ParametersGenerator();
|
|
byte[] array = PbeParametersGenerator.Pkcs5PasswordToUtf8Bytes(this.password);
|
|
string text = pkcs5S2ParametersGenerator.ToString();
|
|
int keySize = CmsEnvelopedHelper.Instance.GetKeySize(algorithmOid);
|
|
if (cipherParameters == 0)
|
|
{
|
|
}
|
|
}
|
|
while (cipherParameters == 0);
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
}
|