This commit is contained in:
niko
2026-04-10 22:50:51 +02:00
parent 6d1607d5a2
commit f18d448581
17033 changed files with 2863270 additions and 0 deletions
@@ -0,0 +1,132 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
{
// Token: 0x02001964 RID: 6500
[Token(Token = "0x2001964")]
public class GenTimeAccuracy
{
// Token: 0x06009A7E RID: 39550 RVA: 0x001FF928 File Offset: 0x001FDB28
[Token(Token = "0x6009A7E")]
[Address(RVA = "0x3FFB80", Offset = "0x3FE980", VA = "0x1803FFB80")]
public GenTimeAccuracy(Accuracy accuracy)
{
this.accuracy = accuracy;
}
// Token: 0x170018B5 RID: 6325
// (get) Token: 0x06009A7F RID: 39551 RVA: 0x001FF944 File Offset: 0x001FDB44
[Token(Token = "0x170018B5")]
public int Seconds
{
[Token(Token = "0x6009A7F")]
[Address(RVA = "0x1B15620", Offset = "0x1B14420", VA = "0x181B15620")]
get
{
DerInteger seconds = this.accuracy.seconds;
if (seconds == 0)
{
return 0;
}
return seconds.Value.IntValue;
}
}
// Token: 0x170018B6 RID: 6326
// (get) Token: 0x06009A80 RID: 39552 RVA: 0x001FF974 File Offset: 0x001FDB74
[Token(Token = "0x170018B6")]
public int Millis
{
[Token(Token = "0x6009A80")]
[Address(RVA = "0x1B155E0", Offset = "0x1B143E0", VA = "0x181B155E0")]
get
{
DerInteger millis = this.accuracy.millis;
if (millis == 0)
{
return 0;
}
return millis.Value.IntValue;
}
}
// Token: 0x170018B7 RID: 6327
// (get) Token: 0x06009A81 RID: 39553 RVA: 0x001FF9A4 File Offset: 0x001FDBA4
[Token(Token = "0x170018B7")]
public int Micros
{
[Token(Token = "0x6009A81")]
[Address(RVA = "0x1B155A0", Offset = "0x1B143A0", VA = "0x181B155A0")]
get
{
DerInteger micros = this.accuracy.micros;
if (micros == 0)
{
return 0;
}
return micros.Value.IntValue;
}
}
// Token: 0x06009A82 RID: 39554 RVA: 0x001FF9D4 File Offset: 0x001FDBD4
[Token(Token = "0x6009A82")]
[Address(RVA = "0x1B152D0", Offset = "0x1B140D0", VA = "0x181B152D0")]
private int GetTimeComponent(DerInteger time)
{
if (time == 0)
{
}
return time.Value.IntValue;
}
// Token: 0x06009A83 RID: 39555 RVA: 0x001FF9F8 File Offset: 0x001FDBF8
[Token(Token = "0x6009A83")]
[Address(RVA = "0x1B15310", Offset = "0x1B14110", VA = "0x181B15310", Slot = "3")]
public override string ToString()
{
object[] array = new object[0];
DerInteger seconds = this.accuracy.seconds;
if (seconds == 0)
{
}
int intValue = seconds.Value.IntValue;
if (intValue != 0)
{
}
array[0] = intValue;
if ("." != 0)
{
}
array[1] = ".";
DerInteger millis = this.accuracy.millis;
if (millis == 0)
{
}
int intValue2 = millis.Value.IntValue;
string text;
if (text != 0)
{
}
array[2] = text;
DerInteger micros = this.accuracy.micros;
if (micros != 0)
{
int intValue3 = micros.Value.IntValue;
}
string text2;
if (text2 != 0)
{
}
array[3] = text2;
return string.Concat(array);
}
// Token: 0x0400689B RID: 26779
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400689B")]
private Accuracy accuracy;
}
}
@@ -0,0 +1,237 @@
using System;
using System.Collections;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
{
// Token: 0x02001969 RID: 6505
[Token(Token = "0x2001969")]
public class TimeStampRequest : X509ExtensionBase
{
// Token: 0x06009A96 RID: 39574 RVA: 0x00200264 File Offset: 0x001FE464
[Token(Token = "0x6009A96")]
[Address(RVA = "0x1B2A2E0", Offset = "0x1B290E0", VA = "0x181B2A2E0")]
public TimeStampRequest(TimeStampReq req)
{
this.req = req;
X509Extensions x509Extensions = req.extensions;
this.extensions = x509Extensions;
}
// Token: 0x06009A97 RID: 39575 RVA: 0x00200294 File Offset: 0x001FE494
[Token(Token = "0x6009A97")]
[Address(RVA = "0x1B2A270", Offset = "0x1B29070", VA = "0x181B2A270")]
public TimeStampRequest(byte[] req)
{
Asn1InputStream asn1InputStream = new Asn1InputStream(req);
}
// Token: 0x06009A98 RID: 39576 RVA: 0x002002A8 File Offset: 0x001FE4A8
[Token(Token = "0x6009A98")]
[Address(RVA = "0x1B2A200", Offset = "0x1B29000", VA = "0x181B2A200")]
public TimeStampRequest(Stream input)
{
Asn1InputStream asn1InputStream = new Asn1InputStream(input);
}
// Token: 0x06009A99 RID: 39577 RVA: 0x002002BC File Offset: 0x001FE4BC
[Token(Token = "0x6009A99")]
[Address(RVA = "0x1B2A0F0", Offset = "0x1B28EF0", VA = "0x181B2A0F0")]
private TimeStampRequest(Asn1InputStream str)
{
Asn1Object asn1Object = str.ReadObject();
TimeStampReq instance = TimeStampReq.GetInstance(asn1Object);
this.req = instance;
}
// Token: 0x170018B9 RID: 6329
// (get) Token: 0x06009A9A RID: 39578 RVA: 0x00200300 File Offset: 0x001FE500
[Token(Token = "0x170018B9")]
public int Version
{
[Token(Token = "0x6009A9A")]
[Address(RVA = "0x1B2A430", Offset = "0x1B29230", VA = "0x181B2A430")]
get
{
return this.req.version.Value.IntValue;
}
}
// Token: 0x170018BA RID: 6330
// (get) Token: 0x06009A9B RID: 39579 RVA: 0x00200328 File Offset: 0x001FE528
[Token(Token = "0x170018BA")]
public string MessageImprintAlgOid
{
[Token(Token = "0x6009A9B")]
[Address(RVA = "0x1B2A360", Offset = "0x1B29160", VA = "0x181B2A360")]
get
{
Asn1Object asn1Object = this.req.messageImprint.hashAlgorithm.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x06009A9C RID: 39580 RVA: 0x00200350 File Offset: 0x001FE550
[Token(Token = "0x6009A9C")]
[Address(RVA = "0x1898620", Offset = "0x1897420", VA = "0x181898620")]
public byte[] GetMessageImprintDigest()
{
return this.req.messageImprint.hashedMessage;
}
// Token: 0x170018BB RID: 6331
// (get) Token: 0x06009A9D RID: 39581 RVA: 0x00200374 File Offset: 0x001FE574
[Token(Token = "0x170018BB")]
public string ReqPolicy
{
[Token(Token = "0x6009A9D")]
[Address(RVA = "0x1B2A3F0", Offset = "0x1B291F0", VA = "0x181B2A3F0")]
get
{
DerObjectIdentifier tsaPolicy = this.req.tsaPolicy;
if (tsaPolicy == 0)
{
}
return tsaPolicy.identifier;
}
}
// Token: 0x170018BC RID: 6332
// (get) Token: 0x06009A9E RID: 39582 RVA: 0x002003A0 File Offset: 0x001FE5A0
[Token(Token = "0x170018BC")]
public BigInteger Nonce
{
[Token(Token = "0x6009A9E")]
[Address(RVA = "0x1B2A3B0", Offset = "0x1B291B0", VA = "0x181B2A3B0")]
get
{
DerInteger nonce = this.req.nonce;
if (nonce == 0)
{
}
return nonce.Value;
}
}
// Token: 0x170018BD RID: 6333
// (get) Token: 0x06009A9F RID: 39583 RVA: 0x002003CC File Offset: 0x001FE5CC
[Token(Token = "0x170018BD")]
public bool CertReq
{
[Token(Token = "0x6009A9F")]
[Address(RVA = "0x1B2A320", Offset = "0x1B29120", VA = "0x181B2A320")]
get
{
DerBoolean certReq = this.req.certReq;
if (certReq == 0)
{
}
return certReq.IsTrue;
}
}
// Token: 0x06009AA0 RID: 39584 RVA: 0x002003F8 File Offset: 0x001FE5F8
[Token(Token = "0x6009AA0")]
[Address(RVA = "0x1B29C70", Offset = "0x1B28A70", VA = "0x181B29C70")]
public void Validate(IList algorithms, IList policies, IList extensions)
{
/*
An exception occurred when decompiling this method (06009AA0)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TimeStampRequest::Validate(System.Collections.IList,System.Collections.IList,System.Collections.IList)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_FF:
stloc:TspValidationException(var_13_10A, newobj:TspValidationException(TspValidationException::.ctor, ldstr:string("imprint digest the wrong length"), ldc.i4:int32(4)))
}
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: 0x06009AA1 RID: 39585 RVA: 0x00200510 File Offset: 0x001FE710
[Token(Token = "0x6009AA1")]
[Address(RVA = "0x16362F0", Offset = "0x16350F0", VA = "0x1816362F0")]
public byte[] GetEncoded()
{
return this.req.GetEncoded();
}
// Token: 0x170018BE RID: 6334
// (get) Token: 0x06009AA2 RID: 39586 RVA: 0x00200530 File Offset: 0x001FE730
[Token(Token = "0x170018BE")]
internal X509Extensions Extensions
{
[Token(Token = "0x6009AA2")]
[Address(RVA = "0x532820", Offset = "0x531620", VA = "0x180532820")]
get
{
return this.req.extensions;
}
}
// Token: 0x170018BF RID: 6335
// (get) Token: 0x06009AA3 RID: 39587 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x170018BF")]
public virtual bool HasExtensions
{
[Token(Token = "0x6009AA3")]
[Address(RVA = "0x1227D50", Offset = "0x1226B50", VA = "0x181227D50", Slot = "13")]
get
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
// Token: 0x06009AA4 RID: 39588 RVA: 0x00200550 File Offset: 0x001FE750
[Token(Token = "0x6009AA4")]
[Address(RVA = "0x1B29C50", Offset = "0x1B28A50", VA = "0x181B29C50", Slot = "14")]
public virtual X509Extension GetExtension(DerObjectIdentifier oid)
{
X509Extensions x509Extensions = this.extensions;
if (x509Extensions == 0)
{
}
return x509Extensions.GetExtension(oid);
}
// Token: 0x06009AA5 RID: 39589 RVA: 0x00200574 File Offset: 0x001FE774
[Token(Token = "0x6009AA5")]
[Address(RVA = "0x1B29BF0", Offset = "0x1B289F0", VA = "0x181B29BF0", Slot = "15")]
public virtual IList GetExtensionOids()
{
return TspUtil.GetExtensionOids(this.extensions);
}
// Token: 0x06009AA6 RID: 39590 RVA: 0x0020058C File Offset: 0x001FE78C
[Token(Token = "0x6009AA6")]
[Address(RVA = "0x532820", Offset = "0x531620", VA = "0x180532820", Slot = "8")]
protected override X509Extensions GetX509Extensions()
{
return this.req.extensions;
}
// Token: 0x040068AF RID: 26799
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40068AF")]
private TimeStampReq req;
// Token: 0x040068B0 RID: 26800
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40068B0")]
private X509Extensions extensions;
}
}
@@ -0,0 +1,171 @@
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
{
// Token: 0x0200196A RID: 6506
[Token(Token = "0x200196A")]
public class TimeStampRequestGenerator
{
// Token: 0x06009AA7 RID: 39591 RVA: 0x002005AC File Offset: 0x001FE7AC
[Token(Token = "0x6009AA7")]
[Address(RVA = "0x1B29B10", Offset = "0x1B28910", VA = "0x181B29B10")]
public void SetReqPolicy(string reqPolicy)
{
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(reqPolicy);
this.reqPolicy = derObjectIdentifier;
}
// Token: 0x06009AA8 RID: 39592 RVA: 0x002005C8 File Offset: 0x001FE7C8
[Token(Token = "0x6009AA8")]
[Address(RVA = "0x1B29AA0", Offset = "0x1B288A0", VA = "0x181B29AA0")]
public void SetCertReq(bool certReq)
{
DerBoolean instance = DerBoolean.GetInstance(certReq);
this.certReq = instance;
}
// Token: 0x06009AA9 RID: 39593 RVA: 0x002005E4 File Offset: 0x001FE7E4
[Token(Token = "0x6009AA9")]
[Address(RVA = "0x1B29700", Offset = "0x1B28500", VA = "0x181B29700")]
[Obsolete]
public void AddExtension(string oid, bool critical, Asn1Encodable value)
{
byte[] encoded = value.GetEncoded();
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(oid);
IDictionary dictionary = this.extensions;
DerOctetString derOctetString = new DerOctetString(encoded);
X509Extension x509Extension = new X509Extension(critical, derOctetString);
IList list = this.extOrdering;
throw new NullReferenceException();
}
// Token: 0x06009AAA RID: 39594 RVA: 0x00200624 File Offset: 0x001FE824
[Token(Token = "0x6009AAA")]
[Address(RVA = "0x1B29600", Offset = "0x1B28400", VA = "0x181B29600")]
[Obsolete]
public void AddExtension(string oid, bool critical, byte[] value)
{
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(oid);
IDictionary dictionary = this.extensions;
DerOctetString derOctetString = new DerOctetString(value);
X509Extension x509Extension = new X509Extension(critical, derOctetString);
IList list = this.extOrdering;
throw new NullReferenceException();
}
// Token: 0x06009AAB RID: 39595 RVA: 0x0020065C File Offset: 0x001FE85C
[Token(Token = "0x6009AAB")]
[Address(RVA = "0x1B294C0", Offset = "0x1B282C0", VA = "0x181B294C0", Slot = "4")]
public virtual void AddExtension(DerObjectIdentifier oid, bool critical, Asn1Encodable extValue)
{
byte[] encoded = extValue.GetEncoded();
}
// Token: 0x06009AAC RID: 39596 RVA: 0x00200678 File Offset: 0x001FE878
[Token(Token = "0x6009AAC")]
[Address(RVA = "0x1B29520", Offset = "0x1B28320", VA = "0x181B29520", Slot = "5")]
public virtual void AddExtension(DerObjectIdentifier oid, bool critical, byte[] extValue)
{
IDictionary dictionary = this.extensions;
DerOctetString derOctetString = new DerOctetString(extValue);
X509Extension x509Extension = new X509Extension(critical, derOctetString);
IList list = this.extOrdering;
throw new NullReferenceException();
}
// Token: 0x06009AAD RID: 39597 RVA: 0x002006A8 File Offset: 0x001FE8A8
[Token(Token = "0x6009AAD")]
[Address(RVA = "0x1B29810", Offset = "0x1B28610", VA = "0x181B29810")]
public TimeStampRequest Generate(string digestAlgorithm, byte[] digest)
{
int num = 0;
return this.Generate(digestAlgorithm, digest, num);
}
// Token: 0x06009AAE RID: 39598 RVA: 0x002006C0 File Offset: 0x001FE8C0
[Token(Token = "0x6009AAE")]
[Address(RVA = "0x1B29890", Offset = "0x1B28690", VA = "0x181B29890")]
public TimeStampRequest Generate(string digestAlgorithmOid, byte[] digest, BigInteger nonce)
{
/*
An exception occurred when decompiling this method (06009AAE)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TimeStampRequest BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TimeStampRequestGenerator::Generate(System.String,System.Byte[],BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_95:
stloc:ArgumentException(var_15_9F, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("No digest algorithm specified")))
}
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.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
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: 0x06009AAF RID: 39599 RVA: 0x00200770 File Offset: 0x001FE970
[Token(Token = "0x6009AAF")]
[Address(RVA = "0x1B29830", Offset = "0x1B28630", VA = "0x181B29830", Slot = "6")]
public virtual TimeStampRequest Generate(DerObjectIdentifier digestAlgorithm, byte[] digest)
{
string identifier = digestAlgorithm.identifier;
int num = 0;
return this.Generate(identifier, digest, num);
}
// Token: 0x06009AB0 RID: 39600 RVA: 0x00200798 File Offset: 0x001FE998
[Token(Token = "0x6009AB0")]
[Address(RVA = "0x1B29860", Offset = "0x1B28660", VA = "0x181B29860", Slot = "7")]
public virtual TimeStampRequest Generate(DerObjectIdentifier digestAlgorithm, byte[] digest, BigInteger nonce)
{
string identifier = digestAlgorithm.identifier;
return this.Generate(identifier, digest, nonce);
}
// Token: 0x06009AB1 RID: 39601 RVA: 0x002007BC File Offset: 0x001FE9BC
[Token(Token = "0x6009AB1")]
[Address(RVA = "0x1B29B80", Offset = "0x1B28980", VA = "0x181B29B80")]
public TimeStampRequestGenerator()
{
IDictionary dictionary = Platform.CreateHashtable();
this.extensions = dictionary;
IList list = Platform.CreateArrayList();
this.extOrdering = list;
base..ctor();
}
// Token: 0x040068B1 RID: 26801
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40068B1")]
private DerObjectIdentifier reqPolicy;
// Token: 0x040068B2 RID: 26802
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40068B2")]
private DerBoolean certReq;
// Token: 0x040068B3 RID: 26803
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40068B3")]
private IDictionary extensions;
// Token: 0x040068B4 RID: 26804
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40068B4")]
private IList extOrdering;
}
}
@@ -0,0 +1,162 @@
using System;
using System.IO;
using System.Text;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Cms;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
{
// Token: 0x0200196B RID: 6507
[Token(Token = "0x200196B")]
public class TimeStampResponse
{
// Token: 0x06009AB2 RID: 39602 RVA: 0x002007F0 File Offset: 0x001FE9F0
[Token(Token = "0x6009AB2")]
[Address(RVA = "0x1B2B5C0", Offset = "0x1B2A3C0", VA = "0x181B2B5C0")]
public TimeStampResponse(TimeStampResp resp)
{
this.resp = resp;
ContentInfo contentInfo = resp.timeStampToken;
if (contentInfo != 0)
{
TimeStampToken timeStampToken = new TimeStampToken(contentInfo);
CmsSignedData cmsSignedData = new CmsSignedData(contentInfo);
this.timeStampToken = timeStampToken;
}
}
// Token: 0x06009AB3 RID: 39603 RVA: 0x00200830 File Offset: 0x001FEA30
[Token(Token = "0x6009AB3")]
[Address(RVA = "0x1B2B4C0", Offset = "0x1B2A2C0", VA = "0x181B2B4C0")]
public TimeStampResponse(byte[] resp)
{
TimeStampResp timeStampResp = TimeStampResponse.readTimeStampResp(new Asn1InputStream(resp));
}
// Token: 0x06009AB4 RID: 39604 RVA: 0x0020084C File Offset: 0x001FEA4C
[Token(Token = "0x6009AB4")]
[Address(RVA = "0x1B2B540", Offset = "0x1B2A340", VA = "0x181B2B540")]
public TimeStampResponse(Stream input)
{
TimeStampResp timeStampResp = TimeStampResponse.readTimeStampResp(new Asn1InputStream(input));
}
// Token: 0x06009AB5 RID: 39605 RVA: 0x00200868 File Offset: 0x001FEA68
[Token(Token = "0x6009AB5")]
[Address(RVA = "0x1B2B6D0", Offset = "0x1B2A4D0", VA = "0x181B2B6D0")]
private static TimeStampResp readTimeStampResp(Asn1InputStream input)
{
Asn1Object asn1Object = input.ReadObject();
return TimeStampResp.GetInstance(asn1Object);
}
// Token: 0x170018C0 RID: 6336
// (get) Token: 0x06009AB6 RID: 39606 RVA: 0x002008AC File Offset: 0x001FEAAC
[Token(Token = "0x170018C0")]
public int Status
{
[Token(Token = "0x6009AB6")]
[Address(RVA = "0x1B2B690", Offset = "0x1B2A490", VA = "0x181B2B690")]
get
{
return this.resp.pkiStatusInfo.Status.IntValue;
}
}
// Token: 0x06009AB7 RID: 39607 RVA: 0x002008D4 File Offset: 0x001FEAD4
[Token(Token = "0x6009AB7")]
[Address(RVA = "0x1B2ADF0", Offset = "0x1B29BF0", VA = "0x181B2ADF0")]
public string GetStatusString()
{
if (this.resp.pkiStatusInfo.statusString != (ulong)0L)
{
StringBuilder stringBuilder = new StringBuilder();
PkiFreeText statusString = this.resp.pkiStatusInfo.statusString;
int num = 0;
int size = statusString.Size;
if (num != size)
{
string @string = statusString[num].GetString();
StringBuilder stringBuilder2 = stringBuilder.Append(@string);
num++;
}
int hashCode = stringBuilder.GetHashCode();
}
throw new NullReferenceException();
}
// Token: 0x06009AB8 RID: 39608 RVA: 0x00200944 File Offset: 0x001FEB44
[Token(Token = "0x6009AB8")]
[Address(RVA = "0x1B2AD60", Offset = "0x1B29B60", VA = "0x181B2AD60")]
public PkiFailureInfo GetFailInfo()
{
DerBitString failInfo = this.resp.pkiStatusInfo.failInfo;
if (failInfo != 0)
{
return new PkiFailureInfo(failInfo);
}
throw new NullReferenceException();
}
// Token: 0x170018C1 RID: 6337
// (get) Token: 0x06009AB9 RID: 39609 RVA: 0x00200974 File Offset: 0x001FEB74
[Token(Token = "0x170018C1")]
public TimeStampToken TimeStampToken
{
[Token(Token = "0x6009AB9")]
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
get
{
return this.timeStampToken;
}
}
// Token: 0x06009ABA RID: 39610 RVA: 0x00200988 File Offset: 0x001FEB88
[Token(Token = "0x6009ABA")]
[Address(RVA = "0x1B2AF20", Offset = "0x1B29D20", VA = "0x181B2AF20")]
public void Validate(TimeStampRequest request)
{
/*
An exception occurred when decompiling this method (06009ABA)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TimeStampResponse::Validate(BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TimeStampRequest)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_1EE:
stloc:TspValidationException(var_24_1F8, newobj:TspValidationException(TspValidationException::.ctor, ldstr:string("TSA policy wrong for request.")))
}
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: 0x06009ABB RID: 39611 RVA: 0x00200B90 File Offset: 0x001FED90
[Token(Token = "0x6009ABB")]
[Address(RVA = "0x16362F0", Offset = "0x16350F0", VA = "0x1816362F0")]
public byte[] GetEncoded()
{
return this.resp.GetEncoded();
}
// Token: 0x040068B5 RID: 26805
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40068B5")]
private TimeStampResp resp;
// Token: 0x040068B6 RID: 26806
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40068B6")]
private TimeStampToken timeStampToken;
}
}
@@ -0,0 +1,205 @@
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
{
// Token: 0x0200196C RID: 6508
[Token(Token = "0x200196C")]
public class TimeStampResponseGenerator
{
// Token: 0x06009ABC RID: 39612 RVA: 0x00200BB0 File Offset: 0x001FEDB0
[Token(Token = "0x6009ABC")]
[Address(RVA = "0x1B2AC80", Offset = "0x1B29A80", VA = "0x181B2AC80")]
public TimeStampResponseGenerator(TimeStampTokenGenerator tokenGenerator, IList acceptedAlgorithms)
{
}
// Token: 0x06009ABD RID: 39613 RVA: 0x00200BC4 File Offset: 0x001FEDC4
[Token(Token = "0x6009ABD")]
[Address(RVA = "0x1B2ACA0", Offset = "0x1B29AA0", VA = "0x181B2ACA0")]
public TimeStampResponseGenerator(TimeStampTokenGenerator tokenGenerator, IList acceptedAlgorithms, IList acceptedPolicy)
{
}
// Token: 0x06009ABE RID: 39614 RVA: 0x00200BD4 File Offset: 0x001FEDD4
[Token(Token = "0x6009ABE")]
[Address(RVA = "0x1B2ACC0", Offset = "0x1B29AC0", VA = "0x181B2ACC0")]
public TimeStampResponseGenerator(TimeStampTokenGenerator tokenGenerator, IList acceptedAlgorithms, IList acceptedPolicies, IList acceptedExtensions)
{
this.acceptedExtensions = 0;
this.tokenGenerator = tokenGenerator;
this.acceptedAlgorithms = acceptedAlgorithms;
this.acceptedPolicies = acceptedPolicies;
Asn1EncodableVector asn1EncodableVector = new Asn1EncodableVector(Array.Empty<Asn1Encodable>());
this.statusStrings = asn1EncodableVector;
}
// Token: 0x06009ABF RID: 39615 RVA: 0x00200C18 File Offset: 0x001FEE18
[Token(Token = "0x6009ABF")]
[Address(RVA = "0x1B2A470", Offset = "0x1B29270", VA = "0x181B2A470")]
private void AddStatusString(string statusString)
{
Asn1EncodableVector asn1EncodableVector = this.statusStrings;
Asn1Encodable[] array = new Asn1Encodable[1];
DerUtf8String derUtf8String = new DerUtf8String(statusString);
if (derUtf8String != 0)
{
}
array[0] = derUtf8String;
asn1EncodableVector.Add(array);
}
// Token: 0x06009AC0 RID: 39616 RVA: 0x00200C54 File Offset: 0x001FEE54
[Token(Token = "0x6009AC0")]
[Address(RVA = "0x1B2AC70", Offset = "0x1B29A70", VA = "0x181B2AC70")]
private void SetFailInfoField(int field)
{
}
// Token: 0x06009AC1 RID: 39617 RVA: 0x00200C64 File Offset: 0x001FEE64
[Token(Token = "0x6009AC1")]
[Address(RVA = "0x1B2A980", Offset = "0x1B29780", VA = "0x181B2A980")]
private PkiStatusInfo GetPkiStatusInfo()
{
Asn1Encodable[] array = new Asn1Encodable[1];
PkiStatus pkiStatus = this.status;
int num;
DerInteger derInteger = new DerInteger(num);
num = (int)pkiStatus;
if (derInteger != 0)
{
}
array[0] = derInteger;
Asn1EncodableVector asn1EncodableVector = new Asn1EncodableVector(array);
if (this.statusStrings.Count > 0)
{
Asn1Encodable[] array2 = new Asn1Encodable[1];
PkiFreeText pkiFreeText = new PkiFreeText(new DerSequence(this.statusStrings));
if (pkiFreeText != 0)
{
}
array2[0] = pkiFreeText;
asn1EncodableVector.Add(array2);
}
if (this.failInfo != 0)
{
Asn1Encodable[] array3 = new Asn1Encodable[1];
TimeStampResponseGenerator.FailInfo failInfo = new TimeStampResponseGenerator.FailInfo(this.failInfo);
if (failInfo != 0)
{
}
array3[0] = failInfo;
asn1EncodableVector.Add(array3);
}
return new PkiStatusInfo(new DerSequence(asn1EncodableVector));
}
// Token: 0x06009AC2 RID: 39618 RVA: 0x00200D24 File Offset: 0x001FEF24
[Token(Token = "0x6009AC2")]
[Address(RVA = "0x1B2A650", Offset = "0x1B29450", VA = "0x181B2A650")]
public TimeStampResponse Generate(TimeStampRequest request, BigInteger serialNumber, DateTime genTime)
{
DateTimeObject dateTimeObject = new DateTimeObject(genTime);
return this.Generate(request, serialNumber, dateTimeObject);
}
// Token: 0x06009AC3 RID: 39619 RVA: 0x00200D44 File Offset: 0x001FEF44
[Token(Token = "0x6009AC3")]
[Address(RVA = "0x1B2A6F0", Offset = "0x1B294F0", VA = "0x181B2A6F0")]
public TimeStampResponse Generate(TimeStampRequest request, BigInteger serialNumber, DateTimeObject genTime)
{
/*
An exception occurred when decompiling this method (06009AC3)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TimeStampResponse BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TimeStampResponseGenerator::Generate(BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TimeStampRequest,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date.DateTimeObject)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_D9:
stloc:TspValidationException(var_17_E8, newobj:TspValidationException(TspValidationException::.ctor, ldstr:string("The time source is not available."), ldc.i4:int32(512)))
}
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.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
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: 0x06009AC4 RID: 39620 RVA: 0x00200E3C File Offset: 0x001FF03C
[Token(Token = "0x6009AC4")]
[Address(RVA = "0x1B2A550", Offset = "0x1B29350", VA = "0x181B2A550")]
public TimeStampResponse GenerateFailResponse(PkiStatus status, int failInfoField, string statusString)
{
this.status = status;
if (statusString != 0)
{
this.AddStatusString(statusString);
}
int num;
TimeStampResp timeStampResp = new TimeStampResp(this.GetPkiStatusInfo(), num);
num = 0;
return new TimeStampResponse(timeStampResp);
}
// Token: 0x040068B7 RID: 26807
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40068B7")]
private PkiStatus status;
// Token: 0x040068B8 RID: 26808
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40068B8")]
private Asn1EncodableVector statusStrings;
// Token: 0x040068B9 RID: 26809
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40068B9")]
private int failInfo;
// Token: 0x040068BA RID: 26810
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40068BA")]
private TimeStampTokenGenerator tokenGenerator;
// Token: 0x040068BB RID: 26811
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40068BB")]
private IList acceptedAlgorithms;
// Token: 0x040068BC RID: 26812
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40068BC")]
private IList acceptedPolicies;
// Token: 0x040068BD RID: 26813
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40068BD")]
private IList acceptedExtensions;
// Token: 0x0200196D RID: 6509
[Token(Token = "0x200196D")]
private class FailInfo : DerBitString
{
// Token: 0x06009AC5 RID: 39621 RVA: 0x00200E88 File Offset: 0x001FF088
[Token(Token = "0x6009AC5")]
[Address(RVA = "0x1B15270", Offset = "0x1B14070", VA = "0x181B15270")]
internal FailInfo(int failInfoValue)
: base(failInfoValue)
{
}
}
}
}
@@ -0,0 +1,388 @@
using System;
using System.Collections;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ess;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
{
// Token: 0x0200196E RID: 6510
[Token(Token = "0x200196E")]
public class TimeStampToken
{
// Token: 0x06009AC6 RID: 39622 RVA: 0x00200E9C File Offset: 0x001FF09C
[Token(Token = "0x6009AC6")]
[Address(RVA = "0x1B2CBA0", Offset = "0x1B2B9A0", VA = "0x181B2CBA0")]
public TimeStampToken(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.ContentInfo contentInfo)
{
CmsSignedData cmsSignedData = new CmsSignedData(contentInfo);
}
// Token: 0x06009AC7 RID: 39623 RVA: 0x00200EB0 File Offset: 0x001FF0B0
[Token(Token = "0x6009AC7")]
[Address(RVA = "0x1B2CC10", Offset = "0x1B2BA10", VA = "0x181B2CC10")]
public TimeStampToken(CmsSignedData signedData)
{
this.tsToken = signedData;
DerObjectIdentifier signedContentType = signedData.SignedContentType;
ICollection signers = this.tsToken.GetSignerInfos().GetSigners();
if (signers == (ulong)1L)
{
if (signers == 0)
{
}
int num = 0;
if (signers != 0)
{
this.tsaSignerInfo = signers;
CmsProcessable signedContent = this.tsToken.signedContent;
MemoryStream memoryStream = new MemoryStream();
if (num < signers)
{
num += num;
num++;
}
Asn1Object asn1Object;
TimeStampTokenInfo timeStampTokenInfo = new TimeStampTokenInfo(TstInfo.GetInstance(asn1Object));
this.tstInfo = timeStampTokenInfo;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttributes = this.tsaSignerInfo.SignedAttributes;
DerObjectIdentifier idAASigningCertificate = PkcsObjectIdentifiers.IdAASigningCertificate;
TimeStampToken.CertID certID;
if (signedAttributes[idAASigningCertificate] == 0)
{
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttributes2 = this.tsaSignerInfo.SignedAttributes;
DerObjectIdentifier idAASigningCertificateV = PkcsObjectIdentifiers.IdAASigningCertificateV2;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute attribute = signedAttributes2[idAASigningCertificateV];
if (attribute == 0)
{
TspValidationException ex = new TspValidationException("no signing certificate attribute found, time stamp invalid.");
throw new NullReferenceException();
}
IEnumerator enumerator = attribute.attrValues.GetEnumerator();
int num2 = 0;
SigningCertificateV2 signingCertificateV;
EssCertIDv2[] certs = signingCertificateV.GetCerts();
num2 += num2;
EssCertIDv2 instance = EssCertIDv2.GetInstance(certs[0]);
certID.certIDv2 = instance;
certID.certID = num;
}
EssCertIDv2 certIDv = certID.certIDv2;
SigningCertificate signingCertificate;
EssCertID instance2 = EssCertID.GetInstance(signingCertificate.GetCerts()[0]);
TimeStampToken.CertID certID2;
certID2.certID = instance2;
certID2.certIDv2 = num;
this.certID = certID2;
return;
}
}
throw new NullReferenceException();
}
// Token: 0x170018C2 RID: 6338
// (get) Token: 0x06009AC8 RID: 39624 RVA: 0x00201098 File Offset: 0x001FF298
[Token(Token = "0x170018C2")]
public TimeStampTokenInfo TimeStampInfo
{
[Token(Token = "0x6009AC8")]
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
get
{
return this.tstInfo;
}
}
// Token: 0x170018C3 RID: 6339
// (get) Token: 0x06009AC9 RID: 39625 RVA: 0x002010AC File Offset: 0x001FF2AC
[Token(Token = "0x170018C3")]
public SignerID SignerID
{
[Token(Token = "0x6009AC9")]
[Address(RVA = "0x3F71E0", Offset = "0x3F5FE0", VA = "0x1803F71E0")]
get
{
return this.tsaSignerInfo.sid;
}
}
// Token: 0x170018C4 RID: 6340
// (get) Token: 0x06009ACA RID: 39626 RVA: 0x002010CC File Offset: 0x001FF2CC
[Token(Token = "0x170018C4")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable SignedAttributes
{
[Token(Token = "0x6009ACA")]
[Address(RVA = "0x1B2D290", Offset = "0x1B2C090", VA = "0x181B2D290")]
get
{
return this.tsaSignerInfo.SignedAttributes;
}
}
// Token: 0x170018C5 RID: 6341
// (get) Token: 0x06009ACB RID: 39627 RVA: 0x002010EC File Offset: 0x001FF2EC
[Token(Token = "0x170018C5")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable UnsignedAttributes
{
[Token(Token = "0x6009ACB")]
[Address(RVA = "0x1B2D2B0", Offset = "0x1B2C0B0", VA = "0x181B2D2B0")]
get
{
return this.tsaSignerInfo.UnsignedAttributes;
}
}
// Token: 0x06009ACC RID: 39628 RVA: 0x0020110C File Offset: 0x001FF30C
[Token(Token = "0x6009ACC")]
[Address(RVA = "0x1B2C450", Offset = "0x1B2B250", VA = "0x181B2C450")]
public IX509Store GetCertificates(string type)
{
return this.tsToken.GetCertificates(type);
}
// Token: 0x06009ACD RID: 39629 RVA: 0x0020112C File Offset: 0x001FF32C
[Token(Token = "0x6009ACD")]
[Address(RVA = "0x1B2C470", Offset = "0x1B2B270", VA = "0x181B2C470")]
public IX509Store GetCrls(string type)
{
return this.tsToken.GetCrls(type);
}
// Token: 0x06009ACE RID: 39630 RVA: 0x0020114C File Offset: 0x001FF34C
[Token(Token = "0x6009ACE")]
[Address(RVA = "0x1B2C430", Offset = "0x1B2B230", VA = "0x181B2C430")]
public IX509Store GetAttributeCertificates(string type)
{
return this.tsToken.GetAttributeCertificates(type);
}
// Token: 0x06009ACF RID: 39631 RVA: 0x0020116C File Offset: 0x001FF36C
[Token(Token = "0x6009ACF")]
[Address(RVA = "0x1B2C4B0", Offset = "0x1B2B2B0", VA = "0x181B2C4B0")]
public void Validate(X509Certificate cert)
{
EssCertID essCertID3;
for (;;)
{
TimeStampToken.CertID certID = this.certID;
if (certID.certID == (ulong)0L)
{
DerObjectIdentifier idSha = NistObjectIdentifiers.IdSha256;
if (certID.certIDv2.hashAlgorithm.ToAsn1Object() == 0)
{
Asn1Object asn1Object = certID.certIDv2.hashAlgorithm.ToAsn1Object();
}
}
AsymmetricKeyParameter publicKey = cert.GetPublicKey();
EssCertID essCertID = this.certID.certID;
if (essCertID != 0)
{
int length = essCertID.GetCertHash().Length;
byte[] array;
byte[] array2;
if (!Arrays.ConstantTimeAreEqual(array, array2))
{
goto IL_21A;
}
TimeStampToken.CertID certID2 = this.certID;
EssCertID essCertID2 = certID2.certID;
if (essCertID2 != 0)
{
}
if (certID2.certIDv2.issuerSerial == 0)
{
goto IL_12E;
}
if (essCertID2 != 0)
{
DerInteger serial = essCertID2.issuerSerial.serial;
if (cert.Version == 0)
{
goto IL_1C6;
}
essCertID3 = this.certID.certID;
if (essCertID3 != 0)
{
break;
}
}
}
}
byte[] bytes = essCertID3.issuerSerial.serial.bytes;
X509Name issuerX509Principal = PrincipalUtilities.GetIssuerX509Principal(cert);
int num = 0;
GeneralName[] array3;
if (num == array3.Length)
{
TspValidationException ex = new TspValidationException("certificate name does not match certID for signature. ");
throw new NullReferenceException();
}
GeneralName generalName = array3[num];
if (generalName.tag != 4 || !X509Name.GetInstance(generalName.obj).Equivalent(issuerX509Principal))
{
num++;
}
IL_12E:
TspUtil.ValidateCertificate(cert);
DateTime genTime = this.tstInfo.genTime;
if (!this.tsaSignerInfo.Verify(cert))
{
TspValidationException ex2 = new TspValidationException("signature not created by certificate.");
throw new NullReferenceException();
}
if (!cert.hashValueSet)
{
return;
}
throw new NullReferenceException();
IL_1C6:
TspValidationException ex3 = new TspValidationException("certificate serial number does not match certID for signature.");
throw new NullReferenceException();
IL_21A:
TspValidationException ex4 = new TspValidationException("certificate hash does not match certID hash.");
throw new NullReferenceException();
}
// Token: 0x06009AD0 RID: 39632 RVA: 0x002013D0 File Offset: 0x001FF5D0
[Token(Token = "0x6009AD0")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
public CmsSignedData ToCmsSignedData()
{
return this.tsToken;
}
// Token: 0x06009AD1 RID: 39633 RVA: 0x002013E4 File Offset: 0x001FF5E4
[Token(Token = "0x6009AD1")]
[Address(RVA = "0x1B2C490", Offset = "0x1B2B290", VA = "0x181B2C490")]
public byte[] GetEncoded()
{
return this.tsToken.GetEncoded();
}
// Token: 0x040068BE RID: 26814
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40068BE")]
private readonly CmsSignedData tsToken;
// Token: 0x040068BF RID: 26815
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40068BF")]
private readonly SignerInformation tsaSignerInfo;
// Token: 0x040068C0 RID: 26816
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40068C0")]
private readonly TimeStampTokenInfo tstInfo;
// Token: 0x040068C1 RID: 26817
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40068C1")]
private readonly TimeStampToken.CertID certID;
// Token: 0x0200196F RID: 6511
[Token(Token = "0x200196F")]
private class CertID
{
// Token: 0x06009AD2 RID: 39634 RVA: 0x00201404 File Offset: 0x001FF604
[Token(Token = "0x6009AD2")]
[Address(RVA = "0x1B151E0", Offset = "0x1B13FE0", VA = "0x181B151E0")]
internal CertID(EssCertID certID)
{
this.certID = certID;
this.certIDv2 = (ulong)0L;
}
// Token: 0x06009AD3 RID: 39635 RVA: 0x00201428 File Offset: 0x001FF628
[Token(Token = "0x6009AD3")]
[Address(RVA = "0x1B15210", Offset = "0x1B14010", VA = "0x181B15210")]
internal CertID(EssCertIDv2 certID)
{
this.certIDv2 = certID;
this.certID = (ulong)0L;
}
// Token: 0x06009AD4 RID: 39636 RVA: 0x0020144C File Offset: 0x001FF64C
[Token(Token = "0x6009AD4")]
[Address(RVA = "0x1B15020", Offset = "0x1B13E20", VA = "0x181B15020")]
public string GetHashAlgorithmName()
{
if (this.certID == (ulong)0L)
{
EssCertIDv2 essCertIDv = this.certIDv2;
DerObjectIdentifier idSha = NistObjectIdentifiers.IdSha256;
if (essCertIDv.hashAlgorithm.ToAsn1Object() == 0)
{
Asn1Object asn1Object = this.certIDv2.hashAlgorithm.ToAsn1Object();
}
return "SHA-256";
}
return "SHA-1";
}
// Token: 0x06009AD5 RID: 39637 RVA: 0x002014A4 File Offset: 0x001FF6A4
[Token(Token = "0x6009AD5")]
[Address(RVA = "0x1B15130", Offset = "0x1B13F30", VA = "0x181B15130")]
public AlgorithmIdentifier GetHashAlgorithm()
{
if (this.certID != (ulong)0L)
{
return new AlgorithmIdentifier(OiwObjectIdentifiers.IdSha1);
}
return this.certIDv2.hashAlgorithm;
}
// Token: 0x06009AD6 RID: 39638 RVA: 0x002014D8 File Offset: 0x001FF6D8
[Token(Token = "0x6009AD6")]
[Address(RVA = "0x1B14FE0", Offset = "0x1B13DE0", VA = "0x181B14FE0")]
public byte[] GetCertHash()
{
EssCertID essCertID = this.certID;
if (essCertID != 0)
{
return essCertID.GetCertHash();
}
return this.certIDv2.GetCertHash();
}
// Token: 0x170018C6 RID: 6342
// (get) Token: 0x06009AD7 RID: 39639 RVA: 0x00201508 File Offset: 0x001FF708
[Token(Token = "0x170018C6")]
public IssuerSerial IssuerSerial
{
[Token(Token = "0x6009AD7")]
[Address(RVA = "0x1B15240", Offset = "0x1B14040", VA = "0x181B15240")]
get
{
EssCertID essCertID = this.certID;
if (essCertID != 0)
{
return essCertID.issuerSerial;
}
return this.certIDv2.issuerSerial;
}
}
// Token: 0x040068C2 RID: 26818
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40068C2")]
private EssCertID certID;
// Token: 0x040068C3 RID: 26819
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40068C3")]
private EssCertIDv2 certIDv2;
}
}
}
@@ -0,0 +1,261 @@
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ess;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
{
// Token: 0x02001970 RID: 6512
[Token(Token = "0x2001970")]
public class TimeStampTokenGenerator
{
// Token: 0x06009AD8 RID: 39640 RVA: 0x00201538 File Offset: 0x001FF738
[Token(Token = "0x6009AD8")]
[Address(RVA = "0x1B2C120", Offset = "0x1B2AF20", VA = "0x181B2C120")]
public TimeStampTokenGenerator(AsymmetricKeyParameter key, X509Certificate cert, string digestOID, string tsaPolicyOID)
{
}
// Token: 0x06009AD9 RID: 39641 RVA: 0x00201548 File Offset: 0x001FF748
[Token(Token = "0x6009AD9")]
[Address(RVA = "0x1B2BE40", Offset = "0x1B2AC40", VA = "0x181B2BE40")]
public TimeStampTokenGenerator(AsymmetricKeyParameter key, X509Certificate cert, string digestOID, string tsaPolicyOID, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttr, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttr)
{
this.accuracySeconds = (int)((ulong)(-1L));
this.accuracyMicros = (int)((ulong)4294967295L);
base..ctor();
this.key = key;
this.cert = cert;
this.digestOID = digestOID;
this.tsaPolicyOID = 0;
this.unsignedAttr = 0;
TspUtil.ValidateCertificate(cert);
if (cert == 0)
{
IDictionary dictionary = Platform.CreateHashtable();
}
AsymmetricKeyParameter publicKey = cert.GetPublicKey();
byte[] array;
EssCertID essCertID = new EssCertID(array);
DerObjectIdentifier idAASigningCertificate = PkcsObjectIdentifiers.IdAASigningCertificate;
DerSet derSet = new DerSet(new SigningCertificate(essCertID));
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute attribute = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute(idAASigningCertificate, derSet);
IDictionary dictionary2;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(dictionary2);
this.signedAttr = attributeTable;
}
// Token: 0x06009ADA RID: 39642 RVA: 0x0020161C File Offset: 0x001FF81C
[Token(Token = "0x6009ADA")]
[Address(RVA = "0x466B90", Offset = "0x465990", VA = "0x180466B90")]
public void SetCertificates(IX509Store certificates)
{
this.x509Certs = certificates;
}
// Token: 0x06009ADB RID: 39643 RVA: 0x00201630 File Offset: 0x001FF830
[Token(Token = "0x6009ADB")]
[Address(RVA = "0x567490", Offset = "0x566290", VA = "0x180567490")]
public void SetCrls(IX509Store crls)
{
this.x509Crls = crls;
}
// Token: 0x06009ADC RID: 39644 RVA: 0x00201644 File Offset: 0x001FF844
[Token(Token = "0x6009ADC")]
[Address(RVA = "0x536480", Offset = "0x535280", VA = "0x180536480")]
public void SetAccuracySeconds(int accuracySeconds)
{
this.accuracySeconds = accuracySeconds;
}
// Token: 0x06009ADD RID: 39645 RVA: 0x00201658 File Offset: 0x001FF858
[Token(Token = "0x6009ADD")]
[Address(RVA = "0x52EC20", Offset = "0x52DA20", VA = "0x18052EC20")]
public void SetAccuracyMillis(int accuracyMillis)
{
this.accuracyMillis = accuracyMillis;
}
// Token: 0x06009ADE RID: 39646 RVA: 0x0020166C File Offset: 0x001FF86C
[Token(Token = "0x6009ADE")]
[Address(RVA = "0x41F740", Offset = "0x41E540", VA = "0x18041F740")]
public void SetAccuracyMicros(int accuracyMicros)
{
this.accuracyMicros = accuracyMicros;
}
// Token: 0x06009ADF RID: 39647 RVA: 0x00201680 File Offset: 0x001FF880
[Token(Token = "0x6009ADF")]
[Address(RVA = "0x8EE5B0", Offset = "0x8ED3B0", VA = "0x1808EE5B0")]
public void SetOrdering(bool ordering)
{
this.ordering = ordering;
}
// Token: 0x06009AE0 RID: 39648 RVA: 0x00201694 File Offset: 0x001FF894
[Token(Token = "0x6009AE0")]
[Address(RVA = "0x460F90", Offset = "0x45FD90", VA = "0x180460F90")]
public void SetTsa(GeneralName tsa)
{
this.tsa = tsa;
}
// Token: 0x06009AE1 RID: 39649 RVA: 0x002016A8 File Offset: 0x001FF8A8
[Token(Token = "0x6009AE1")]
[Address(RVA = "0x1B2B7D0", Offset = "0x1B2A5D0", VA = "0x181B2B7D0")]
public TimeStampToken Generate(TimeStampRequest request, BigInteger serialNumber, DateTime genTime)
{
Asn1Object asn1Object = request.req.messageImprint.hashAlgorithm.ToAsn1Object();
DerNull instance = DerNull.Instance;
DerObjectIdentifier derObjectIdentifier;
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(derObjectIdentifier, instance);
byte[] hashedMessage = request.req.messageImprint.hashedMessage;
MessageImprint messageImprint = new MessageImprint(algorithmIdentifier, hashedMessage);
int num = this.accuracySeconds;
if (this.accuracyMicros > 0)
{
int num2 = 0;
if (num > 0)
{
DerInteger derInteger = new DerInteger(num);
}
int num3 = this.accuracyMillis;
DerInteger derInteger2;
if (num3 > 0)
{
derInteger2 = new DerInteger(num3);
}
int num4 = this.accuracyMicros;
DerInteger derInteger3;
if (num4 > 0)
{
derInteger3 = new DerInteger(num3);
}
Accuracy accuracy = new Accuracy(num2, derInteger2, derInteger3);
}
bool flag = this.ordering;
if (flag)
{
DerBoolean instance2 = DerBoolean.GetInstance(flag);
}
DerInteger nonce = request.req.nonce;
if (nonce != 0 && nonce.Value != 0)
{
DerInteger nonce2 = request.req.nonce;
if (nonce2 == 0)
{
}
DerInteger derInteger4 = new DerInteger(nonce2.Value);
}
DerObjectIdentifier derObjectIdentifier2 = new DerObjectIdentifier(this.tsaPolicyOID);
DerObjectIdentifier tsaPolicy = request.req.tsaPolicy;
if (tsaPolicy != 0)
{
string identifier = tsaPolicy.identifier;
if (identifier != 0)
{
DerObjectIdentifier derObjectIdentifier3 = new DerObjectIdentifier(identifier);
}
}
DerGeneralizedTime derGeneralizedTime = new DerGeneralizedTime(genTime);
X509Extensions extensions = request.req.extensions;
CmsSignedDataGenerator cmsSignedDataGenerator = new CmsSignedDataGenerator();
TstInfo tstInfo;
byte[] derEncoded = tstInfo.GetDerEncoded();
DerBoolean certReq = request.req.certReq;
if (certReq != 0 && certReq.IsTrue)
{
IX509Store ix509Store = this.x509Certs;
cmsSignedDataGenerator.AddCertificates(ix509Store);
}
IX509Store ix509Store2 = this.x509Crls;
cmsSignedDataGenerator.AddCrls(ix509Store2);
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = this.signedAttr;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable2 = this.unsignedAttr;
string text = this.digestOID;
X509Certificate x509Certificate = this.cert;
AsymmetricKeyParameter asymmetricKeyParameter = this.key;
cmsSignedDataGenerator.AddSigner(asymmetricKeyParameter, x509Certificate, text, attributeTable, attributeTable2);
string identifier2 = PkcsObjectIdentifiers.IdCTTstInfo.identifier;
CmsProcessableByteArray cmsProcessableByteArray = new CmsProcessableByteArray(derEncoded);
return new TimeStampToken(cmsSignedDataGenerator.Generate(identifier2, cmsProcessableByteArray, true));
}
// Token: 0x040068C4 RID: 26820
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40068C4")]
private int accuracySeconds;
// Token: 0x040068C5 RID: 26821
[FieldOffset(Offset = "0x14")]
[Token(Token = "0x40068C5")]
private int accuracyMillis;
// Token: 0x040068C6 RID: 26822
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40068C6")]
private int accuracyMicros;
// Token: 0x040068C7 RID: 26823
[FieldOffset(Offset = "0x1C")]
[Token(Token = "0x40068C7")]
private bool ordering;
// Token: 0x040068C8 RID: 26824
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40068C8")]
private GeneralName tsa;
// Token: 0x040068C9 RID: 26825
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40068C9")]
private string tsaPolicyOID;
// Token: 0x040068CA RID: 26826
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40068CA")]
private AsymmetricKeyParameter key;
// Token: 0x040068CB RID: 26827
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40068CB")]
private X509Certificate cert;
// Token: 0x040068CC RID: 26828
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40068CC")]
private string digestOID;
// Token: 0x040068CD RID: 26829
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x40068CD")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttr;
// Token: 0x040068CE RID: 26830
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x40068CE")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttr;
// Token: 0x040068CF RID: 26831
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x40068CF")]
private IX509Store x509Certs;
// Token: 0x040068D0 RID: 26832
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x40068D0")]
private IX509Store x509Crls;
}
}
@@ -0,0 +1,204 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
{
// Token: 0x02001971 RID: 6513
[Token(Token = "0x2001971")]
public class TimeStampTokenInfo
{
// Token: 0x06009AE2 RID: 39650 RVA: 0x002018A8 File Offset: 0x001FFAA8
[Token(Token = "0x6009AE2")]
[Address(RVA = "0x1B2C180", Offset = "0x1B2AF80", VA = "0x181B2C180")]
public TimeStampTokenInfo(TstInfo tstInfo)
{
this.tstInfo = tstInfo;
DateTime dateTime = tstInfo.genTime.ToDateTime();
this.genTime = dateTime;
}
// Token: 0x170018C7 RID: 6343
// (get) Token: 0x06009AE3 RID: 39651 RVA: 0x002018F0 File Offset: 0x001FFAF0
[Token(Token = "0x170018C7")]
public bool IsOrdered
{
[Token(Token = "0x6009AE3")]
[Address(RVA = "0x1B2C310", Offset = "0x1B2B110", VA = "0x181B2C310")]
get
{
return this.tstInfo.ordering.IsTrue;
}
}
// Token: 0x170018C8 RID: 6344
// (get) Token: 0x06009AE4 RID: 39652 RVA: 0x00201914 File Offset: 0x001FFB14
[Token(Token = "0x170018C8")]
public Accuracy Accuracy
{
[Token(Token = "0x6009AE4")]
[Address(RVA = "0x532820", Offset = "0x531620", VA = "0x180532820")]
get
{
return this.tstInfo.accuracy;
}
}
// Token: 0x170018C9 RID: 6345
// (get) Token: 0x06009AE5 RID: 39653 RVA: 0x00201934 File Offset: 0x001FFB34
[Token(Token = "0x170018C9")]
public DateTime GenTime
{
[Token(Token = "0x6009AE5")]
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
get
{
return this.genTime;
}
}
// Token: 0x170018CA RID: 6346
// (get) Token: 0x06009AE6 RID: 39654 RVA: 0x00201948 File Offset: 0x001FFB48
[Token(Token = "0x170018CA")]
public GenTimeAccuracy GenTimeAccuracy
{
[Token(Token = "0x6009AE6")]
[Address(RVA = "0x1B2C260", Offset = "0x1B2B060", VA = "0x181B2C260")]
get
{
Accuracy accuracy = this.tstInfo.accuracy;
if (accuracy == 0)
{
}
GenTimeAccuracy genTimeAccuracy;
genTimeAccuracy.accuracy = accuracy;
return genTimeAccuracy;
}
}
// Token: 0x170018CB RID: 6347
// (get) Token: 0x06009AE7 RID: 39655 RVA: 0x00201978 File Offset: 0x001FFB78
[Token(Token = "0x170018CB")]
public string Policy
{
[Token(Token = "0x6009AE7")]
[Address(RVA = "0x1B2C3D0", Offset = "0x1B2B1D0", VA = "0x181B2C3D0")]
get
{
return this.tstInfo.tsaPolicyId.identifier;
}
}
// Token: 0x170018CC RID: 6348
// (get) Token: 0x06009AE8 RID: 39656 RVA: 0x0020199C File Offset: 0x001FFB9C
[Token(Token = "0x170018CC")]
public BigInteger SerialNumber
{
[Token(Token = "0x6009AE8")]
[Address(RVA = "0x1B2C400", Offset = "0x1B2B200", VA = "0x181B2C400")]
get
{
return this.tstInfo.serialNumber.Value;
}
}
// Token: 0x170018CD RID: 6349
// (get) Token: 0x06009AE9 RID: 39657 RVA: 0x002019C0 File Offset: 0x001FFBC0
[Token(Token = "0x170018CD")]
public GeneralName Tsa
{
[Token(Token = "0x6009AE9")]
[Address(RVA = "0x47B100", Offset = "0x479F00", VA = "0x18047B100")]
get
{
return this.tstInfo.tsa;
}
}
// Token: 0x170018CE RID: 6350
// (get) Token: 0x06009AEA RID: 39658 RVA: 0x002019E0 File Offset: 0x001FFBE0
[Token(Token = "0x170018CE")]
public BigInteger Nonce
{
[Token(Token = "0x6009AEA")]
[Address(RVA = "0x1B2C390", Offset = "0x1B2B190", VA = "0x181B2C390")]
get
{
DerInteger nonce = this.tstInfo.nonce;
if (nonce == 0)
{
}
return nonce.Value;
}
}
// Token: 0x170018CF RID: 6351
// (get) Token: 0x06009AEB RID: 39659 RVA: 0x00201A0C File Offset: 0x001FFC0C
[Token(Token = "0x170018CF")]
public AlgorithmIdentifier HashAlgorithm
{
[Token(Token = "0x6009AEB")]
[Address(RVA = "0x1B2C2E0", Offset = "0x1B2B0E0", VA = "0x181B2C2E0")]
get
{
return this.tstInfo.messageImprint.hashAlgorithm;
}
}
// Token: 0x170018D0 RID: 6352
// (get) Token: 0x06009AEC RID: 39660 RVA: 0x00201A30 File Offset: 0x001FFC30
[Token(Token = "0x170018D0")]
public string MessageImprintAlgOid
{
[Token(Token = "0x6009AEC")]
[Address(RVA = "0x1B2C340", Offset = "0x1B2B140", VA = "0x181B2C340")]
get
{
Asn1Object asn1Object = this.tstInfo.messageImprint.hashAlgorithm.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x06009AED RID: 39661 RVA: 0x00201A58 File Offset: 0x001FFC58
[Token(Token = "0x6009AED")]
[Address(RVA = "0x1B2C150", Offset = "0x1B2AF50", VA = "0x181B2C150")]
public byte[] GetMessageImprintDigest()
{
return this.tstInfo.messageImprint.hashedMessage;
}
// Token: 0x06009AEE RID: 39662 RVA: 0x00201A7C File Offset: 0x001FFC7C
[Token(Token = "0x6009AEE")]
[Address(RVA = "0x16362F0", Offset = "0x16350F0", VA = "0x1816362F0")]
public byte[] GetEncoded()
{
return this.tstInfo.GetEncoded();
}
// Token: 0x170018D1 RID: 6353
// (get) Token: 0x06009AEF RID: 39663 RVA: 0x00201A9C File Offset: 0x001FFC9C
[Token(Token = "0x170018D1")]
public TstInfo TstInfo
{
[Token(Token = "0x6009AEF")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
get
{
return this.tstInfo;
}
}
// Token: 0x040068D1 RID: 26833
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40068D1")]
private TstInfo tstInfo;
// Token: 0x040068D2 RID: 26834
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40068D2")]
private DateTime genTime;
}
}
@@ -0,0 +1,170 @@
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.GM;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Rosstandart;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
{
// Token: 0x02001965 RID: 6501
[Token(Token = "0x2001965")]
public abstract class TspAlgorithms
{
// Token: 0x06009A84 RID: 39556 RVA: 0x001FFAB4 File Offset: 0x001FDCB4
[Token(Token = "0x6009A84")]
[Address(RVA = "0x1B2D2D0", Offset = "0x1B2C0D0", VA = "0x181B2D2D0")]
static TspAlgorithms()
{
string[] array = new string[13];
string gost = TspAlgorithms.Gost3411;
if (gost != 0)
{
}
array[0] = gost;
string gost3411_2012_ = TspAlgorithms.Gost3411_2012_256;
if (gost3411_2012_ != 0)
{
}
array[1] = gost3411_2012_;
string gost3411_2012_2 = TspAlgorithms.Gost3411_2012_512;
if (gost3411_2012_2 != 0)
{
}
array[2] = gost3411_2012_2;
string md = TspAlgorithms.MD5;
if (md != 0)
{
}
array[3] = md;
string ripeMD = TspAlgorithms.RipeMD128;
if (ripeMD != 0)
{
}
array[4] = ripeMD;
string ripeMD2 = TspAlgorithms.RipeMD160;
if (ripeMD2 != 0)
{
}
array[5] = ripeMD2;
string ripeMD3 = TspAlgorithms.RipeMD256;
if (ripeMD3 != 0)
{
}
array[6] = ripeMD3;
string sha = TspAlgorithms.Sha1;
if (sha != 0)
{
}
array[7] = sha;
string sha2 = TspAlgorithms.Sha224;
if (sha2 != 0)
{
}
array[8] = sha2;
string sha3 = TspAlgorithms.Sha256;
if (sha3 != 0)
{
}
array[9] = sha3;
string sha4 = TspAlgorithms.Sha384;
if (sha4 != 0)
{
}
array[10] = sha4;
string sha5 = TspAlgorithms.Sha512;
if (sha5 != 0)
{
}
array[11] = sha5;
string sm = TspAlgorithms.SM3;
if (sm != 0)
{
}
array[12] = sm;
IList list = Platform.CreateArrayList();
int num = 0;
TspAlgorithms.Allowed = list;
int length = array.Length;
if (num < length)
{
IList allowed = TspAlgorithms.Allowed;
string text = array[num];
num += num;
num++;
num++;
text += text;
num += 2;
num += 19;
}
}
// Token: 0x06009A85 RID: 39557 RVA: 0x001FFCFC File Offset: 0x001FDEFC
[Token(Token = "0x6009A85")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
protected TspAlgorithms()
{
}
// Token: 0x0400689C RID: 26780
[Token(Token = "0x400689C")]
public static readonly string MD5 = PkcsObjectIdentifiers.MD5.identifier;
// Token: 0x0400689D RID: 26781
[Token(Token = "0x400689D")]
public static readonly string Sha1 = OiwObjectIdentifiers.IdSha1.identifier;
// Token: 0x0400689E RID: 26782
[Token(Token = "0x400689E")]
public static readonly string Sha224 = NistObjectIdentifiers.IdSha224.identifier;
// Token: 0x0400689F RID: 26783
[Token(Token = "0x400689F")]
public static readonly string Sha256 = NistObjectIdentifiers.IdSha256.identifier;
// Token: 0x040068A0 RID: 26784
[Token(Token = "0x40068A0")]
public static readonly string Sha384 = NistObjectIdentifiers.IdSha384.identifier;
// Token: 0x040068A1 RID: 26785
[Token(Token = "0x40068A1")]
public static readonly string Sha512 = NistObjectIdentifiers.IdSha512.identifier;
// Token: 0x040068A2 RID: 26786
[Token(Token = "0x40068A2")]
public static readonly string RipeMD128 = TeleTrusTObjectIdentifiers.RipeMD128.identifier;
// Token: 0x040068A3 RID: 26787
[Token(Token = "0x40068A3")]
public static readonly string RipeMD160 = TeleTrusTObjectIdentifiers.RipeMD160.identifier;
// Token: 0x040068A4 RID: 26788
[Token(Token = "0x40068A4")]
public static readonly string RipeMD256 = TeleTrusTObjectIdentifiers.RipeMD256.identifier;
// Token: 0x040068A5 RID: 26789
[Token(Token = "0x40068A5")]
public static readonly string Gost3411 = CryptoProObjectIdentifiers.GostR3411.identifier;
// Token: 0x040068A6 RID: 26790
[Token(Token = "0x40068A6")]
public static readonly string Gost3411_2012_256 = RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256.identifier;
// Token: 0x040068A7 RID: 26791
[Token(Token = "0x40068A7")]
public static readonly string Gost3411_2012_512 = RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512.identifier;
// Token: 0x040068A8 RID: 26792
[Token(Token = "0x40068A8")]
public static readonly string SM3 = GMObjectIdentifiers.sm3.identifier;
// Token: 0x040068A9 RID: 26793
[Token(Token = "0x40068A9")]
public static readonly IList Allowed;
}
}
@@ -0,0 +1,34 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
{
// Token: 0x02001966 RID: 6502
[Token(Token = "0x2001966")]
[Serializable]
public class TspException : Exception
{
// Token: 0x06009A86 RID: 39558 RVA: 0x001FFD10 File Offset: 0x001FDF10
[Token(Token = "0x6009A86")]
[Address(RVA = "0x18E8390", Offset = "0x18E7190", VA = "0x1818E8390")]
public TspException()
{
}
// Token: 0x06009A87 RID: 39559 RVA: 0x001FFD24 File Offset: 0x001FDF24
[Token(Token = "0x6009A87")]
[Address(RVA = "0x18E83F0", Offset = "0x18E71F0", VA = "0x1818E83F0")]
public TspException(string message)
: base(message)
{
}
// Token: 0x06009A88 RID: 39560 RVA: 0x001FFD38 File Offset: 0x001FDF38
[Token(Token = "0x6009A88")]
[Address(RVA = "0x18E8460", Offset = "0x18E7260", VA = "0x1818E8460")]
public TspException(string message, Exception e)
: base(message, e)
{
}
}
}
@@ -0,0 +1,295 @@
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.GM;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Rosstandart;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
{
// Token: 0x02001967 RID: 6503
[Token(Token = "0x2001967")]
public class TspUtil
{
// Token: 0x06009A89 RID: 39561 RVA: 0x001FFD50 File Offset: 0x001FDF50
[Token(Token = "0x6009A89")]
[Address(RVA = "0x18E92B0", Offset = "0x18E80B0", VA = "0x1818E92B0")]
static TspUtil()
{
HashSet hashSet = new HashSet();
Hashtable hashtable = new Hashtable();
hashSet.impl = hashtable;
UnmodifiableSetProxy unmodifiableSetProxy;
unmodifiableSetProxy.s = hashSet;
TspUtil.EmptySet = unmodifiableSetProxy;
ArrayList arrayList = new ArrayList();
UnmodifiableListProxy unmodifiableListProxy;
unmodifiableListProxy.l = arrayList;
TspUtil.EmptyList = unmodifiableListProxy;
TspUtil.digestLengths = new Hashtable();
TspUtil.digestNames = new Hashtable();
IDictionary dictionary = TspUtil.digestLengths;
DerObjectIdentifier md = PkcsObjectIdentifiers.MD5;
IDictionary dictionary2 = TspUtil.digestLengths;
DerObjectIdentifier idSha = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary3 = TspUtil.digestLengths;
DerObjectIdentifier idSha2 = NistObjectIdentifiers.IdSha224;
IDictionary dictionary4 = TspUtil.digestLengths;
DerObjectIdentifier idSha3 = NistObjectIdentifiers.IdSha256;
IDictionary dictionary5 = TspUtil.digestLengths;
DerObjectIdentifier idSha4 = NistObjectIdentifiers.IdSha384;
IDictionary dictionary6 = TspUtil.digestLengths;
DerObjectIdentifier idSha5 = NistObjectIdentifiers.IdSha512;
IDictionary dictionary7 = TspUtil.digestLengths;
DerObjectIdentifier ripeMD = TeleTrusTObjectIdentifiers.RipeMD128;
IDictionary dictionary8 = TspUtil.digestLengths;
DerObjectIdentifier ripeMD2 = TeleTrusTObjectIdentifiers.RipeMD160;
IDictionary dictionary9 = TspUtil.digestLengths;
DerObjectIdentifier ripeMD3 = TeleTrusTObjectIdentifiers.RipeMD256;
IDictionary dictionary10 = TspUtil.digestLengths;
DerObjectIdentifier gostR = CryptoProObjectIdentifiers.GostR3411;
IDictionary dictionary11 = TspUtil.digestLengths;
DerObjectIdentifier id_tc26_gost_3411_12_ = RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256;
IDictionary dictionary12 = TspUtil.digestLengths;
DerObjectIdentifier id_tc26_gost_3411_12_2 = RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512;
IDictionary dictionary13 = TspUtil.digestLengths;
DerObjectIdentifier sm = GMObjectIdentifiers.sm3;
IDictionary dictionary14 = TspUtil.digestNames;
DerObjectIdentifier md2 = PkcsObjectIdentifiers.MD5;
IDictionary dictionary15 = TspUtil.digestNames;
DerObjectIdentifier idSha6 = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary16 = TspUtil.digestNames;
DerObjectIdentifier idSha7 = NistObjectIdentifiers.IdSha224;
IDictionary dictionary17 = TspUtil.digestNames;
DerObjectIdentifier idSha8 = NistObjectIdentifiers.IdSha256;
IDictionary dictionary18 = TspUtil.digestNames;
DerObjectIdentifier idSha9 = NistObjectIdentifiers.IdSha384;
IDictionary dictionary19 = TspUtil.digestNames;
DerObjectIdentifier idSha10 = NistObjectIdentifiers.IdSha512;
IDictionary dictionary20 = TspUtil.digestNames;
DerObjectIdentifier md5WithRsaEncryption = PkcsObjectIdentifiers.MD5WithRsaEncryption;
IDictionary dictionary21 = TspUtil.digestNames;
DerObjectIdentifier sha1WithRsaEncryption = PkcsObjectIdentifiers.Sha1WithRsaEncryption;
IDictionary dictionary22 = TspUtil.digestNames;
DerObjectIdentifier sha224WithRsaEncryption = PkcsObjectIdentifiers.Sha224WithRsaEncryption;
IDictionary dictionary23 = TspUtil.digestNames;
DerObjectIdentifier sha256WithRsaEncryption = PkcsObjectIdentifiers.Sha256WithRsaEncryption;
IDictionary dictionary24 = TspUtil.digestNames;
DerObjectIdentifier sha384WithRsaEncryption = PkcsObjectIdentifiers.Sha384WithRsaEncryption;
IDictionary dictionary25 = TspUtil.digestNames;
DerObjectIdentifier sha512WithRsaEncryption = PkcsObjectIdentifiers.Sha512WithRsaEncryption;
IDictionary dictionary26 = TspUtil.digestNames;
DerObjectIdentifier ripeMD4 = TeleTrusTObjectIdentifiers.RipeMD128;
IDictionary dictionary27 = TspUtil.digestNames;
DerObjectIdentifier ripeMD5 = TeleTrusTObjectIdentifiers.RipeMD160;
IDictionary dictionary28 = TspUtil.digestNames;
DerObjectIdentifier ripeMD6 = TeleTrusTObjectIdentifiers.RipeMD256;
IDictionary dictionary29 = TspUtil.digestNames;
DerObjectIdentifier gostR2 = CryptoProObjectIdentifiers.GostR3411;
IDictionary dictionary30 = TspUtil.digestNames;
DerObjectIdentifier dsaWithSha = OiwObjectIdentifiers.DsaWithSha1;
IDictionary dictionary31 = TspUtil.digestNames;
DerObjectIdentifier sha1WithRsa = OiwObjectIdentifiers.Sha1WithRsa;
IDictionary dictionary32 = TspUtil.digestNames;
DerObjectIdentifier md5WithRsa = OiwObjectIdentifiers.MD5WithRsa;
IDictionary dictionary33 = TspUtil.digestNames;
DerObjectIdentifier id_tc26_gost_3411_12_3 = RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256;
IDictionary dictionary34 = TspUtil.digestNames;
DerObjectIdentifier id_tc26_gost_3411_12_4 = RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512;
IDictionary dictionary35 = TspUtil.digestNames;
DerObjectIdentifier sm2 = GMObjectIdentifiers.sm3;
}
// Token: 0x06009A8A RID: 39562 RVA: 0x001FFF98 File Offset: 0x001FE198
[Token(Token = "0x6009A8A")]
[Address(RVA = "0x18E8A20", Offset = "0x18E7820", VA = "0x1818E8A20")]
public static ICollection GetSignatureTimestamps(SignerInformation signerInfo)
{
byte[] array;
do
{
ArrayList arrayList = new ArrayList();
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributes = signerInfo.UnsignedAttributes;
if (unsignedAttributes == 0)
{
break;
}
DerObjectIdentifier idAASignatureTimeStampToken = PkcsObjectIdentifiers.IdAASignatureTimeStampToken;
IEnumerator enumerator = unsignedAttributes.GetAll(idAASignatureTimeStampToken).GetEnumerator();
if (enumerator != 0)
{
if (enumerator == 0 || enumerator == 0)
{
goto IL_EF;
}
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.ContentInfo contentInfo;
TimeStampTokenInfo tstInfo = new TimeStampToken(contentInfo).tstInfo;
byte[] array2;
array = DigestUtilities.CalculateDigest(TspUtil.GetDigestAlgName(tstInfo.MessageImprintAlgOid), array2);
byte[] messageImprintDigest = tstInfo.GetMessageImprintDigest();
if (!Arrays.ConstantTimeAreEqual(array, messageImprintDigest))
{
goto IL_A7;
}
if ((uint)(-1) != 0U)
{
}
if (array != 0)
{
goto IL_E9;
}
while ((ulong)((uint)(-1)) == (ulong)(-1L))
{
}
}
if ((uint)(-1) != 0U)
{
}
}
while (array != 0);
throw new NullReferenceException();
IL_A7:
TspValidationException ex = new TspValidationException("Incorrect digest in message imprint");
throw new NullReferenceException();
IL_E9:
throw new NullReferenceException();
IL_EF:
throw new NullReferenceException();
}
// Token: 0x06009A8B RID: 39563 RVA: 0x002000A0 File Offset: 0x001FE2A0
[Token(Token = "0x6009A8B")]
[Address(RVA = "0x18E8FD0", Offset = "0x18E7DD0", VA = "0x1818E8FD0")]
public static void ValidateCertificate(X509Certificate cert)
{
/*
An exception occurred when decompiling this method (06009A8B)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TspUtil::ValidateCertificate(BestHTTP.SecureProtocol.Org.BouncyCastle.X509.X509Certificate)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_57:
stloc:TspValidationException(var_6_61, newobj:TspValidationException(TspValidationException::.ctor, ldstr:string("Certificate must have an ExtendedKeyUsage extension marked as critical.")))
}
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.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
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: 0x06009A8C RID: 39564 RVA: 0x00200110 File Offset: 0x001FE310
[Token(Token = "0x6009A8C")]
[Address(RVA = "0x18E8640", Offset = "0x18E7440", VA = "0x1818E8640")]
internal static string GetDigestAlgName(string digestAlgOID)
{
IDictionary dictionary = TspUtil.digestNames;
return digestAlgOID;
}
// Token: 0x06009A8D RID: 39565 RVA: 0x0020012C File Offset: 0x001FE32C
[Token(Token = "0x6009A8D")]
[Address(RVA = "0x18E86F0", Offset = "0x18E74F0", VA = "0x1818E86F0")]
internal static int GetDigestLength(string digestAlgOID)
{
IDictionary dictionary = TspUtil.digestLengths;
IDictionary dictionary2 = TspUtil.digestLengths;
ISet emptySet = TspUtil.EmptySet;
throw new NullReferenceException();
}
// Token: 0x06009A8E RID: 39566 RVA: 0x00200160 File Offset: 0x001FE360
[Token(Token = "0x6009A8E")]
[Address(RVA = "0x18E84E0", Offset = "0x18E72E0", VA = "0x1818E84E0")]
internal static IDigest CreateDigestInstance(string digestAlgOID)
{
return DigestUtilities.GetDigest(TspUtil.GetDigestAlgName(digestAlgOID));
}
// Token: 0x06009A8F RID: 39567 RVA: 0x00200178 File Offset: 0x001FE378
[Token(Token = "0x6009A8F")]
[Address(RVA = "0x18E8560", Offset = "0x18E7360", VA = "0x1818E8560")]
internal static ISet GetCriticalExtensionOids(X509Extensions extensions)
{
if (extensions != 0)
{
HashSet hashSet = new HashSet(extensions.GetCriticalExtensionOids());
UnmodifiableSetProxy unmodifiableSetProxy;
unmodifiableSetProxy.s = hashSet;
}
return TspUtil.EmptySet;
}
// Token: 0x06009A90 RID: 39568 RVA: 0x002001A4 File Offset: 0x001FE3A4
[Token(Token = "0x6009A90")]
[Address(RVA = "0x18E8940", Offset = "0x18E7740", VA = "0x1818E8940")]
internal static ISet GetNonCriticalExtensionOids(X509Extensions extensions)
{
if (extensions != 0)
{
HashSet hashSet = new HashSet(extensions.GetNonCriticalExtensionOids());
UnmodifiableSetProxy unmodifiableSetProxy;
unmodifiableSetProxy.s = hashSet;
}
return TspUtil.EmptySet;
}
// Token: 0x06009A91 RID: 39569 RVA: 0x002001D0 File Offset: 0x001FE3D0
[Token(Token = "0x6009A91")]
[Address(RVA = "0x18E8820", Offset = "0x18E7620", VA = "0x1818E8820")]
internal static IList GetExtensionOids(X509Extensions extensions)
{
if (extensions != 0)
{
ArrayList arrayList = new ArrayList(extensions.GetExtensionOids());
UnmodifiableListProxy unmodifiableListProxy;
unmodifiableListProxy.l = arrayList;
}
return TspUtil.EmptyList;
}
// Token: 0x06009A92 RID: 39570 RVA: 0x002001FC File Offset: 0x001FE3FC
[Token(Token = "0x6009A92")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public TspUtil()
{
}
// Token: 0x040068AA RID: 26794
[Token(Token = "0x40068AA")]
private static ISet EmptySet;
// Token: 0x040068AB RID: 26795
[Token(Token = "0x40068AB")]
private static IList EmptyList;
// Token: 0x040068AC RID: 26796
[Token(Token = "0x40068AC")]
private static readonly IDictionary digestLengths;
// Token: 0x040068AD RID: 26797
[Token(Token = "0x40068AD")]
private static readonly IDictionary digestNames;
}
}
@@ -0,0 +1,47 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
{
// Token: 0x02001968 RID: 6504
[Token(Token = "0x2001968")]
[Serializable]
public class TspValidationException : TspException
{
// Token: 0x06009A93 RID: 39571 RVA: 0x00200210 File Offset: 0x001FE410
[Token(Token = "0x6009A93")]
[Address(RVA = "0x18EA350", Offset = "0x18E9150", VA = "0x1818EA350")]
public TspValidationException(string message)
: base(message)
{
this.failureCode = (int)((ulong)4294967295L);
}
// Token: 0x06009A94 RID: 39572 RVA: 0x00200234 File Offset: 0x001FE434
[Token(Token = "0x6009A94")]
[Address(RVA = "0x18EA2D0", Offset = "0x18E90D0", VA = "0x1818EA2D0")]
public TspValidationException(string message, int failureCode)
: base(message)
{
this.failureCode = failureCode;
}
// Token: 0x170018B8 RID: 6328
// (get) Token: 0x06009A95 RID: 39573 RVA: 0x00200250 File Offset: 0x001FE450
[Token(Token = "0x170018B8")]
public int FailureCode
{
[Token(Token = "0x6009A95")]
[Address(RVA = "0x404240", Offset = "0x403040", VA = "0x180404240")]
get
{
return this.failureCode;
}
}
// Token: 0x040068AE RID: 26798
[FieldOffset(Offset = "0x88")]
[Token(Token = "0x40068AE")]
private int failureCode;
}
}