scripts
This commit is contained in:
@@ -0,0 +1,263 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1
|
||||
{
|
||||
// Token: 0x020017B5 RID: 6069
|
||||
[Token(Token = "0x20017B5")]
|
||||
[StructLayout(3)]
|
||||
public class BerOctetString : DerOctetString, IEnumerable
|
||||
{
|
||||
// Token: 0x0600A3AF RID: 41903 RVA: 0x00261874 File Offset: 0x0025FA74
|
||||
[Token(Token = "0x600A3AF")]
|
||||
[Address(RVA = "0x267CEE0", Offset = "0x267B8E0", VA = "0x18267CEE0")]
|
||||
public static BerOctetString FromSequence(Asn1Sequence seq)
|
||||
{
|
||||
int num;
|
||||
IList list;
|
||||
do
|
||||
{
|
||||
num = 0;
|
||||
list = Platform.CreateArrayList();
|
||||
IEnumerator enumerator = seq.GetEnumerator();
|
||||
if (enumerator != 0)
|
||||
{
|
||||
if (num < enumerator)
|
||||
{
|
||||
num += num;
|
||||
num++;
|
||||
}
|
||||
if (enumerator == 0)
|
||||
{
|
||||
}
|
||||
if (enumerator == 0)
|
||||
{
|
||||
goto IL_70;
|
||||
}
|
||||
if (num < enumerator)
|
||||
{
|
||||
num += num;
|
||||
num++;
|
||||
}
|
||||
enumerator += enumerator;
|
||||
num += 2;
|
||||
num += 19;
|
||||
}
|
||||
if (num != 0)
|
||||
{
|
||||
}
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
}
|
||||
while (num != 0);
|
||||
byte[] array = BerOctetString.ToBytes(list);
|
||||
BerOctetString berOctetString;
|
||||
berOctetString.octs = list;
|
||||
return berOctetString;
|
||||
IL_70:
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600A3B0 RID: 41904 RVA: 0x002618F8 File Offset: 0x0025FAF8
|
||||
[Token(Token = "0x600A3B0")]
|
||||
[Address(RVA = "0x267D4E0", Offset = "0x267BEE0", VA = "0x18267D4E0")]
|
||||
private static byte[] ToBytes(IEnumerable octs)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
int num = 0;
|
||||
MemoryStream memoryStream = new MemoryStream();
|
||||
if (memoryStream != 0)
|
||||
{
|
||||
if (num < memoryStream)
|
||||
{
|
||||
num += num;
|
||||
num++;
|
||||
}
|
||||
num++;
|
||||
num += 19;
|
||||
ulong num2;
|
||||
num = (int)((ulong)num + num2);
|
||||
if (num == 0 || num == 0)
|
||||
{
|
||||
goto IL_55;
|
||||
}
|
||||
if (memoryStream.ReadByte() != 0)
|
||||
{
|
||||
}
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new NullReferenceException();
|
||||
IL_55:
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600A3B1 RID: 41905 RVA: 0x00261968 File Offset: 0x0025FB68
|
||||
[Token(Token = "0x600A3B1")]
|
||||
[Address(RVA = "0x267D7F0", Offset = "0x267C1F0", VA = "0x18267D7F0")]
|
||||
public BerOctetString(byte[] str)
|
||||
: base(str)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600A3B2 RID: 41906 RVA: 0x0026197C File Offset: 0x0025FB7C
|
||||
[Token(Token = "0x600A3B2")]
|
||||
[Address(RVA = "0x267D7A0", Offset = "0x267C1A0", VA = "0x18267D7A0")]
|
||||
public BerOctetString(IEnumerable octets)
|
||||
{
|
||||
byte[] array = BerOctetString.ToBytes(octets);
|
||||
base..ctor(array);
|
||||
this.octs = octets;
|
||||
}
|
||||
|
||||
// Token: 0x0600A3B3 RID: 41907 RVA: 0x002619A0 File Offset: 0x0025FBA0
|
||||
[Token(Token = "0x600A3B3")]
|
||||
[Address(RVA = "0x267D7E0", Offset = "0x267C1E0", VA = "0x18267D7E0")]
|
||||
public BerOctetString(Asn1Object obj)
|
||||
: base(obj)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600A3B4 RID: 41908 RVA: 0x002619B4 File Offset: 0x0025FBB4
|
||||
[Token(Token = "0x600A3B4")]
|
||||
[Address(RVA = "0x267D800", Offset = "0x267C200", VA = "0x18267D800")]
|
||||
public BerOctetString(Asn1Encodable obj)
|
||||
{
|
||||
Asn1Object asn1Object = obj.ToAsn1Object();
|
||||
base..ctor(asn1Object);
|
||||
}
|
||||
|
||||
// Token: 0x0600A3B5 RID: 41909 RVA: 0x002619D8 File Offset: 0x0025FBD8
|
||||
[Token(Token = "0x600A3B5")]
|
||||
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0", Slot = "10")]
|
||||
public override byte[] GetOctets()
|
||||
{
|
||||
return this.str;
|
||||
}
|
||||
|
||||
// Token: 0x0600A3B6 RID: 41910 RVA: 0x002619EC File Offset: 0x0025FBEC
|
||||
[Token(Token = "0x600A3B6")]
|
||||
[Address(RVA = "0x267D310", Offset = "0x267BD10", VA = "0x18267D310", Slot = "11")]
|
||||
public IEnumerator GetEnumerator()
|
||||
{
|
||||
if (this.octs != 0)
|
||||
{
|
||||
}
|
||||
IList list = Platform.CreateArrayList();
|
||||
byte[] str = this.str;
|
||||
int num = 0;
|
||||
if (num < str.Length)
|
||||
{
|
||||
int num2 = Math.Min(str.Length, 1000);
|
||||
num2 -= num;
|
||||
num = num2;
|
||||
byte[] array = new byte[num2];
|
||||
int length = array.Length;
|
||||
int num3 = 0;
|
||||
Array.Copy(this.str, num, array, num3, length);
|
||||
DerOctetString derOctetString = new DerOctetString(array);
|
||||
byte[] str2 = this.str;
|
||||
}
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600A3B7 RID: 41911 RVA: 0x00261A74 File Offset: 0x0025FC74
|
||||
[Token(Token = "0x600A3B7")]
|
||||
[Address(RVA = "0x267D4D0", Offset = "0x267BED0", VA = "0x18267D4D0")]
|
||||
[Obsolete]
|
||||
public IEnumerator GetObjects()
|
||||
{
|
||||
return this.GetEnumerator();
|
||||
}
|
||||
|
||||
// Token: 0x0600A3B8 RID: 41912 RVA: 0x00261A88 File Offset: 0x0025FC88
|
||||
[Token(Token = "0x600A3B8")]
|
||||
[Address(RVA = "0x267D1A0", Offset = "0x267BBA0", VA = "0x18267D1A0")]
|
||||
private IList GenerateOcts()
|
||||
{
|
||||
IList list = Platform.CreateArrayList();
|
||||
byte[] str = this.str;
|
||||
int num = 0;
|
||||
if (num < str.Length)
|
||||
{
|
||||
int num2 = Math.Min(str.Length, 1000);
|
||||
num2 -= num;
|
||||
num = num2;
|
||||
byte[] array = new byte[num2];
|
||||
int length = array.Length;
|
||||
int num3 = 0;
|
||||
Array.Copy(this.str, num, array, num3, length);
|
||||
DerOctetString derOctetString = new DerOctetString(array);
|
||||
byte[] str2 = this.str;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
// Token: 0x0600A3B9 RID: 41913 RVA: 0x00261B0C File Offset: 0x0025FD0C
|
||||
[Token(Token = "0x600A3B9")]
|
||||
[Address(RVA = "0x267CBE0", Offset = "0x267B5E0", VA = "0x18267CBE0", Slot = "6")]
|
||||
internal override void Encode(DerOutputStream derOut)
|
||||
{
|
||||
int num;
|
||||
do
|
||||
{
|
||||
num = 0;
|
||||
if (derOut == 0 || (derOut == 0 && derOut == 0))
|
||||
{
|
||||
goto IL_51;
|
||||
}
|
||||
IEnumerator enumerator = this.GetEnumerator();
|
||||
if (enumerator != 0)
|
||||
{
|
||||
if (num < enumerator)
|
||||
{
|
||||
num += num;
|
||||
num++;
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
num += num;
|
||||
num++;
|
||||
num += 19;
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
goto IL_59;
|
||||
}
|
||||
derOut.WriteObject(num);
|
||||
}
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
}
|
||||
while (num != 0);
|
||||
return;
|
||||
IL_51:
|
||||
base.Encode(derOut);
|
||||
return;
|
||||
IL_59:
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x04006B51 RID: 27473
|
||||
[Token(Token = "0x4006B51")]
|
||||
private const int MaxLength = 1000;
|
||||
|
||||
// Token: 0x04006B52 RID: 27474
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006B52")]
|
||||
private readonly IEnumerable octs;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user