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

386 lines
15 KiB
C#

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.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D44 RID: 7492
[Token(Token = "0x2001D44")]
public class CmsSignedData
{
// Token: 0x0600BD8F RID: 48527 RVA: 0x002B1DE0 File Offset: 0x002AFFE0
[Token(Token = "0x600BD8F")]
[Address(RVA = "0x166D940", Offset = "0x166C740", VA = "0x18166D940")]
private CmsSignedData(CmsSignedData c)
{
SignedData signedData = c.signedData;
this.signedData = signedData;
ContentInfo contentInfo = c.contentInfo;
this.contentInfo = contentInfo;
CmsProcessable cmsProcessable = c.signedContent;
this.signedContent = cmsProcessable;
SignerInformationStore signerInformationStore = c.signerInfoStore;
this.signerInfoStore = signerInformationStore;
}
// Token: 0x0600BD90 RID: 48528 RVA: 0x002B1E34 File Offset: 0x002B0034
[Token(Token = "0x600BD90")]
[Address(RVA = "0x166D990", Offset = "0x166C790", VA = "0x18166D990")]
public CmsSignedData(byte[] sigBlock)
{
int num;
MemoryStream memoryStream = new MemoryStream(sigBlock, num != 0);
num = 0;
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(memoryStream);
}
// Token: 0x0600BD91 RID: 48529 RVA: 0x002B1E54 File Offset: 0x002B0054
[Token(Token = "0x600BD91")]
[Address(RVA = "0x166D810", Offset = "0x166C610", VA = "0x18166D810")]
public CmsSignedData(CmsProcessable signedContent, byte[] sigBlock)
{
int num;
MemoryStream memoryStream = new MemoryStream(sigBlock, num != 0);
num = 0;
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(memoryStream);
}
// Token: 0x0600BD92 RID: 48530 RVA: 0x002B1E74 File Offset: 0x002B0074
[Token(Token = "0x600BD92")]
[Address(RVA = "0x166D8A0", Offset = "0x166C6A0", VA = "0x18166D8A0")]
public CmsSignedData(IDictionary hashes, byte[] sigBlock)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(sigBlock);
base..ctor();
this.hashes = hashes;
this.contentInfo = contentInfo;
SignedData instance = SignedData.GetInstance(contentInfo.content);
this.signedData = instance;
}
// Token: 0x0600BD93 RID: 48531 RVA: 0x002B1EB8 File Offset: 0x002B00B8
[Token(Token = "0x600BD93")]
[Address(RVA = "0x166D680", Offset = "0x166C480", VA = "0x18166D680")]
public CmsSignedData(CmsProcessable signedContent, Stream sigData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(sigData);
}
// Token: 0x0600BD94 RID: 48532 RVA: 0x002B1ECC File Offset: 0x002B00CC
[Token(Token = "0x600BD94")]
[Address(RVA = "0x166D6C0", Offset = "0x166C4C0", VA = "0x18166D6C0")]
public CmsSignedData(Stream sigData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(sigData);
}
// Token: 0x0600BD95 RID: 48533 RVA: 0x002B1EE0 File Offset: 0x002B00E0
[Token(Token = "0x600BD95")]
[Address(RVA = "0x166D6F0", Offset = "0x166C4F0", VA = "0x18166D6F0")]
public CmsSignedData(CmsProcessable signedContent, ContentInfo sigData)
{
this.signedContent = signedContent;
this.contentInfo = sigData;
SignedData instance = SignedData.GetInstance(sigData.content);
this.signedData = instance;
}
// Token: 0x0600BD96 RID: 48534 RVA: 0x002B1F1C File Offset: 0x002B011C
[Token(Token = "0x600BD96")]
[Address(RVA = "0x166D780", Offset = "0x166C580", VA = "0x18166D780")]
public CmsSignedData(IDictionary hashes, ContentInfo sigData)
{
this.hashes = hashes;
this.contentInfo = sigData;
SignedData instance = SignedData.GetInstance(sigData.content);
this.signedData = instance;
}
// Token: 0x0600BD97 RID: 48535 RVA: 0x002B1F58 File Offset: 0x002B0158
[Token(Token = "0x600BD97")]
[Address(RVA = "0x166DA10", Offset = "0x166C810", VA = "0x18166DA10")]
public CmsSignedData(ContentInfo sigData)
{
Asn1Encodable content;
do
{
base..ctor();
this.contentInfo = sigData;
SignedData instance = SignedData.GetInstance(sigData.content);
this.signedData = instance;
content = instance.contentInfo.content;
if (content == 0)
{
return;
}
}
while (content == 0 || content == 0);
CmsProcessableByteArray cmsProcessableByteArray;
this.signedContent = cmsProcessableByteArray;
}
// Token: 0x17001D61 RID: 7521
// (get) Token: 0x0600BD98 RID: 48536 RVA: 0x002B1FB0 File Offset: 0x002B01B0
[Token(Token = "0x17001D61")]
public int Version
{
[Token(Token = "0x600BD98")]
[Address(RVA = "0x166DBE0", Offset = "0x166C9E0", VA = "0x18166DBE0")]
get
{
return this.signedData.version.Value.IntValue;
}
}
// Token: 0x0600BD99 RID: 48537 RVA: 0x002B1FD8 File Offset: 0x002B01D8
[Token(Token = "0x600BD99")]
[Address(RVA = "0x166C8B0", Offset = "0x166B6B0", VA = "0x18166C8B0")]
public SignerInformationStore GetSignerInfos()
{
SignerInformationStore signerInformationStore;
IList list;
int num5;
do
{
int num = 0;
signerInformationStore = this.signerInfoStore;
if (signerInformationStore != 0)
{
return signerInformationStore;
}
list = Platform.CreateArrayList();
IEnumerator enumerator = this.signedData.signerInfos.GetEnumerator();
int num4;
if (enumerator != 0)
{
if (num < enumerator)
{
num += num;
num++;
}
DerObjectIdentifier contentType = this.signedData.contentInfo.contentType;
SignerInfo signerInfo;
if (this.hashes != 0)
{
Asn1Object asn1Object = signerInfo.digAlgorithm.ToAsn1Object();
BaseDigestCalculator baseDigestCalculator;
baseDigestCalculator.digest = asn1Object;
int num2;
SignerInformation signerInformation = new SignerInformation(signerInfo, contentType, num2, baseDigestCalculator);
int num3 = 0;
num2 = 0;
num3++;
num3 += 19;
}
CmsProcessable cmsProcessable = this.signedContent;
SignerInformation signerInformation2 = new SignerInformation(signerInfo, contentType, cmsProcessable, num4);
num4 = 0;
num5 = 0;
}
if (num4 != 0)
{
}
}
while (num5 != 0);
SignerInformationStore signerInformationStore2 = new SignerInformationStore(list);
this.signerInfoStore = signerInformationStore2;
return signerInformationStore;
}
// Token: 0x0600BD9A RID: 48538 RVA: 0x002B20F0 File Offset: 0x002B02F0
[Token(Token = "0x600BD9A")]
[Address(RVA = "0x166C6B0", Offset = "0x166B4B0", VA = "0x18166C6B0")]
public IX509Store GetAttributeCertificates(string type)
{
IX509Store ix509Store = this.attrCertStore;
if (ix509Store == 0)
{
CmsSignedHelper helper = CmsSignedData.Helper;
Asn1Set certificates = this.signedData.certificates;
IX509Store ix509Store2 = helper.CreateAttributeStore(type, certificates);
this.attrCertStore = ix509Store2;
}
return ix509Store;
}
// Token: 0x0600BD9B RID: 48539 RVA: 0x002B2134 File Offset: 0x002B0334
[Token(Token = "0x600BD9B")]
[Address(RVA = "0x166C750", Offset = "0x166B550", VA = "0x18166C750")]
public IX509Store GetCertificates(string type)
{
IX509Store ix509Store = this.certificateStore;
if (ix509Store == 0)
{
CmsSignedHelper helper = CmsSignedData.Helper;
Asn1Set certificates = this.signedData.certificates;
IX509Store ix509Store2 = helper.CreateCertificateStore(type, certificates);
this.certificateStore = ix509Store2;
}
return ix509Store;
}
// Token: 0x0600BD9C RID: 48540 RVA: 0x002B2178 File Offset: 0x002B0378
[Token(Token = "0x600BD9C")]
[Address(RVA = "0x166C7F0", Offset = "0x166B5F0", VA = "0x18166C7F0")]
public IX509Store GetCrls(string type)
{
IX509Store ix509Store = this.crlStore;
if (ix509Store == 0)
{
CmsSignedHelper helper = CmsSignedData.Helper;
Asn1Set crls = this.signedData.crls;
IX509Store ix509Store2 = helper.CreateCrlStore(type, crls);
this.crlStore = ix509Store2;
}
return ix509Store;
}
// Token: 0x17001D62 RID: 7522
// (get) Token: 0x0600BD9D RID: 48541 RVA: 0x002B21BC File Offset: 0x002B03BC
[Token(Token = "0x17001D62")]
[Obsolete]
public string SignedContentTypeOid
{
[Token(Token = "0x600BD9D")]
[Address(RVA = "0x166DB80", Offset = "0x166C980", VA = "0x18166DB80")]
get
{
return this.signedData.contentInfo.contentType.identifier;
}
}
// Token: 0x17001D63 RID: 7523
// (get) Token: 0x0600BD9E RID: 48542 RVA: 0x002B21E4 File Offset: 0x002B03E4
[Token(Token = "0x17001D63")]
public DerObjectIdentifier SignedContentType
{
[Token(Token = "0x600BD9E")]
[Address(RVA = "0x166DBB0", Offset = "0x166C9B0", VA = "0x18166DBB0")]
get
{
return this.signedData.contentInfo.contentType;
}
}
// Token: 0x17001D64 RID: 7524
// (get) Token: 0x0600BD9F RID: 48543 RVA: 0x002B2208 File Offset: 0x002B0408
[Token(Token = "0x17001D64")]
public CmsProcessable SignedContent
{
[Token(Token = "0x600BD9F")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
get
{
return this.signedContent;
}
}
// Token: 0x17001D65 RID: 7525
// (get) Token: 0x0600BDA0 RID: 48544 RVA: 0x002B221C File Offset: 0x002B041C
[Token(Token = "0x17001D65")]
public ContentInfo ContentInfo
{
[Token(Token = "0x600BDA0")]
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
get
{
return this.contentInfo;
}
}
// Token: 0x0600BDA1 RID: 48545 RVA: 0x002B2230 File Offset: 0x002B0430
[Token(Token = "0x600BDA1")]
[Address(RVA = "0x166C890", Offset = "0x166B690", VA = "0x18166C890")]
public byte[] GetEncoded()
{
return this.contentInfo.GetEncoded();
}
// Token: 0x0600BDA2 RID: 48546 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600BDA2")]
[Address(RVA = "0x166CEC0", Offset = "0x166BCC0", VA = "0x18166CEC0")]
public static CmsSignedData ReplaceSigners(CmsSignedData signedData, SignerInformationStore signerInformationStore)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600BDA3 RID: 48547 RVA: 0x002B2250 File Offset: 0x002B0450
[Token(Token = "0x600BDA3")]
[Address(RVA = "0x166CC30", Offset = "0x166BA30", VA = "0x18166CC30")]
public static CmsSignedData ReplaceCertificatesAndCrls(CmsSignedData signedData, IX509Store x509Certs, IX509Store x509Crls, IX509Store x509AttrCerts)
{
/*
An exception occurred when decompiling this method (0600BDA3)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedData BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedData::ReplaceCertificatesAndCrls(BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedData,BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store.IX509Store,BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store.IX509Store,BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store.IX509Store)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_B5:
stloc:Exception(var_16_BF, call:Exception(Platform::CreateNotImplementedException, ldstr:string("Currently can't replace attribute certificates")))
}
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: 0x040078B3 RID: 30899
[Token(Token = "0x40078B3")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x040078B4 RID: 30900
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40078B4")]
private readonly CmsProcessable signedContent;
// Token: 0x040078B5 RID: 30901
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40078B5")]
private SignedData signedData;
// Token: 0x040078B6 RID: 30902
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40078B6")]
private ContentInfo contentInfo;
// Token: 0x040078B7 RID: 30903
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40078B7")]
private SignerInformationStore signerInfoStore;
// Token: 0x040078B8 RID: 30904
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40078B8")]
private IX509Store attrCertStore;
// Token: 0x040078B9 RID: 30905
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40078B9")]
private IX509Store certificateStore;
// Token: 0x040078BA RID: 30906
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40078BA")]
private IX509Store crlStore;
// Token: 0x040078BB RID: 30907
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x40078BB")]
private IDictionary hashes;
}
}