scripts
This commit is contained in:
+207
@@ -0,0 +1,207 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509
|
||||
{
|
||||
// Token: 0x02001327 RID: 4903
|
||||
[Token(Token = "0x2001327")]
|
||||
[StructLayout(3)]
|
||||
public class X509CertificateParser
|
||||
{
|
||||
// Token: 0x06007AFD RID: 31485 RVA: 0x0000220F File Offset: 0x0000040F
|
||||
[Token(Token = "0x6007AFD")]
|
||||
[Address(RVA = "0x530370", Offset = "0x52ED70", VA = "0x180530370")]
|
||||
private X509Certificate ReadDerCertificate(Asn1InputStream dIn)
|
||||
{
|
||||
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
||||
}
|
||||
|
||||
// Token: 0x06007AFE RID: 31486 RVA: 0x001993E4 File Offset: 0x001975E4
|
||||
[Token(Token = "0x6007AFE")]
|
||||
[Address(RVA = "0x52FC90", Offset = "0x52E690", VA = "0x18052FC90")]
|
||||
private X509Certificate GetCertificate()
|
||||
{
|
||||
if (this.sData != (ulong)0L)
|
||||
{
|
||||
Asn1Set asn1Set = this.sData;
|
||||
Asn1Encodable asn1Encodable;
|
||||
if (this.sDataObjectCount < asn1Encodable)
|
||||
{
|
||||
int num = this.sDataObjectCount;
|
||||
Asn1Set asn1Set2 = this.sData;
|
||||
int num2 = num + 1;
|
||||
this.sDataObjectCount = num2;
|
||||
IEnumerator enumerator = asn1Set2.GetEnumerator();
|
||||
while (enumerator == 0)
|
||||
{
|
||||
}
|
||||
while (enumerator == 0)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06007AFF RID: 31487 RVA: 0x00199444 File Offset: 0x00197644
|
||||
[Token(Token = "0x6007AFF")]
|
||||
[Address(RVA = "0x530590", Offset = "0x52EF90", VA = "0x180530590")]
|
||||
private X509Certificate ReadPemCertificate(Stream inStream)
|
||||
{
|
||||
Asn1Sequence asn1Sequence = X509CertificateParser.PemCertParser.ReadPemObject(inStream);
|
||||
if (asn1Sequence == 0)
|
||||
{
|
||||
}
|
||||
X509CertificateStructure instance = X509CertificateStructure.GetInstance(asn1Sequence);
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06007B00 RID: 31488 RVA: 0x00199470 File Offset: 0x00197670
|
||||
[Token(Token = "0x6007B00")]
|
||||
[Address(RVA = "0x52FC30", Offset = "0x52E630", VA = "0x18052FC30", Slot = "4")]
|
||||
protected virtual X509Certificate CreateX509Certificate(X509CertificateStructure c)
|
||||
{
|
||||
return new X509Certificate(c);
|
||||
}
|
||||
|
||||
// Token: 0x06007B01 RID: 31489 RVA: 0x00199484 File Offset: 0x00197684
|
||||
[Token(Token = "0x6007B01")]
|
||||
[Address(RVA = "0x52FDB0", Offset = "0x52E7B0", VA = "0x18052FDB0")]
|
||||
public X509Certificate ReadCertificate(byte[] input)
|
||||
{
|
||||
int num;
|
||||
MemoryStream memoryStream = new MemoryStream(input, num != 0);
|
||||
num = 0;
|
||||
return this.ReadCertificate(memoryStream);
|
||||
}
|
||||
|
||||
// Token: 0x06007B02 RID: 31490 RVA: 0x001994A4 File Offset: 0x001976A4
|
||||
[Token(Token = "0x6007B02")]
|
||||
[Address(RVA = "0x5300C0", Offset = "0x52EAC0", VA = "0x1805300C0")]
|
||||
public ICollection ReadCertificates(byte[] input)
|
||||
{
|
||||
MemoryStream memoryStream;
|
||||
do
|
||||
{
|
||||
int num;
|
||||
memoryStream = new MemoryStream(input, num != 0);
|
||||
num = 0;
|
||||
IList list = Platform.CreateArrayList();
|
||||
int num2 = 0;
|
||||
if (this.ReadCertificate(memoryStream) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
int num3 = 0;
|
||||
if (num3 < num2)
|
||||
{
|
||||
num3 += num3;
|
||||
num3++;
|
||||
}
|
||||
}
|
||||
while (this.ReadCertificate(memoryStream) != 0);
|
||||
memoryStream += memoryStream;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06007B03 RID: 31491 RVA: 0x001994FC File Offset: 0x001976FC
|
||||
[Token(Token = "0x6007B03")]
|
||||
[Address(RVA = "0x52FE20", Offset = "0x52E820", VA = "0x18052FE20")]
|
||||
public X509Certificate ReadCertificate(Stream inStream)
|
||||
{
|
||||
if (inStream != 0)
|
||||
{
|
||||
inStream.Dispose();
|
||||
Stream stream = this.currentStream;
|
||||
int num = 0;
|
||||
if (stream == 0 || stream != inStream)
|
||||
{
|
||||
this.sDataObjectCount = num;
|
||||
this.sData = num;
|
||||
this.currentStream = inStream;
|
||||
}
|
||||
string text;
|
||||
if (this.sData == 0)
|
||||
{
|
||||
PushbackStream pushbackStream = new PushbackStream(inStream);
|
||||
int num2;
|
||||
pushbackStream.WriteByte((byte)num2);
|
||||
if (num2 == 48)
|
||||
{
|
||||
Asn1InputStream asn1InputStream = new Asn1InputStream(pushbackStream);
|
||||
X509Certificate x509Certificate = this.ReadDerCertificate(asn1InputStream);
|
||||
}
|
||||
Asn1Sequence asn1Sequence = X509CertificateParser.PemCertParser.ReadPemObject(pushbackStream);
|
||||
if (asn1Sequence != 0)
|
||||
{
|
||||
X509CertificateStructure instance = X509CertificateStructure.GetInstance(asn1Sequence);
|
||||
text = this.ToString();
|
||||
}
|
||||
}
|
||||
int num3 = this.sDataObjectCount;
|
||||
this.sData = text;
|
||||
this.sDataObjectCount = text;
|
||||
return this.GetCertificate();
|
||||
}
|
||||
ArgumentNullException ex = new ArgumentNullException("inStream");
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06007B04 RID: 31492 RVA: 0x001995E8 File Offset: 0x001977E8
|
||||
[Token(Token = "0x6007B04")]
|
||||
[Address(RVA = "0x530230", Offset = "0x52EC30", VA = "0x180530230")]
|
||||
public ICollection ReadCertificates(Stream inStream)
|
||||
{
|
||||
do
|
||||
{
|
||||
IList list = Platform.CreateArrayList();
|
||||
int num = 0;
|
||||
if (this.ReadCertificate(inStream) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
int num2 = 0;
|
||||
if (num2 < num)
|
||||
{
|
||||
num2 += num2;
|
||||
num2++;
|
||||
}
|
||||
}
|
||||
while (this.ReadCertificate(inStream) != 0);
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06007B05 RID: 31493 RVA: 0x00199628 File Offset: 0x00197828
|
||||
[Token(Token = "0x6007B05")]
|
||||
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
|
||||
public X509CertificateParser()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x04005846 RID: 22598
|
||||
[Token(Token = "0x4005846")]
|
||||
private static readonly PemParser PemCertParser = new PemParser("CERTIFICATE");
|
||||
|
||||
// Token: 0x04005847 RID: 22599
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4005847")]
|
||||
private Asn1Set sData;
|
||||
|
||||
// Token: 0x04005848 RID: 22600
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4005848")]
|
||||
private int sDataObjectCount;
|
||||
|
||||
// Token: 0x04005849 RID: 22601
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4005849")]
|
||||
private Stream currentStream;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user