Files
Aug2021-Cpp2IL-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Asn1/Cmp/PkiHeaderBuilder.cs
T
2026-04-10 22:50:51 +02:00

410 lines
17 KiB
C#

using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
{
// Token: 0x02001F5E RID: 8030
[Token(Token = "0x2001F5E")]
public class PkiHeaderBuilder
{
// Token: 0x0600CB2A RID: 52010 RVA: 0x002E8BC8 File Offset: 0x002E6DC8
[Token(Token = "0x600CB2A")]
[Address(RVA = "0x2ADE730", Offset = "0x2ADD530", VA = "0x182ADE730")]
public PkiHeaderBuilder(int pvno, GeneralName sender, GeneralName recipient)
{
DerInteger derInteger = new DerInteger(pvno);
int num = 0;
int num2 = 0;
base.FieldGetter(num2, num, recipient);
this.pvno = derInteger;
this.sender = sender;
this.recipient = recipient;
}
// Token: 0x0600CB2B RID: 52011 RVA: 0x002E8C00 File Offset: 0x002E6E00
[Token(Token = "0x600CB2B")]
[Address(RVA = "0x4A7B10", Offset = "0x4A6910", VA = "0x1804A7B10")]
private PkiHeaderBuilder(DerInteger pvno, GeneralName sender, GeneralName recipient)
{
this.pvno = pvno;
this.sender = sender;
this.recipient = recipient;
}
// Token: 0x0600CB2C RID: 52012 RVA: 0x002E8C28 File Offset: 0x002E6E28
[Token(Token = "0x600CB2C")]
[Address(RVA = "0x1871FD0", Offset = "0x1870DD0", VA = "0x181871FD0", Slot = "4")]
public virtual PkiHeaderBuilder SetMessageTime(DerGeneralizedTime time)
{
this.messageTime = time;
return this;
}
// Token: 0x0600CB2D RID: 52013 RVA: 0x002E8C40 File Offset: 0x002E6E40
[Token(Token = "0x600CB2D")]
[Address(RVA = "0xBED9A0", Offset = "0xBEC7A0", VA = "0x180BED9A0", Slot = "5")]
public virtual PkiHeaderBuilder SetProtectionAlg(AlgorithmIdentifier aid)
{
this.protectionAlg = aid;
return this;
}
// Token: 0x0600CB2E RID: 52014 RVA: 0x002E8C58 File Offset: 0x002E6E58
[Token(Token = "0x600CB2E")]
[Address(RVA = "0x2ADE580", Offset = "0x2ADD380", VA = "0x182ADE580", Slot = "6")]
public virtual PkiHeaderBuilder SetSenderKID(byte[] kid)
{
if (kid == 0)
{
}
DerOctetString derOctetString = new DerOctetString(kid);
throw new NullReferenceException();
}
// Token: 0x0600CB2F RID: 52015 RVA: 0x002E8C78 File Offset: 0x002E6E78
[Token(Token = "0x600CB2F")]
[Address(RVA = "0x14A6770", Offset = "0x14A5570", VA = "0x1814A6770", Slot = "7")]
public virtual PkiHeaderBuilder SetSenderKID(Asn1OctetString kid)
{
this.senderKID = kid;
return this;
}
// Token: 0x0600CB30 RID: 52016 RVA: 0x002E8C90 File Offset: 0x002E6E90
[Token(Token = "0x600CB30")]
[Address(RVA = "0x2ADE460", Offset = "0x2ADD260", VA = "0x182ADE460", Slot = "8")]
public virtual PkiHeaderBuilder SetRecipKID(byte[] kid)
{
if (kid == 0)
{
}
DerOctetString derOctetString = new DerOctetString(kid);
throw new NullReferenceException();
}
// Token: 0x0600CB31 RID: 52017 RVA: 0x002E8CB0 File Offset: 0x002E6EB0
[Token(Token = "0x600CB31")]
[Address(RVA = "0x1871FE0", Offset = "0x1870DE0", VA = "0x181871FE0", Slot = "9")]
public virtual PkiHeaderBuilder SetRecipKID(DerOctetString kid)
{
this.recipKID = kid;
return this;
}
// Token: 0x0600CB32 RID: 52018 RVA: 0x002E8CC8 File Offset: 0x002E6EC8
[Token(Token = "0x600CB32")]
[Address(RVA = "0x2ADE6A0", Offset = "0x2ADD4A0", VA = "0x182ADE6A0", Slot = "10")]
public virtual PkiHeaderBuilder SetTransactionID(byte[] tid)
{
if (tid == 0)
{
}
DerOctetString derOctetString = new DerOctetString(tid);
throw new NullReferenceException();
}
// Token: 0x0600CB33 RID: 52019 RVA: 0x002E8CE8 File Offset: 0x002E6EE8
[Token(Token = "0x600CB33")]
[Address(RVA = "0x1871FC0", Offset = "0x1870DC0", VA = "0x181871FC0", Slot = "11")]
public virtual PkiHeaderBuilder SetTransactionID(Asn1OctetString tid)
{
this.transactionID = tid;
return this;
}
// Token: 0x0600CB34 RID: 52020 RVA: 0x002E8D00 File Offset: 0x002E6F00
[Token(Token = "0x600CB34")]
[Address(RVA = "0x2ADE610", Offset = "0x2ADD410", VA = "0x182ADE610", Slot = "12")]
public virtual PkiHeaderBuilder SetSenderNonce(byte[] nonce)
{
if (nonce == 0)
{
}
DerOctetString derOctetString = new DerOctetString(nonce);
throw new NullReferenceException();
}
// Token: 0x0600CB35 RID: 52021 RVA: 0x002E8D20 File Offset: 0x002E6F20
[Token(Token = "0x600CB35")]
[Address(RVA = "0x1872010", Offset = "0x1870E10", VA = "0x181872010", Slot = "13")]
public virtual PkiHeaderBuilder SetSenderNonce(Asn1OctetString nonce)
{
this.senderNonce = nonce;
return this;
}
// Token: 0x0600CB36 RID: 52022 RVA: 0x002E8D38 File Offset: 0x002E6F38
[Token(Token = "0x600CB36")]
[Address(RVA = "0x2ADE4F0", Offset = "0x2ADD2F0", VA = "0x182ADE4F0", Slot = "14")]
public virtual PkiHeaderBuilder SetRecipNonce(byte[] nonce)
{
if (nonce == 0)
{
}
DerOctetString derOctetString = new DerOctetString(nonce);
throw new NullReferenceException();
}
// Token: 0x0600CB37 RID: 52023 RVA: 0x002E8D58 File Offset: 0x002E6F58
[Token(Token = "0x600CB37")]
[Address(RVA = "0x1871FB0", Offset = "0x1870DB0", VA = "0x181871FB0", Slot = "15")]
public virtual PkiHeaderBuilder SetRecipNonce(Asn1OctetString nonce)
{
this.recipNonce = nonce;
return this;
}
// Token: 0x0600CB38 RID: 52024 RVA: 0x002E8D70 File Offset: 0x002E6F70
[Token(Token = "0x600CB38")]
[Address(RVA = "0x2ADE260", Offset = "0x2ADD060", VA = "0x182ADE260", Slot = "16")]
public virtual PkiHeaderBuilder SetFreeText(PkiFreeText text)
{
this.freeText = text;
return this;
}
// Token: 0x0600CB39 RID: 52025 RVA: 0x002E8D88 File Offset: 0x002E6F88
[Token(Token = "0x600CB39")]
[Address(RVA = "0x2ADE270", Offset = "0x2ADD070", VA = "0x182ADE270", Slot = "17")]
public virtual PkiHeaderBuilder SetGeneralInfo(InfoTypeAndValue genInfo)
{
/*
An exception occurred when decompiling this method (0600CB39)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp.PkiHeaderBuilder BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp.PkiHeaderBuilder::SetGeneralInfo(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp.InfoTypeAndValue)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:DerSequence(var_0_06, newobj:DerSequence(DerSequence::.ctor, ldloc:InfoTypeAndValue[exp:Asn1Encodable](genInfo)))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600CB3A RID: 52026 RVA: 0x002E8D9C File Offset: 0x002E6F9C
[Token(Token = "0x600CB3A")]
[Address(RVA = "0x2ADE2F0", Offset = "0x2ADD0F0", VA = "0x182ADE2F0", Slot = "18")]
public virtual PkiHeaderBuilder SetGeneralInfo(InfoTypeAndValue[] genInfos)
{
int num = 0;
if (genInfos != 0)
{
Asn1EncodableVector asn1EncodableVector = new Asn1EncodableVector(genInfos);
if (num < genInfos.Length)
{
Asn1Encodable[] array = new Asn1Encodable[1];
InfoTypeAndValue infoTypeAndValue = genInfos[num];
if (infoTypeAndValue != 0)
{
}
array[0] = infoTypeAndValue;
asn1EncodableVector.Add(array);
num++;
}
DerSequence derSequence = new DerSequence(asn1EncodableVector);
}
throw new ArrayTypeMismatchException();
}
// Token: 0x0600CB3B RID: 52027 RVA: 0x002E8DF4 File Offset: 0x002E6FF4
[Token(Token = "0x600CB3B")]
[Address(RVA = "0x2ADE450", Offset = "0x2ADD250", VA = "0x182ADE450", Slot = "19")]
public virtual PkiHeaderBuilder SetGeneralInfo(Asn1Sequence seqOfInfoTypeAndValue)
{
this.generalInfo = seqOfInfoTypeAndValue;
return this;
}
// Token: 0x0600CB3C RID: 52028 RVA: 0x002E8E0C File Offset: 0x002E700C
[Token(Token = "0x600CB3C")]
[Address(RVA = "0x2ADE200", Offset = "0x2ADD000", VA = "0x182ADE200")]
private static Asn1Sequence MakeGeneralInfoSeq(InfoTypeAndValue generalInfo)
{
/*
An exception occurred when decompiling this method (0600CB3C)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Asn1Sequence BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp.PkiHeaderBuilder::MakeGeneralInfoSeq(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp.InfoTypeAndValue)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:DerSequence(var_0_06, newobj:DerSequence(DerSequence::.ctor, ldloc:InfoTypeAndValue[exp:Asn1Encodable](generalInfo)))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600CB3D RID: 52029 RVA: 0x002E8E20 File Offset: 0x002E7020
[Token(Token = "0x600CB3D")]
[Address(RVA = "0x2ADE0B0", Offset = "0x2ADCEB0", VA = "0x182ADE0B0")]
private static Asn1Sequence MakeGeneralInfoSeq(InfoTypeAndValue[] generalInfos)
{
int num = 0;
if (generalInfos != 0)
{
Asn1EncodableVector asn1EncodableVector;
if (num < generalInfos.Length)
{
Asn1Encodable[] array = new Asn1Encodable[1];
InfoTypeAndValue infoTypeAndValue = generalInfos[num];
if (infoTypeAndValue != 0)
{
}
array[0] = infoTypeAndValue;
asn1EncodableVector.Add(array);
num++;
}
DerSequence derSequence = new DerSequence(asn1EncodableVector);
}
throw new ArrayTypeMismatchException();
}
// Token: 0x0600CB3E RID: 52030 RVA: 0x002E8E70 File Offset: 0x002E7070
[Token(Token = "0x600CB3E")]
[Address(RVA = "0x2ADDE00", Offset = "0x2ADCC00", VA = "0x182ADDE00", Slot = "20")]
public virtual PkiHeader Build()
{
Asn1Encodable[] array = new Asn1Encodable[3];
DerInteger derInteger = this.pvno;
if (derInteger != 0)
{
}
array[0] = derInteger;
GeneralName generalName = this.sender;
if (generalName != 0)
{
}
array[1] = generalName;
GeneralName generalName2 = this.recipient;
if (generalName2 != 0)
{
}
array[2] = generalName2;
Asn1EncodableVector asn1EncodableVector = new Asn1EncodableVector(array);
DerGeneralizedTime derGeneralizedTime = this.messageTime;
int num = 0;
int num2 = 0;
this.AddOptional(asn1EncodableVector, num2, derGeneralizedTime);
AlgorithmIdentifier algorithmIdentifier = this.protectionAlg;
this.AddOptional(asn1EncodableVector, 1, algorithmIdentifier);
Asn1OctetString asn1OctetString = this.senderKID;
this.AddOptional(asn1EncodableVector, 2, asn1OctetString);
Asn1OctetString asn1OctetString2 = this.recipKID;
this.AddOptional(asn1EncodableVector, 3, asn1OctetString2);
Asn1OctetString asn1OctetString3 = this.transactionID;
this.AddOptional(asn1EncodableVector, 4, asn1OctetString3);
Asn1OctetString asn1OctetString4 = this.senderNonce;
this.AddOptional(asn1EncodableVector, 5, asn1OctetString4);
Asn1OctetString asn1OctetString5 = this.recipNonce;
this.AddOptional(asn1EncodableVector, 6, asn1OctetString5);
PkiFreeText pkiFreeText = this.freeText;
this.AddOptional(asn1EncodableVector, 7, pkiFreeText);
Asn1Sequence asn1Sequence = this.generalInfo;
this.AddOptional(asn1EncodableVector, 8, asn1Sequence);
this.messageTime = num;
this.protectionAlg = num;
this.senderKID = num;
this.recipKID = num;
this.transactionID = num;
this.senderNonce = num;
this.recipNonce = num;
this.freeText = num;
this.generalInfo = num;
return PkiHeader.GetInstance(new DerSequence(asn1EncodableVector));
}
// Token: 0x0600CB3F RID: 52031 RVA: 0x002E8FD4 File Offset: 0x002E71D4
[Token(Token = "0x600CB3F")]
[Address(RVA = "0x2ADDD00", Offset = "0x2ADCB00", VA = "0x182ADDD00")]
private void AddOptional(Asn1EncodableVector v, int tagNo, Asn1Encodable obj)
{
if (obj != 0)
{
Asn1Encodable[] array = new Asn1Encodable[1];
DerTaggedObject derTaggedObject = new DerTaggedObject(true, tagNo, obj);
if (derTaggedObject != 0)
{
}
array[0] = derTaggedObject;
v.Add(array);
}
}
// Token: 0x0400817B RID: 33147
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400817B")]
private DerInteger pvno;
// Token: 0x0400817C RID: 33148
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400817C")]
private GeneralName sender;
// Token: 0x0400817D RID: 33149
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400817D")]
private GeneralName recipient;
// Token: 0x0400817E RID: 33150
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400817E")]
private DerGeneralizedTime messageTime;
// Token: 0x0400817F RID: 33151
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400817F")]
private AlgorithmIdentifier protectionAlg;
// Token: 0x04008180 RID: 33152
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4008180")]
private Asn1OctetString senderKID;
// Token: 0x04008181 RID: 33153
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4008181")]
private Asn1OctetString recipKID;
// Token: 0x04008182 RID: 33154
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4008182")]
private Asn1OctetString transactionID;
// Token: 0x04008183 RID: 33155
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x4008183")]
private Asn1OctetString senderNonce;
// Token: 0x04008184 RID: 33156
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x4008184")]
private Asn1OctetString recipNonce;
// Token: 0x04008185 RID: 33157
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x4008185")]
private PkiFreeText freeText;
// Token: 0x04008186 RID: 33158
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x4008186")]
private Asn1Sequence generalInfo;
}
}