Files
27Aug2021-Cpp2IL-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Cms/SignerInfoGeneratorBuilder.cs
T
niko c12fbe3fc6 m
2026-04-12 16:51:38 +02:00

119 lines
6.7 KiB
C#

using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001E4B RID: 7755
[Token(Token = "0x2001E4B")]
public class SignerInfoGeneratorBuilder
{
// Token: 0x0600C273 RID: 49779 RVA: 0x002BF77C File Offset: 0x002BD97C
[Token(Token = "0x600C273")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public SignerInfoGeneratorBuilder()
{
}
// Token: 0x0600C274 RID: 49780 RVA: 0x002BF790 File Offset: 0x002BD990
[Token(Token = "0x600C274")]
[Address(RVA = "0x29350A0", Offset = "0x29340A0", VA = "0x1829350A0")]
public SignerInfoGeneratorBuilder SetDirectSignature(bool hasNoSignedAttributes)
{
this.directSignature = hasNoSignedAttributes;
return this;
}
// Token: 0x0600C275 RID: 49781 RVA: 0x002BF7A8 File Offset: 0x002BD9A8
[Token(Token = "0x600C275")]
[Address(RVA = "0x493840", Offset = "0x492840", VA = "0x180493840")]
public SignerInfoGeneratorBuilder WithSignedAttributeGenerator(CmsAttributeTableGenerator signedGen)
{
this.signedGen = signedGen;
return this;
}
// Token: 0x0600C276 RID: 49782 RVA: 0x002BF7C0 File Offset: 0x002BD9C0
[Token(Token = "0x600C276")]
[Address(RVA = "0x493850", Offset = "0x492850", VA = "0x180493850")]
public SignerInfoGeneratorBuilder WithUnsignedAttributeGenerator(CmsAttributeTableGenerator unsignedGen)
{
this.unsignedGen = unsignedGen;
return this;
}
// Token: 0x0600C277 RID: 49783 RVA: 0x002BF7D8 File Offset: 0x002BD9D8
[Token(Token = "0x600C277")]
[Address(RVA = "0x2934DA0", Offset = "0x2933DA0", VA = "0x182934DA0")]
public SignerInfoGenerator Build(ISignatureFactory contentSigner, X509Certificate certificate)
{
BigInteger serialNumber = certificate.SerialNumber;
int version = certificate.Version;
IssuerAndSerialNumber issuerAndSerialNumber;
SignerIdentifier signerIdentifier = new SignerIdentifier(issuerAndSerialNumber);
SignerInfoGenerator signerInfoGenerator = this.CreateGenerator(contentSigner, signerIdentifier);
signerInfoGenerator.certificate = certificate;
return signerInfoGenerator;
}
// Token: 0x0600C278 RID: 49784 RVA: 0x002BF818 File Offset: 0x002BDA18
[Token(Token = "0x600C278")]
[Address(RVA = "0x2934EC0", Offset = "0x2933EC0", VA = "0x182934EC0")]
public SignerInfoGenerator Build(ISignatureFactory signerFactory, byte[] subjectKeyIdentifier)
{
SignerIdentifier signerIdentifier = new SignerIdentifier(new DerOctetString(subjectKeyIdentifier));
return this.CreateGenerator(signerFactory, signerIdentifier);
}
// Token: 0x0600C279 RID: 49785 RVA: 0x002BF83C File Offset: 0x002BDA3C
[Token(Token = "0x600C279")]
[Address(RVA = "0x2934F60", Offset = "0x2933F60", VA = "0x182934F60")]
private SignerInfoGenerator CreateGenerator(ISignatureFactory contentSigner, SignerIdentifier sigId)
{
/*
An exception occurred when decompiling this method (0600C279)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInfoGenerator BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInfoGeneratorBuilder::CreateGenerator(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ISignatureFactory,BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.SignerIdentifier)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_70:
stloc:int32(var_8_71, ldc.i4:int32(0))
stfld:SignerIdentifier(SignerInfoGenerator::sigId, ldloc:SignerInfoGenerator(var_7), ldloc:SignerIdentifier(sigId))
stfld:ISignatureFactory(SignerInfoGenerator::contentSigner, ldloc:SignerInfoGenerator(var_7), ldloc:ISignatureFactory(contentSigner))
stfld:bool(SignerInfoGenerator::isDirectSignature, ldloc:SignerInfoGenerator(var_7), ldc.i4:bool(1))
stfld:CmsAttributeTableGenerator(SignerInfoGenerator::signedGen, ldloc:SignerInfoGenerator(var_7), ldloc:int32[exp:CmsAttributeTableGenerator](var_8_71))
stfld:CmsAttributeTableGenerator(SignerInfoGenerator::unsignedGen, ldloc:SignerInfoGenerator(var_7), ldloc:int32[exp:CmsAttributeTableGenerator](var_8_71))
}
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: 0x04007AF7 RID: 31479
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007AF7")]
private bool directSignature;
// Token: 0x04007AF8 RID: 31480
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007AF8")]
private CmsAttributeTableGenerator signedGen;
// Token: 0x04007AF9 RID: 31481
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007AF9")]
private CmsAttributeTableGenerator unsignedGen;
}
}