using System; using System.Collections; using System.Runtime.InteropServices; using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; 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.TeleTrust; using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; 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 Cpp2IlInjected; namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 { // Token: 0x0200132E RID: 4910 [Token(Token = "0x200132E")] [StructLayout(3)] internal class X509Utilities { // Token: 0x06007B41 RID: 31553 RVA: 0x0019A6F0 File Offset: 0x001988F0 [Token(Token = "0x6007B41")] [Address(RVA = "0x538C50", Offset = "0x537650", VA = "0x180538C50")] static X509Utilities() { IDictionary dictionary = Platform.CreateHashtable(); X509Utilities.algorithms = dictionary; X509Utilities.exParams = Platform.CreateHashtable(); X509Utilities.noParams = new HashSet(); IDictionary dictionary2 = X509Utilities.algorithms; DerObjectIdentifier md2WithRsaEncryption = PkcsObjectIdentifiers.MD2WithRsaEncryption; IDictionary dictionary3 = X509Utilities.algorithms; DerObjectIdentifier md2WithRsaEncryption2 = PkcsObjectIdentifiers.MD2WithRsaEncryption; IDictionary dictionary4 = X509Utilities.algorithms; DerObjectIdentifier md5WithRsaEncryption = PkcsObjectIdentifiers.MD5WithRsaEncryption; IDictionary dictionary5 = X509Utilities.algorithms; DerObjectIdentifier md5WithRsaEncryption2 = PkcsObjectIdentifiers.MD5WithRsaEncryption; IDictionary dictionary6 = X509Utilities.algorithms; DerObjectIdentifier sha1WithRsaEncryption = PkcsObjectIdentifiers.Sha1WithRsaEncryption; IDictionary dictionary7 = X509Utilities.algorithms; DerObjectIdentifier sha1WithRsaEncryption2 = PkcsObjectIdentifiers.Sha1WithRsaEncryption; IDictionary dictionary8 = X509Utilities.algorithms; DerObjectIdentifier sha224WithRsaEncryption = PkcsObjectIdentifiers.Sha224WithRsaEncryption; IDictionary dictionary9 = X509Utilities.algorithms; DerObjectIdentifier sha224WithRsaEncryption2 = PkcsObjectIdentifiers.Sha224WithRsaEncryption; IDictionary dictionary10 = X509Utilities.algorithms; DerObjectIdentifier sha256WithRsaEncryption = PkcsObjectIdentifiers.Sha256WithRsaEncryption; IDictionary dictionary11 = X509Utilities.algorithms; DerObjectIdentifier sha256WithRsaEncryption2 = PkcsObjectIdentifiers.Sha256WithRsaEncryption; IDictionary dictionary12 = X509Utilities.algorithms; DerObjectIdentifier sha384WithRsaEncryption = PkcsObjectIdentifiers.Sha384WithRsaEncryption; IDictionary dictionary13 = X509Utilities.algorithms; DerObjectIdentifier sha384WithRsaEncryption2 = PkcsObjectIdentifiers.Sha384WithRsaEncryption; IDictionary dictionary14 = X509Utilities.algorithms; DerObjectIdentifier sha512WithRsaEncryption = PkcsObjectIdentifiers.Sha512WithRsaEncryption; IDictionary dictionary15 = X509Utilities.algorithms; DerObjectIdentifier sha512WithRsaEncryption2 = PkcsObjectIdentifiers.Sha512WithRsaEncryption; IDictionary dictionary16 = X509Utilities.algorithms; DerObjectIdentifier idRsassaPss = PkcsObjectIdentifiers.IdRsassaPss; IDictionary dictionary17 = X509Utilities.algorithms; DerObjectIdentifier idRsassaPss2 = PkcsObjectIdentifiers.IdRsassaPss; IDictionary dictionary18 = X509Utilities.algorithms; DerObjectIdentifier idRsassaPss3 = PkcsObjectIdentifiers.IdRsassaPss; IDictionary dictionary19 = X509Utilities.algorithms; DerObjectIdentifier idRsassaPss4 = PkcsObjectIdentifiers.IdRsassaPss; IDictionary dictionary20 = X509Utilities.algorithms; DerObjectIdentifier idRsassaPss5 = PkcsObjectIdentifiers.IdRsassaPss; IDictionary dictionary21 = X509Utilities.algorithms; DerObjectIdentifier rsaSignatureWithRipeMD = TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD160; IDictionary dictionary22 = X509Utilities.algorithms; DerObjectIdentifier rsaSignatureWithRipeMD2 = TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD160; IDictionary dictionary23 = X509Utilities.algorithms; DerObjectIdentifier rsaSignatureWithRipeMD3 = TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD128; IDictionary dictionary24 = X509Utilities.algorithms; DerObjectIdentifier rsaSignatureWithRipeMD4 = TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD128; IDictionary dictionary25 = X509Utilities.algorithms; DerObjectIdentifier rsaSignatureWithRipeMD5 = TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD256; IDictionary dictionary26 = X509Utilities.algorithms; DerObjectIdentifier rsaSignatureWithRipeMD6 = TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD256; IDictionary dictionary27 = X509Utilities.algorithms; DerObjectIdentifier idDsaWithSha = X9ObjectIdentifiers.IdDsaWithSha1; IDictionary dictionary28 = X509Utilities.algorithms; DerObjectIdentifier idDsaWithSha2 = X9ObjectIdentifiers.IdDsaWithSha1; IDictionary dictionary29 = X509Utilities.algorithms; DerObjectIdentifier dsaWithSha = NistObjectIdentifiers.DsaWithSha224; IDictionary dictionary30 = X509Utilities.algorithms; DerObjectIdentifier dsaWithSha2 = NistObjectIdentifiers.DsaWithSha256; IDictionary dictionary31 = X509Utilities.algorithms; DerObjectIdentifier dsaWithSha3 = NistObjectIdentifiers.DsaWithSha384; IDictionary dictionary32 = X509Utilities.algorithms; DerObjectIdentifier dsaWithSha4 = NistObjectIdentifiers.DsaWithSha512; IDictionary dictionary33 = X509Utilities.algorithms; DerObjectIdentifier ecdsaWithSha = X9ObjectIdentifiers.ECDsaWithSha1; IDictionary dictionary34 = X509Utilities.algorithms; DerObjectIdentifier ecdsaWithSha2 = X9ObjectIdentifiers.ECDsaWithSha1; IDictionary dictionary35 = X509Utilities.algorithms; DerObjectIdentifier ecdsaWithSha3 = X9ObjectIdentifiers.ECDsaWithSha224; IDictionary dictionary36 = X509Utilities.algorithms; DerObjectIdentifier ecdsaWithSha4 = X9ObjectIdentifiers.ECDsaWithSha256; IDictionary dictionary37 = X509Utilities.algorithms; DerObjectIdentifier ecdsaWithSha5 = X9ObjectIdentifiers.ECDsaWithSha384; IDictionary dictionary38 = X509Utilities.algorithms; DerObjectIdentifier ecdsaWithSha6 = X9ObjectIdentifiers.ECDsaWithSha512; IDictionary dictionary39 = X509Utilities.algorithms; DerObjectIdentifier gostR3411x94WithGostR3410x = CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94; IDictionary dictionary40 = X509Utilities.algorithms; DerObjectIdentifier gostR3411x94WithGostR3410x2 = CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94; IDictionary dictionary41 = X509Utilities.algorithms; DerObjectIdentifier gostR3411x94WithGostR3410x3 = CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001; IDictionary dictionary42 = X509Utilities.algorithms; DerObjectIdentifier gostR3411x94WithGostR3410x4 = CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001; IDictionary dictionary43 = X509Utilities.algorithms; DerObjectIdentifier gostR3411x94WithGostR3410x5 = CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001; ISet set = X509Utilities.noParams; ISet set2 = X509Utilities.noParams; ISet set3 = X509Utilities.noParams; ISet set4 = X509Utilities.noParams; ISet set5 = X509Utilities.noParams; ISet set6 = X509Utilities.noParams; ISet set7 = X509Utilities.noParams; ISet set8 = X509Utilities.noParams; ISet set9 = X509Utilities.noParams; ISet set10 = X509Utilities.noParams; ISet set11 = X509Utilities.noParams; ISet set12 = X509Utilities.noParams; DerObjectIdentifier idSha = OiwObjectIdentifiers.IdSha1; DerNull instance = DerNull.Instance; AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(idSha, instance); IDictionary dictionary44 = X509Utilities.exParams; RsassaPssParameters rsassaPssParameters = X509Utilities.CreatePssParams(algorithmIdentifier, 20); DerObjectIdentifier idSha2 = NistObjectIdentifiers.IdSha224; DerNull instance2 = DerNull.Instance; AlgorithmIdentifier algorithmIdentifier2 = new AlgorithmIdentifier(idSha2, instance2); IDictionary dictionary45 = X509Utilities.exParams; RsassaPssParameters rsassaPssParameters2 = X509Utilities.CreatePssParams(algorithmIdentifier2, 28); DerObjectIdentifier idSha3 = NistObjectIdentifiers.IdSha256; DerNull instance3 = DerNull.Instance; AlgorithmIdentifier algorithmIdentifier3 = new AlgorithmIdentifier(idSha3, instance3); IDictionary dictionary46 = X509Utilities.exParams; RsassaPssParameters rsassaPssParameters3 = X509Utilities.CreatePssParams(algorithmIdentifier3, 32); DerObjectIdentifier idSha4 = NistObjectIdentifiers.IdSha384; DerNull instance4 = DerNull.Instance; AlgorithmIdentifier algorithmIdentifier4 = new AlgorithmIdentifier(idSha4, instance4); IDictionary dictionary47 = X509Utilities.exParams; RsassaPssParameters rsassaPssParameters4 = X509Utilities.CreatePssParams(algorithmIdentifier4, 48); DerObjectIdentifier idSha5 = NistObjectIdentifiers.IdSha512; DerNull instance5 = DerNull.Instance; AlgorithmIdentifier algorithmIdentifier5 = new AlgorithmIdentifier(idSha5, instance5); IDictionary dictionary48 = X509Utilities.exParams; RsassaPssParameters rsassaPssParameters5 = X509Utilities.CreatePssParams(algorithmIdentifier5, 64); } // Token: 0x06007B42 RID: 31554 RVA: 0x0019AAA0 File Offset: 0x00198CA0 [Token(Token = "0x6007B42")] [Address(RVA = "0x5384C0", Offset = "0x536EC0", VA = "0x1805384C0")] private static RsassaPssParameters CreatePssParams(AlgorithmIdentifier hashAlgId, int saltSize) { AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(PkcsObjectIdentifiers.IdMgf1, hashAlgId); DerInteger derInteger = new DerInteger(saltSize); DerInteger derInteger2 = new DerInteger(1); return new RsassaPssParameters(hashAlgId, algorithmIdentifier, derInteger, derInteger2); } // Token: 0x06007B43 RID: 31555 RVA: 0x0019AAD0 File Offset: 0x00198CD0 [Token(Token = "0x6007B43")] [Address(RVA = "0x538690", Offset = "0x537090", VA = "0x180538690")] internal static DerObjectIdentifier GetAlgorithmOid(string algorithmName) { string text = Platform.ToUpperInvariant(algorithmName); IDictionary dictionary = X509Utilities.algorithms; if (text == 0) { return new DerObjectIdentifier(text); } IDictionary dictionary2 = X509Utilities.algorithms; IDictionary dictionary3 = X509Utilities.algorithms; throw new NullReferenceException(); } // Token: 0x06007B44 RID: 31556 RVA: 0x0019AB0C File Offset: 0x00198D0C [Token(Token = "0x6007B44")] [Address(RVA = "0x538810", Offset = "0x537210", VA = "0x180538810")] internal static AlgorithmIdentifier GetSigAlgID(DerObjectIdentifier sigOid, string algorithmName) { ISet set = X509Utilities.noParams; string text = Platform.ToUpperInvariant(algorithmName); IDictionary dictionary = X509Utilities.exParams; if (text == 0) { DerNull instance = DerNull.Instance; return new AlgorithmIdentifier(sigOid, instance); } IDictionary dictionary2 = X509Utilities.exParams; AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(sigOid); IDictionary dictionary3 = X509Utilities.algorithms; return new AlgorithmIdentifier(sigOid); } // Token: 0x06007B45 RID: 31557 RVA: 0x0019AB64 File Offset: 0x00198D64 [Token(Token = "0x6007B45")] [Address(RVA = "0x5385E0", Offset = "0x536FE0", VA = "0x1805385E0")] internal static IEnumerable GetAlgNames() { IDictionary dictionary = X509Utilities.algorithms; throw new NullReferenceException(); } // Token: 0x06007B46 RID: 31558 RVA: 0x0019AB7C File Offset: 0x00198D7C [Token(Token = "0x6007B46")] [Address(RVA = "0x538A80", Offset = "0x537480", VA = "0x180538A80")] internal static byte[] GetSignatureForObject(DerObjectIdentifier sigOid, string sigName, AsymmetricKeyParameter privateKey, SecureRandom random, Asn1Encodable ae) { /* An exception occurred when decompiling this method (06007B46) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.X509.X509Utilities::GetSignatureForObject(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.DerObjectIdentifier,System.String,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter,BestHTTP.SecureProtocol.Org.BouncyCastle.Security.SecureRandom,BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Asn1Encodable) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_2E: stloc:ArgumentNullException(var_4_38, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("sigOid"))) } 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: 0x06007B47 RID: 31559 RVA: 0x0019ABC4 File Offset: 0x00198DC4 [Token(Token = "0x6007B47")] [Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")] public X509Utilities() { } // Token: 0x04005862 RID: 22626 [Token(Token = "0x4005862")] private static readonly IDictionary algorithms; // Token: 0x04005863 RID: 22627 [Token(Token = "0x4005863")] private static readonly IDictionary exParams; // Token: 0x04005864 RID: 22628 [Token(Token = "0x4005864")] private static readonly ISet noParams; } }