121 lines
6.8 KiB
C#
121 lines
6.8 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
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: 0x0200178E RID: 6030
|
|
[Token(Token = "0x200178E")]
|
|
[StructLayout(3)]
|
|
public class SignerInfoGeneratorBuilder
|
|
{
|
|
// Token: 0x0600A2CB RID: 41675 RVA: 0x0025EA68 File Offset: 0x0025CC68
|
|
[Token(Token = "0x600A2CB")]
|
|
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
|
|
public SignerInfoGeneratorBuilder()
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600A2CC RID: 41676 RVA: 0x0025EA7C File Offset: 0x0025CC7C
|
|
[Token(Token = "0x600A2CC")]
|
|
[Address(RVA = "0x665660", Offset = "0x664060", VA = "0x180665660")]
|
|
public SignerInfoGeneratorBuilder SetDirectSignature(bool hasNoSignedAttributes)
|
|
{
|
|
this.directSignature = hasNoSignedAttributes;
|
|
return this;
|
|
}
|
|
|
|
// Token: 0x0600A2CD RID: 41677 RVA: 0x0025EA94 File Offset: 0x0025CC94
|
|
[Token(Token = "0x600A2CD")]
|
|
[Address(RVA = "0x4E1CF0", Offset = "0x4E06F0", VA = "0x1804E1CF0")]
|
|
public SignerInfoGeneratorBuilder WithSignedAttributeGenerator(CmsAttributeTableGenerator signedGen)
|
|
{
|
|
this.signedGen = signedGen;
|
|
return this;
|
|
}
|
|
|
|
// Token: 0x0600A2CE RID: 41678 RVA: 0x0025EAAC File Offset: 0x0025CCAC
|
|
[Token(Token = "0x600A2CE")]
|
|
[Address(RVA = "0x665670", Offset = "0x664070", VA = "0x180665670")]
|
|
public SignerInfoGeneratorBuilder WithUnsignedAttributeGenerator(CmsAttributeTableGenerator unsignedGen)
|
|
{
|
|
this.unsignedGen = unsignedGen;
|
|
return this;
|
|
}
|
|
|
|
// Token: 0x0600A2CF RID: 41679 RVA: 0x0025EAC4 File Offset: 0x0025CCC4
|
|
[Token(Token = "0x600A2CF")]
|
|
[Address(RVA = "0x665360", Offset = "0x663D60", VA = "0x180665360")]
|
|
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: 0x0600A2D0 RID: 41680 RVA: 0x0025EB04 File Offset: 0x0025CD04
|
|
[Token(Token = "0x600A2D0")]
|
|
[Address(RVA = "0x665480", Offset = "0x663E80", VA = "0x180665480")]
|
|
public SignerInfoGenerator Build(ISignatureFactory signerFactory, byte[] subjectKeyIdentifier)
|
|
{
|
|
SignerIdentifier signerIdentifier = new SignerIdentifier(new DerOctetString(subjectKeyIdentifier));
|
|
return this.CreateGenerator(signerFactory, signerIdentifier);
|
|
}
|
|
|
|
// Token: 0x0600A2D1 RID: 41681 RVA: 0x0025EB28 File Offset: 0x0025CD28
|
|
[Token(Token = "0x600A2D1")]
|
|
[Address(RVA = "0x665520", Offset = "0x663F20", VA = "0x180665520")]
|
|
private SignerInfoGenerator CreateGenerator(ISignatureFactory contentSigner, SignerIdentifier sigId)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600A2D1)
|
|
|
|
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: 0x04006AFB RID: 27387
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006AFB")]
|
|
private bool directSignature;
|
|
|
|
// Token: 0x04006AFC RID: 27388
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4006AFC")]
|
|
private CmsAttributeTableGenerator signedGen;
|
|
|
|
// Token: 0x04006AFD RID: 27389
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4006AFD")]
|
|
private CmsAttributeTableGenerator unsignedGen;
|
|
}
|
|
}
|