119 lines
6.7 KiB
C#
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: 0x02001D6B RID: 7531
|
|
[Token(Token = "0x2001D6B")]
|
|
public class SignerInfoGeneratorBuilder
|
|
{
|
|
// Token: 0x0600BEA5 RID: 48805 RVA: 0x002B6E84 File Offset: 0x002B5084
|
|
[Token(Token = "0x600BEA5")]
|
|
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
|
public SignerInfoGeneratorBuilder()
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600BEA6 RID: 48806 RVA: 0x002B6E98 File Offset: 0x002B5098
|
|
[Token(Token = "0x600BEA6")]
|
|
[Address(RVA = "0x20145A0", Offset = "0x20133A0", VA = "0x1820145A0")]
|
|
public SignerInfoGeneratorBuilder SetDirectSignature(bool hasNoSignedAttributes)
|
|
{
|
|
this.directSignature = hasNoSignedAttributes;
|
|
return this;
|
|
}
|
|
|
|
// Token: 0x0600BEA7 RID: 48807 RVA: 0x002B6EB0 File Offset: 0x002B50B0
|
|
[Token(Token = "0x600BEA7")]
|
|
[Address(RVA = "0x1871FF0", Offset = "0x1870DF0", VA = "0x181871FF0")]
|
|
public SignerInfoGeneratorBuilder WithSignedAttributeGenerator(CmsAttributeTableGenerator signedGen)
|
|
{
|
|
this.signedGen = signedGen;
|
|
return this;
|
|
}
|
|
|
|
// Token: 0x0600BEA8 RID: 48808 RVA: 0x002B6EC8 File Offset: 0x002B50C8
|
|
[Token(Token = "0x600BEA8")]
|
|
[Address(RVA = "0x1872000", Offset = "0x1870E00", VA = "0x181872000")]
|
|
public SignerInfoGeneratorBuilder WithUnsignedAttributeGenerator(CmsAttributeTableGenerator unsignedGen)
|
|
{
|
|
this.unsignedGen = unsignedGen;
|
|
return this;
|
|
}
|
|
|
|
// Token: 0x0600BEA9 RID: 48809 RVA: 0x002B6EE0 File Offset: 0x002B50E0
|
|
[Token(Token = "0x600BEA9")]
|
|
[Address(RVA = "0x20142A0", Offset = "0x20130A0", VA = "0x1820142A0")]
|
|
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: 0x0600BEAA RID: 48810 RVA: 0x002B6F20 File Offset: 0x002B5120
|
|
[Token(Token = "0x600BEAA")]
|
|
[Address(RVA = "0x20143C0", Offset = "0x20131C0", VA = "0x1820143C0")]
|
|
public SignerInfoGenerator Build(ISignatureFactory signerFactory, byte[] subjectKeyIdentifier)
|
|
{
|
|
SignerIdentifier signerIdentifier = new SignerIdentifier(new DerOctetString(subjectKeyIdentifier));
|
|
return this.CreateGenerator(signerFactory, signerIdentifier);
|
|
}
|
|
|
|
// Token: 0x0600BEAB RID: 48811 RVA: 0x002B6F44 File Offset: 0x002B5144
|
|
[Token(Token = "0x600BEAB")]
|
|
[Address(RVA = "0x2014460", Offset = "0x2013260", VA = "0x182014460")]
|
|
private SignerInfoGenerator CreateGenerator(ISignatureFactory contentSigner, SignerIdentifier sigId)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BEAB)
|
|
|
|
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: 0x0400793E RID: 31038
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x400793E")]
|
|
private bool directSignature;
|
|
|
|
// Token: 0x0400793F RID: 31039
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x400793F")]
|
|
private CmsAttributeTableGenerator signedGen;
|
|
|
|
// Token: 0x04007940 RID: 31040
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4007940")]
|
|
private CmsAttributeTableGenerator unsignedGen;
|
|
}
|
|
}
|