This commit is contained in:
niko
2026-04-08 23:40:05 +02:00
parent d6894bcbc7
commit 18dc73f922
7750 changed files with 1795369 additions and 0 deletions
@@ -0,0 +1,34 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001743 RID: 5955
[Token(Token = "0x2001743")]
[StructLayout(3)]
internal class BaseDigestCalculator : IDigestCalculator
{
// Token: 0x0600A105 RID: 41221 RVA: 0x00257360 File Offset: 0x00255560
[Token(Token = "0x600A105")]
[Address(RVA = "0x3C3A30", Offset = "0x3C2430", VA = "0x1803C3A30")]
internal BaseDigestCalculator(byte[] digest)
{
this.digest = digest;
}
// Token: 0x0600A106 RID: 41222 RVA: 0x0025737C File Offset: 0x0025557C
[Token(Token = "0x600A106")]
[Address(RVA = "0x1C711E0", Offset = "0x1C6FBE0", VA = "0x181C711E0", Slot = "4")]
public byte[] GetDigest()
{
return Arrays.Clone(this.digest);
}
// Token: 0x04006A00 RID: 27136
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A00")]
private readonly byte[] digest;
}
}
@@ -0,0 +1,36 @@
using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001744 RID: 5956
[Token(Token = "0x2001744")]
[Serializable]
[StructLayout(3)]
public class CmsAttributeTableGenerationException : CmsException
{
// Token: 0x0600A107 RID: 41223 RVA: 0x00257394 File Offset: 0x00255594
[Token(Token = "0x600A107")]
[Address(RVA = "0x1C71240", Offset = "0x1C6FC40", VA = "0x181C71240")]
public CmsAttributeTableGenerationException()
{
}
// Token: 0x0600A108 RID: 41224 RVA: 0x002573A8 File Offset: 0x002555A8
[Token(Token = "0x600A108")]
[Address(RVA = "0x1C71320", Offset = "0x1C6FD20", VA = "0x181C71320")]
public CmsAttributeTableGenerationException(string name)
: base(name)
{
}
// Token: 0x0600A109 RID: 41225 RVA: 0x002573BC File Offset: 0x002555BC
[Token(Token = "0x600A109")]
[Address(RVA = "0x1C712A0", Offset = "0x1C6FCA0", VA = "0x181C712A0")]
public CmsAttributeTableGenerationException(string name, Exception e)
: base(name, e)
{
}
}
}
@@ -0,0 +1,19 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001746 RID: 5958
[Token(Token = "0x2001746")]
[StructLayout(3)]
public interface CmsAttributeTableGenerator
{
// Token: 0x0600A10A RID: 41226
[Token(Token = "0x600A10A")]
[Address(Slot = "0")]
AttributeTable GetAttributes(IDictionary parameters);
}
}
@@ -0,0 +1,25 @@
using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001745 RID: 5957
[Token(Token = "0x2001745")]
[StructLayout(3, Size = 4)]
public enum CmsAttributeTableParameter
{
// Token: 0x04006A02 RID: 27138
[Token(Token = "0x4006A02")]
ContentType,
// Token: 0x04006A03 RID: 27139
[Token(Token = "0x4006A03")]
Digest,
// Token: 0x04006A04 RID: 27140
[Token(Token = "0x4006A04")]
Signature,
// Token: 0x04006A05 RID: 27141
[Token(Token = "0x4006A05")]
DigestAlgorithmIdentifier
}
}
@@ -0,0 +1,162 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001747 RID: 5959
[Token(Token = "0x2001747")]
[StructLayout(3)]
internal class CmsAuthEnvelopedData
{
// Token: 0x0600A10B RID: 41227 RVA: 0x002573D4 File Offset: 0x002555D4
[Token(Token = "0x600A10B")]
[Address(RVA = "0x1C71390", Offset = "0x1C6FD90", VA = "0x181C71390")]
public CmsAuthEnvelopedData(byte[] authEnvData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(authEnvData));
}
// Token: 0x0600A10C RID: 41228 RVA: 0x002573F0 File Offset: 0x002555F0
[Token(Token = "0x600A10C")]
[Address(RVA = "0x1C71410", Offset = "0x1C6FE10", VA = "0x181C71410")]
public CmsAuthEnvelopedData(Stream authEnvData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(authEnvData, int.MaxValue));
}
// Token: 0x0600A10D RID: 41229 RVA: 0x00257410 File Offset: 0x00255610
[Token(Token = "0x600A10D")]
[Address(RVA = "0x1C71490", Offset = "0x1C6FE90", VA = "0x181C71490")]
public CmsAuthEnvelopedData(ContentInfo contentInfo)
{
this.contentInfo = contentInfo;
AuthEnvelopedData instance = AuthEnvelopedData.GetInstance(contentInfo.content);
OriginatorInfo originatorInfo = instance.originatorInfo;
this.originator = originatorInfo;
EncryptedContentInfo authEncryptedContentInfo = instance.authEncryptedContentInfo;
Asn1Set recipientInfos = instance.recipientInfos;
AlgorithmIdentifier contentEncryptionAlgorithm = authEncryptedContentInfo.contentEncryptionAlgorithm;
this.authEncAlg = contentEncryptionAlgorithm;
CmsAuthEnvelopedData.AuthEnvelopedSecureReadable authEnvelopedSecureReadable;
authEnvelopedSecureReadable.parent = this;
RecipientInformationStore recipientInformationStore = CmsEnvelopedHelper.BuildRecipientInformationStore(recipientInfos, authEnvelopedSecureReadable);
this.recipientInfoStore = recipientInformationStore;
Asn1Set asn1Set = instance.authAttrs;
this.authAttrs = asn1Set;
Stream octetStream = instance.mac.GetOctetStream();
this.mac = octetStream;
Asn1Set asn1Set2 = instance.unauthAttrs;
this.unauthAttrs = asn1Set2;
}
// Token: 0x04006A06 RID: 27142
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A06")]
internal RecipientInformationStore recipientInfoStore;
// Token: 0x04006A07 RID: 27143
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A07")]
internal ContentInfo contentInfo;
// Token: 0x04006A08 RID: 27144
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006A08")]
private OriginatorInfo originator;
// Token: 0x04006A09 RID: 27145
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006A09")]
private AlgorithmIdentifier authEncAlg;
// Token: 0x04006A0A RID: 27146
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006A0A")]
private Asn1Set authAttrs;
// Token: 0x04006A0B RID: 27147
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006A0B")]
private byte[] mac;
// Token: 0x04006A0C RID: 27148
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006A0C")]
private Asn1Set unauthAttrs;
// Token: 0x02001748 RID: 5960
[Token(Token = "0x2001748")]
private class AuthEnvelopedSecureReadable : CmsSecureReadable
{
// Token: 0x0600A10E RID: 41230 RVA: 0x002574B8 File Offset: 0x002556B8
[Token(Token = "0x600A10E")]
[Address(RVA = "0x3C3A30", Offset = "0x3C2430", VA = "0x1803C3A30")]
internal AuthEnvelopedSecureReadable(CmsAuthEnvelopedData parent)
{
this.parent = parent;
}
// Token: 0x17001944 RID: 6468
// (get) Token: 0x0600A10F RID: 41231 RVA: 0x002574D4 File Offset: 0x002556D4
[Token(Token = "0x17001944")]
public AlgorithmIdentifier Algorithm
{
[Token(Token = "0x600A10F")]
[Address(RVA = "0x550740", Offset = "0x54F140", VA = "0x180550740", Slot = "4")]
get
{
return this.parent.authEncAlg;
}
}
// Token: 0x17001945 RID: 6469
// (get) Token: 0x0600A110 RID: 41232 RVA: 0x002574F4 File Offset: 0x002556F4
[Token(Token = "0x17001945")]
public object CryptoObject
{
[Token(Token = "0x600A110")]
[Address(RVA = "0x3F8880", Offset = "0x3F7280", VA = "0x1803F8880", Slot = "5")]
get
{
}
}
// Token: 0x0600A111 RID: 41233 RVA: 0x00257504 File Offset: 0x00255704
[Token(Token = "0x600A111")]
[Address(RVA = "0x1C71180", Offset = "0x1C6FB80", VA = "0x181C71180", Slot = "6")]
public CmsReadable GetReadable(KeyParameter key)
{
/*
An exception occurred when decompiling this method (0600A111)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsReadable BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsAuthEnvelopedData/AuthEnvelopedSecureReadable::GetReadable(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.KeyParameter)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:CmsException(var_0_0A, newobj:CmsException(CmsException::.ctor, ldstr:string("AuthEnveloped data decryption not yet implemented")))
}
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: 0x04006A0D RID: 27149
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A0D")]
private readonly CmsAuthEnvelopedData parent;
}
}
}
@@ -0,0 +1,44 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001749 RID: 5961
[Token(Token = "0x2001749")]
[StructLayout(3)]
internal class CmsAuthEnvelopedGenerator
{
// Token: 0x0600A112 RID: 41234 RVA: 0x0025751C File Offset: 0x0025571C
[Token(Token = "0x600A112")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public CmsAuthEnvelopedGenerator()
{
}
// Token: 0x04006A0E RID: 27150
[Token(Token = "0x4006A0E")]
public static readonly string Aes128Ccm = NistObjectIdentifiers.IdAes128Ccm.identifier;
// Token: 0x04006A0F RID: 27151
[Token(Token = "0x4006A0F")]
public static readonly string Aes192Ccm = NistObjectIdentifiers.IdAes192Ccm.identifier;
// Token: 0x04006A10 RID: 27152
[Token(Token = "0x4006A10")]
public static readonly string Aes256Ccm = NistObjectIdentifiers.IdAes256Ccm.identifier;
// Token: 0x04006A11 RID: 27153
[Token(Token = "0x4006A11")]
public static readonly string Aes128Gcm = NistObjectIdentifiers.IdAes128Gcm.identifier;
// Token: 0x04006A12 RID: 27154
[Token(Token = "0x4006A12")]
public static readonly string Aes192Gcm = NistObjectIdentifiers.IdAes192Gcm.identifier;
// Token: 0x04006A13 RID: 27155
[Token(Token = "0x4006A13")]
public static readonly string Aes256Gcm = NistObjectIdentifiers.IdAes256Gcm.identifier;
}
}
@@ -0,0 +1,178 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200174A RID: 5962
[Token(Token = "0x200174A")]
[StructLayout(3)]
public class CmsAuthenticatedData
{
// Token: 0x0600A114 RID: 41236 RVA: 0x002575A0 File Offset: 0x002557A0
[Token(Token = "0x600A114")]
[Address(RVA = "0x1C73880", Offset = "0x1C72280", VA = "0x181C73880")]
public CmsAuthenticatedData(byte[] authData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(authData));
}
// Token: 0x0600A115 RID: 41237 RVA: 0x002575BC File Offset: 0x002557BC
[Token(Token = "0x600A115")]
[Address(RVA = "0x1C73A70", Offset = "0x1C72470", VA = "0x181C73A70")]
public CmsAuthenticatedData(Stream authData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(authData, int.MaxValue));
}
// Token: 0x0600A116 RID: 41238 RVA: 0x002575DC File Offset: 0x002557DC
[Token(Token = "0x600A116")]
[Address(RVA = "0x1C73900", Offset = "0x1C72300", VA = "0x181C73900")]
public CmsAuthenticatedData(ContentInfo contentInfo)
{
this.contentInfo = contentInfo;
AuthenticatedData instance = AuthenticatedData.GetInstance(contentInfo.content);
AlgorithmIdentifier macAlgorithm = instance.macAlgorithm;
Asn1Set recipientInfos = instance.recipientInfos;
this.macAlg = macAlgorithm;
Stream octetStream = Asn1OctetString.GetInstance(instance.encapsulatedContentInfo.content).GetOctetStream();
CmsProcessableByteArray cmsProcessableByteArray;
cmsProcessableByteArray.bytes = octetStream;
AlgorithmIdentifier algorithmIdentifier = this.macAlg;
CmsEnvelopedHelper.CmsAuthenticatedSecureReadable cmsAuthenticatedSecureReadable;
cmsAuthenticatedSecureReadable.readable = cmsProcessableByteArray;
cmsAuthenticatedSecureReadable.algorithm = algorithmIdentifier;
RecipientInformationStore recipientInformationStore = CmsEnvelopedHelper.BuildRecipientInformationStore(recipientInfos, cmsAuthenticatedSecureReadable);
this.recipientInfoStore = recipientInformationStore;
Asn1Set asn1Set = instance.authAttrs;
this.authAttrs = asn1Set;
Stream octetStream2 = instance.mac.GetOctetStream();
this.mac = octetStream2;
Asn1Set asn1Set2 = instance.unauthAttrs;
this.unauthAttrs = asn1Set2;
}
// Token: 0x0600A117 RID: 41239 RVA: 0x0025769C File Offset: 0x0025589C
[Token(Token = "0x600A117")]
[Address(RVA = "0x1C737B0", Offset = "0x1C721B0", VA = "0x181C737B0")]
public byte[] GetMac()
{
return Arrays.Clone(this.mac);
}
// Token: 0x17001946 RID: 6470
// (get) Token: 0x0600A118 RID: 41240 RVA: 0x002576B4 File Offset: 0x002558B4
[Token(Token = "0x17001946")]
public AlgorithmIdentifier MacAlgorithmID
{
[Token(Token = "0x600A118")]
[Address(RVA = "0x3C1220", Offset = "0x3BFC20", VA = "0x1803C1220")]
get
{
return this.macAlg;
}
}
// Token: 0x17001947 RID: 6471
// (get) Token: 0x0600A119 RID: 41241 RVA: 0x002576C8 File Offset: 0x002558C8
[Token(Token = "0x17001947")]
public string MacAlgOid
{
[Token(Token = "0x600A119")]
[Address(RVA = "0x668A50", Offset = "0x667450", VA = "0x180668A50")]
get
{
Asn1Object asn1Object = this.macAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x0600A11A RID: 41242 RVA: 0x002576E8 File Offset: 0x002558E8
[Token(Token = "0x600A11A")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0")]
public RecipientInformationStore GetRecipientInfos()
{
return this.recipientInfoStore;
}
// Token: 0x17001948 RID: 6472
// (get) Token: 0x0600A11B RID: 41243 RVA: 0x002576FC File Offset: 0x002558FC
[Token(Token = "0x17001948")]
public ContentInfo ContentInfo
{
[Token(Token = "0x600A11B")]
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240")]
get
{
return this.contentInfo;
}
}
// Token: 0x0600A11C RID: 41244 RVA: 0x00257710 File Offset: 0x00255910
[Token(Token = "0x600A11C")]
[Address(RVA = "0x1C73720", Offset = "0x1C72120", VA = "0x181C73720")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable GetAuthAttrs()
{
Asn1Set asn1Set = this.authAttrs;
if (asn1Set != 0)
{
return new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(asn1Set);
}
}
// Token: 0x0600A11D RID: 41245 RVA: 0x00257730 File Offset: 0x00255930
[Token(Token = "0x600A11D")]
[Address(RVA = "0x1C73810", Offset = "0x1C72210", VA = "0x181C73810")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable GetUnauthAttrs()
{
Asn1Set asn1Set = this.unauthAttrs;
if (asn1Set != 0)
{
return new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(asn1Set);
}
}
// Token: 0x0600A11E RID: 41246 RVA: 0x00257750 File Offset: 0x00255950
[Token(Token = "0x600A11E")]
[Address(RVA = "0x1C73790", Offset = "0x1C72190", VA = "0x181C73790")]
public byte[] GetEncoded()
{
return this.contentInfo.GetEncoded();
}
// Token: 0x04006A14 RID: 27156
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A14")]
internal RecipientInformationStore recipientInfoStore;
// Token: 0x04006A15 RID: 27157
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A15")]
internal ContentInfo contentInfo;
// Token: 0x04006A16 RID: 27158
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006A16")]
private AlgorithmIdentifier macAlg;
// Token: 0x04006A17 RID: 27159
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006A17")]
private Asn1Set authAttrs;
// Token: 0x04006A18 RID: 27160
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006A18")]
private Asn1Set unauthAttrs;
// Token: 0x04006A19 RID: 27161
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006A19")]
private byte[] mac;
}
}
@@ -0,0 +1,101 @@
using System;
using System.Collections;
using System.IO;
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.Crypto.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200174B RID: 5963
[Token(Token = "0x200174B")]
[StructLayout(3)]
public class CmsAuthenticatedDataGenerator : CmsAuthenticatedGenerator
{
// Token: 0x0600A11F RID: 41247 RVA: 0x00257770 File Offset: 0x00255970
[Token(Token = "0x600A11F")]
[Address(RVA = "0x1C71F20", Offset = "0x1C70920", VA = "0x181C71F20")]
public CmsAuthenticatedDataGenerator()
{
}
// Token: 0x0600A120 RID: 41248 RVA: 0x00257784 File Offset: 0x00255984
[Token(Token = "0x600A120")]
[Address(RVA = "0x1C71F80", Offset = "0x1C70980", VA = "0x181C71F80")]
public CmsAuthenticatedDataGenerator(SecureRandom rand)
: base(rand)
{
}
// Token: 0x0600A121 RID: 41249 RVA: 0x00257798 File Offset: 0x00255998
[Token(Token = "0x600A121")]
[Address(RVA = "0x1C71860", Offset = "0x1C70260", VA = "0x181C71860")]
private CmsAuthenticatedData Generate(CmsProcessable content, string macOid, CipherKeyGenerator keyGen)
{
Asn1EncodableVector asn1EncodableVector;
for (;;)
{
int num = 0;
byte[] array = keyGen.GenerateKey();
KeyParameter keyParameter = ParameterUtilities.CreateKeyParameter(macOid, array);
string text = this.ToString();
IMac mac = MacUtilities.GetMac(macOid);
MemoryStream memoryStream = new MemoryStream();
MacSink macSink = new MacSink(mac);
Platform.Dispose(new TeeOutputStream(memoryStream, macSink));
DerOctetString derOctetString = new DerOctetString(MacUtilities.DoFinal(mac));
IList recipientInfoGenerators = this.recipientInfoGenerators;
if (asn1EncodableVector != 0)
{
break;
}
ArrayTypeMismatchException ex;
if (ex != 0)
{
}
if (num != -1)
{
}
if (num == 0)
{
goto Block_2;
}
}
if (asn1EncodableVector == 0)
{
}
if (asn1EncodableVector != 0)
{
Asn1Encodable[] array2 = new Asn1Encodable[1];
SecureRandom rand = this.rand;
throw new ArrayTypeMismatchException();
}
throw new NullReferenceException();
Block_2:
DerObjectIdentifier authenticatedData = CmsObjectIdentifiers.AuthenticatedData;
DerSet derSet = new DerSet(asn1EncodableVector);
AuthenticatedData authenticatedData2;
return new CmsAuthenticatedData(new ContentInfo(authenticatedData, authenticatedData2));
}
// Token: 0x0600A122 RID: 41250 RVA: 0x002578B8 File Offset: 0x00255AB8
[Token(Token = "0x600A122")]
[Address(RVA = "0x1C71730", Offset = "0x1C70130", VA = "0x181C71730")]
public CmsAuthenticatedData Generate(CmsProcessable content, string encryptionOid)
{
CipherKeyGenerator keyGenerator = GeneratorUtilities.GetKeyGenerator(encryptionOid);
SecureRandom rand = this.rand;
int defaultStrength = keyGenerator.defaultStrength;
KeyGenerationParameters keyGenerationParameters = new KeyGenerationParameters(rand, defaultStrength);
keyGenerator.Init(keyGenerationParameters);
return this.Generate(content, encryptionOid, keyGenerator);
}
}
}
@@ -0,0 +1,264 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200174C RID: 5964
[Token(Token = "0x200174C")]
[StructLayout(3)]
public class CmsAuthenticatedDataParser : CmsContentInfoParser
{
// Token: 0x0600A123 RID: 41251 RVA: 0x002578F8 File Offset: 0x00255AF8
[Token(Token = "0x600A123")]
[Address(RVA = "0x1C72A00", Offset = "0x1C71400", VA = "0x181C72A00")]
public CmsAuthenticatedDataParser(byte[] envelopedData)
{
int num;
MemoryStream memoryStream = new MemoryStream(envelopedData, num != 0);
num = 0;
}
// Token: 0x0600A124 RID: 41252 RVA: 0x00257910 File Offset: 0x00255B10
[Token(Token = "0x600A124")]
[Address(RVA = "0x1C727C0", Offset = "0x1C711C0", VA = "0x181C727C0")]
public CmsAuthenticatedDataParser(Stream envelopedData)
{
IAsn1Convertible content;
for (;;)
{
base..ctor(envelopedData);
ContentInfoParser contentInfo = this.contentInfo;
this.authAttrNotRead = true;
if (contentInfo.GetContent(16) == 0)
{
}
AuthenticatedDataParser authenticatedDataParser;
if (authenticatedDataParser != 0)
{
this.authData = authenticatedDataParser;
Asn1SetParser recipientInfos = authenticatedDataParser.GetRecipientInfos();
AlgorithmIdentifier macAlgorithm = this.authData.GetMacAlgorithm();
AuthenticatedDataParser authenticatedDataParser2 = this.authData;
this.macAlg = macAlgorithm;
content = authenticatedDataParser2.GetEnapsulatedContentInfo().GetContent(4);
if (content != 0 && content != 0)
{
break;
}
}
}
CmsProcessableInputStream cmsProcessableInputStream;
cmsProcessableInputStream.input = content;
AlgorithmIdentifier algorithmIdentifier = this.macAlg;
CmsEnvelopedHelper.CmsAuthenticatedSecureReadable cmsAuthenticatedSecureReadable;
cmsAuthenticatedSecureReadable.algorithm = algorithmIdentifier;
cmsAuthenticatedSecureReadable.readable = cmsProcessableInputStream;
Asn1Set asn1Set;
RecipientInformationStore recipientInformationStore = CmsEnvelopedHelper.BuildRecipientInformationStore(asn1Set, cmsAuthenticatedSecureReadable);
this._recipientInfoStore = recipientInformationStore;
}
// Token: 0x17001949 RID: 6473
// (get) Token: 0x0600A125 RID: 41253 RVA: 0x002579C0 File Offset: 0x00255BC0
[Token(Token = "0x17001949")]
public AlgorithmIdentifier MacAlgorithmID
{
[Token(Token = "0x600A125")]
[Address(RVA = "0x3C1250", Offset = "0x3BFC50", VA = "0x1803C1250")]
get
{
return this.macAlg;
}
}
// Token: 0x1700194A RID: 6474
// (get) Token: 0x0600A126 RID: 41254 RVA: 0x002579D4 File Offset: 0x00255BD4
[Token(Token = "0x1700194A")]
public string MacAlgOid
{
[Token(Token = "0x600A126")]
[Address(RVA = "0x1C72A70", Offset = "0x1C71470", VA = "0x181C72A70")]
get
{
Asn1Object asn1Object = this.macAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x1700194B RID: 6475
// (get) Token: 0x0600A127 RID: 41255 RVA: 0x002579F4 File Offset: 0x00255BF4
[Token(Token = "0x1700194B")]
public Asn1Object MacAlgParams
{
[Token(Token = "0x600A127")]
[Address(RVA = "0x1C72AB0", Offset = "0x1C714B0", VA = "0x181C72AB0")]
get
{
DerObjectIdentifier objectID = this.macAlg.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600A128 RID: 41256 RVA: 0x00257A20 File Offset: 0x00255C20
[Token(Token = "0x600A128")]
[Address(RVA = "0x3C1220", Offset = "0x3BFC20", VA = "0x1803C1220")]
public RecipientInformationStore GetRecipientInfos()
{
return this._recipientInfoStore;
}
// Token: 0x0600A129 RID: 41257 RVA: 0x00257A34 File Offset: 0x00255C34
[Token(Token = "0x600A129")]
[Address(RVA = "0x1C72450", Offset = "0x1C70E50", VA = "0x181C72450")]
public byte[] GetMac()
{
byte[] array = this.mac;
if (array == 0)
{
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = this.GetAuthAttrs();
Stream octetStream = this.authData.GetMac().GetOctetStream();
this.mac = octetStream;
}
return Arrays.Clone(array);
}
// Token: 0x0600A12A RID: 41258 RVA: 0x00257A78 File Offset: 0x00255C78
[Token(Token = "0x600A12A")]
[Address(RVA = "0x1C72190", Offset = "0x1C70B90", VA = "0x181C72190")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable GetAuthAttrs()
{
while (this.authAttrs == (ulong)0L && this.authAttrNotRead)
{
Asn1SetParser asn1SetParser = this.authData.GetAuthAttrs();
this.authAttrNotRead = false;
if (asn1SetParser != 0)
{
int num = 0;
int num2 = 0;
if (num2 < num)
{
num2 += num2;
num2++;
}
Asn1EncodableVector asn1EncodableVector;
if (asn1EncodableVector != 0)
{
if (asn1EncodableVector == 0)
{
continue;
}
Asn1Encodable[] array = new Asn1Encodable[1];
num2 += num2;
num2++;
if (num2 != 0)
{
}
array[0] = num2;
asn1EncodableVector.Add(array);
array += array;
array += array;
}
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(new DerSet(asn1EncodableVector));
this.authAttrs = attributeTable;
break;
}
break;
}
return this.authAttrs;
}
// Token: 0x0600A12B RID: 41259 RVA: 0x00257B28 File Offset: 0x00255D28
[Token(Token = "0x600A12B")]
[Address(RVA = "0x1C72500", Offset = "0x1C70F00", VA = "0x181C72500")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable GetUnauthAttrs()
{
while (this.unauthAttrs == (ulong)0L && this.unauthAttrNotRead)
{
Asn1SetParser asn1SetParser = this.authData.GetUnauthAttrs();
this.unauthAttrNotRead = false;
if (asn1SetParser != 0)
{
int num = 0;
int num2 = 0;
if (num2 < num)
{
num2 += num2;
num2++;
}
Asn1EncodableVector asn1EncodableVector;
if (asn1EncodableVector != 0)
{
if (asn1EncodableVector == 0)
{
continue;
}
Asn1Encodable[] array = new Asn1Encodable[1];
num2 += num2;
num2++;
if (num2 != 0)
{
}
array[0] = num2;
asn1EncodableVector.Add(array);
array += array;
array += array;
}
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(new DerSet(asn1EncodableVector));
this.unauthAttrs = attributeTable;
break;
}
break;
}
return this.unauthAttrs;
}
// Token: 0x04006A1A RID: 27162
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006A1A")]
internal RecipientInformationStore _recipientInfoStore;
// Token: 0x04006A1B RID: 27163
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006A1B")]
internal AuthenticatedDataParser authData;
// Token: 0x04006A1C RID: 27164
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006A1C")]
private AlgorithmIdentifier macAlg;
// Token: 0x04006A1D RID: 27165
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006A1D")]
private byte[] mac;
// Token: 0x04006A1E RID: 27166
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006A1E")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable authAttrs;
// Token: 0x04006A1F RID: 27167
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006A1F")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unauthAttrs;
// Token: 0x04006A20 RID: 27168
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
[Token(Token = "0x4006A20")]
private bool authAttrNotRead;
// Token: 0x04006A21 RID: 27169
[global::Cpp2IlInjected.FieldOffset(Offset = "0x51")]
[Token(Token = "0x4006A21")]
private bool unauthAttrNotRead;
}
}
@@ -0,0 +1,268 @@
using System;
using System.Collections;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200174D RID: 5965
[Token(Token = "0x200174D")]
[StructLayout(3)]
public class CmsAuthenticatedDataStreamGenerator : CmsAuthenticatedGenerator
{
// Token: 0x0600A12C RID: 41260 RVA: 0x00257BD8 File Offset: 0x00255DD8
[Token(Token = "0x600A12C")]
[Address(RVA = "0x1C71F20", Offset = "0x1C70920", VA = "0x181C71F20")]
public CmsAuthenticatedDataStreamGenerator()
{
}
// Token: 0x0600A12D RID: 41261 RVA: 0x00257BEC File Offset: 0x00255DEC
[Token(Token = "0x600A12D")]
[Address(RVA = "0x1C71F80", Offset = "0x1C70980", VA = "0x181C71F80")]
public CmsAuthenticatedDataStreamGenerator(SecureRandom rand)
: base(rand)
{
}
// Token: 0x0600A12E RID: 41262 RVA: 0x00257C00 File Offset: 0x00255E00
[Token(Token = "0x600A12E")]
[Address(RVA = "0x4D2650", Offset = "0x4D1050", VA = "0x1804D2650")]
public void SetBufferSize(int bufferSize)
{
this._bufferSize = bufferSize;
}
// Token: 0x0600A12F RID: 41263 RVA: 0x00257C14 File Offset: 0x00255E14
[Token(Token = "0x600A12F")]
[Address(RVA = "0x6A84B0", Offset = "0x6A6EB0", VA = "0x1806A84B0")]
public void SetBerEncodeRecipients(bool berEncodeRecipientSet)
{
this._berEncodeRecipientSet = berEncodeRecipientSet;
}
// Token: 0x0600A130 RID: 41264 RVA: 0x00257C28 File Offset: 0x00255E28
[Token(Token = "0x600A130")]
[Address(RVA = "0x1C72B00", Offset = "0x1C71500", VA = "0x181C72B00")]
private Stream Open(Stream outStr, string macOid, CipherKeyGenerator keyGen)
{
Asn1EncodableVector asn1EncodableVector;
for (;;)
{
byte[] array = keyGen.GenerateKey();
KeyParameter keyParameter = ParameterUtilities.CreateKeyParameter(macOid, array);
string text = this.ToString();
IList recipientInfoGenerators = this.recipientInfoGenerators;
if (asn1EncodableVector != 0)
{
break;
}
int num = 0;
int num2 = 0;
ArrayTypeMismatchException ex;
if (ex != 0)
{
}
if (num != -1)
{
}
if (num2 == 0)
{
Stream stream;
return stream;
}
}
if (asn1EncodableVector == 0)
{
}
if (asn1EncodableVector != 0)
{
Asn1Encodable[] array2 = new Asn1Encodable[1];
SecureRandom rand = this.rand;
throw new ArrayTypeMismatchException();
}
throw new NullReferenceException();
}
// Token: 0x0600A131 RID: 41265 RVA: 0x00257CE8 File Offset: 0x00255EE8
[Token(Token = "0x600A131")]
[Address(RVA = "0x1C72EB0", Offset = "0x1C718B0", VA = "0x181C72EB0")]
protected Stream Open(Stream outStr, AlgorithmIdentifier macAlgId, ICipherParameters cipherParameters, Asn1EncodableVector recipientInfos)
{
int num = 0;
BerSequenceGenerator berSequenceGenerator = new BerSequenceGenerator(outStr);
string text = berSequenceGenerator.ToString();
DerInteger derInteger = new DerInteger(AuthenticatedData.CalculateVersion(0));
BerSequenceGenerator berSequenceGenerator2;
string text2 = berSequenceGenerator2.ToString();
if (this._berEncodeRecipientSet)
{
}
IEnumerator enumerator;
DerSetGenerator derSetGenerator;
string text3;
if (enumerator != 0)
{
if (num < enumerator)
{
num += num;
num++;
}
if (enumerator == 0)
{
num += num;
}
if (enumerator == 0)
{
throw new NullReferenceException();
}
text3 = derSetGenerator.ToString();
}
if (text3 != 0)
{
}
if (num != -1)
{
}
if (num == 0)
{
Stream rawOutputStream = derSetGenerator.GetRawOutputStream();
string text4 = berSequenceGenerator2.ToString();
BerSequenceGenerator berSequenceGenerator3;
string text5 = berSequenceGenerator3.ToString();
BerOctetStringGenerator berOctetStringGenerator;
Stream rawOutputStream2 = berOctetStringGenerator.GetRawOutputStream();
IMac mac;
MacSink macSink = new MacSink(mac);
Stream stream;
TeeOutputStream teeOutputStream = new TeeOutputStream(stream, macSink);
CmsAuthenticatedDataStreamGenerator.CmsAuthenticatedDataOutputStream cmsAuthenticatedDataOutputStream;
cmsAuthenticatedDataOutputStream.macStream = teeOutputStream;
cmsAuthenticatedDataOutputStream.mac = mac;
cmsAuthenticatedDataOutputStream.cGen = berSequenceGenerator;
cmsAuthenticatedDataOutputStream.authGen = berSequenceGenerator2;
cmsAuthenticatedDataOutputStream.eiGen = berSequenceGenerator3;
throw new NullReferenceException();
}
throw new NullReferenceException();
}
// Token: 0x0600A132 RID: 41266 RVA: 0x00257E08 File Offset: 0x00256008
[Token(Token = "0x600A132")]
[Address(RVA = "0x1C73630", Offset = "0x1C72030", VA = "0x181C73630")]
public Stream Open(Stream outStr, string encryptionOid)
{
CipherKeyGenerator keyGenerator = GeneratorUtilities.GetKeyGenerator(encryptionOid);
SecureRandom rand = this.rand;
int defaultStrength = keyGenerator.defaultStrength;
KeyGenerationParameters keyGenerationParameters = new KeyGenerationParameters(rand, defaultStrength);
keyGenerator.Init(keyGenerationParameters);
return this.Open(outStr, encryptionOid, keyGenerator);
}
// Token: 0x0600A133 RID: 41267 RVA: 0x00257E48 File Offset: 0x00256048
[Token(Token = "0x600A133")]
[Address(RVA = "0x1C73540", Offset = "0x1C71F40", VA = "0x181C73540")]
public Stream Open(Stream outStr, string encryptionOid, int keySize)
{
CipherKeyGenerator keyGenerator = GeneratorUtilities.GetKeyGenerator(encryptionOid);
KeyGenerationParameters keyGenerationParameters = new KeyGenerationParameters(this.rand, keySize);
keyGenerator.Init(keyGenerationParameters);
return this.Open(outStr, encryptionOid, keyGenerator);
}
// Token: 0x04006A22 RID: 27170
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006A22")]
private int _bufferSize;
// Token: 0x04006A23 RID: 27171
[global::Cpp2IlInjected.FieldOffset(Offset = "0x2C")]
[Token(Token = "0x4006A23")]
private bool _berEncodeRecipientSet;
// Token: 0x0200174E RID: 5966
[Token(Token = "0x200174E")]
private class CmsAuthenticatedDataOutputStream : BaseOutputStream
{
// Token: 0x0600A134 RID: 41268 RVA: 0x00257E80 File Offset: 0x00256080
[Token(Token = "0x600A134")]
[Address(RVA = "0x1C72130", Offset = "0x1C70B30", VA = "0x181C72130")]
public CmsAuthenticatedDataOutputStream(Stream macStream, IMac mac, BerSequenceGenerator cGen, BerSequenceGenerator authGen, BerSequenceGenerator eiGen)
{
this.authGen = 0;
this.macStream = macStream;
this.cGen = cGen;
this.eiGen = 0;
this.mac = mac;
}
// Token: 0x0600A135 RID: 41269 RVA: 0x00257EB8 File Offset: 0x002560B8
[Token(Token = "0x600A135")]
[Address(RVA = "0x1C720D0", Offset = "0x1C70AD0", VA = "0x181C720D0", Slot = "30")]
public override void WriteByte(byte b)
{
bool canRead = this.macStream.CanRead;
}
// Token: 0x0600A136 RID: 41270 RVA: 0x00257ED8 File Offset: 0x002560D8
[Token(Token = "0x600A136")]
[Address(RVA = "0x1C72100", Offset = "0x1C70B00", VA = "0x181C72100", Slot = "29")]
public override void Write(byte[] bytes, int off, int len)
{
bool canRead = this.macStream.CanRead;
}
// Token: 0x0600A137 RID: 41271 RVA: 0x00257EF8 File Offset: 0x002560F8
[Token(Token = "0x600A137")]
[Address(RVA = "0x1C71F90", Offset = "0x1C70990", VA = "0x181C71F90", Slot = "15")]
public override void Close()
{
Platform.Dispose(this.macStream);
Stream rawOutputStream = this.eiGen.GetRawOutputStream();
byte[] array = MacUtilities.DoFinal(this.mac);
BerSequenceGenerator berSequenceGenerator = this.authGen;
DerOctetString derOctetString = new DerOctetString(array);
string text = berSequenceGenerator.ToString();
Stream rawOutputStream2 = this.authGen.GetRawOutputStream();
Stream rawOutputStream3 = this.cGen.GetRawOutputStream();
base.Close();
}
// Token: 0x04006A24 RID: 27172
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006A24")]
private readonly Stream macStream;
// Token: 0x04006A25 RID: 27173
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006A25")]
private readonly IMac mac;
// Token: 0x04006A26 RID: 27174
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006A26")]
private readonly BerSequenceGenerator cGen;
// Token: 0x04006A27 RID: 27175
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006A27")]
private readonly BerSequenceGenerator authGen;
// Token: 0x04006A28 RID: 27176
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
[Token(Token = "0x4006A28")]
private readonly BerSequenceGenerator eiGen;
}
}
}
@@ -0,0 +1,33 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200174F RID: 5967
[Token(Token = "0x200174F")]
[StructLayout(3)]
public class CmsAuthenticatedGenerator : CmsEnvelopedGenerator
{
// Token: 0x0600A138 RID: 41272 RVA: 0x00257F64 File Offset: 0x00256164
[Token(Token = "0x600A138")]
[Address(RVA = "0x1C71F20", Offset = "0x1C70920", VA = "0x181C71F20")]
public CmsAuthenticatedGenerator()
{
}
// Token: 0x0600A139 RID: 41273 RVA: 0x00257F78 File Offset: 0x00256178
[Token(Token = "0x600A139")]
[Address(RVA = "0x1C73AF0", Offset = "0x1C724F0", VA = "0x181C73AF0")]
public CmsAuthenticatedGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this.recipientInfoGenerators = list;
base..ctor();
this.rand = rand;
}
}
}
@@ -0,0 +1,115 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001750 RID: 5968
[Token(Token = "0x2001750")]
[StructLayout(3)]
public class CmsCompressedData
{
// Token: 0x0600A13A RID: 41274 RVA: 0x00257FA4 File Offset: 0x002561A4
[Token(Token = "0x600A13A")]
[Address(RVA = "0x1C74A30", Offset = "0x1C73430", VA = "0x181C74A30")]
public CmsCompressedData(byte[] compressedData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(compressedData));
base..ctor();
this.contentInfo = contentInfo;
}
// Token: 0x0600A13B RID: 41275 RVA: 0x00257FCC File Offset: 0x002561CC
[Token(Token = "0x600A13B")]
[Address(RVA = "0x1C74AB0", Offset = "0x1C734B0", VA = "0x181C74AB0")]
public CmsCompressedData(Stream compressedDataStream)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(compressedDataStream, int.MaxValue));
base..ctor();
this.contentInfo = contentInfo;
}
// Token: 0x0600A13C RID: 41276 RVA: 0x00257FF8 File Offset: 0x002561F8
[Token(Token = "0x600A13C")]
[Address(RVA = "0x3C3A30", Offset = "0x3C2430", VA = "0x1803C3A30")]
public CmsCompressedData(ContentInfo contentInfo)
{
this.contentInfo = contentInfo;
}
// Token: 0x0600A13D RID: 41277 RVA: 0x00258014 File Offset: 0x00256214
[Token(Token = "0x600A13D")]
[Address(RVA = "0x1C74630", Offset = "0x1C73030", VA = "0x181C74630")]
public byte[] GetContent()
{
byte[] array;
for (;;)
{
int num = 0;
Asn1Encodable content = CompressedData.GetInstance(this.contentInfo.content).encapContentInfo.content;
if (content != 0 && content != 0)
{
Stream stream;
ZInputStream zinputStream = new ZInputStream(stream);
array = Streams.ReadAll(zinputStream);
Platform.Dispose(zinputStream);
if (num != -1)
{
}
if (num == 0)
{
break;
}
}
}
return array;
}
// Token: 0x0600A13E RID: 41278 RVA: 0x00258084 File Offset: 0x00256284
[Token(Token = "0x600A13E")]
[Address(RVA = "0x1C74860", Offset = "0x1C73260", VA = "0x181C74860")]
public byte[] GetContent(int limit)
{
Asn1Encodable content;
do
{
content = CompressedData.GetInstance(this.contentInfo.content).encapContentInfo.content;
}
while (content == 0 || content == 0);
MemoryStream memoryStream;
return Streams.ReadAllLimited(new ZInputStream(memoryStream), limit);
}
// Token: 0x1700194C RID: 6476
// (get) Token: 0x0600A13F RID: 41279 RVA: 0x002580CC File Offset: 0x002562CC
[Token(Token = "0x1700194C")]
public ContentInfo ContentInfo
{
[Token(Token = "0x600A13F")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0")]
get
{
return this.contentInfo;
}
}
// Token: 0x0600A140 RID: 41280 RVA: 0x002580E0 File Offset: 0x002562E0
[Token(Token = "0x600A140")]
[Address(RVA = "0x53BEA0", Offset = "0x53A8A0", VA = "0x18053BEA0")]
public byte[] GetEncoded()
{
return this.contentInfo.GetEncoded();
}
// Token: 0x04006A29 RID: 27177
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A29")]
internal ContentInfo contentInfo;
}
}
@@ -0,0 +1,46 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001751 RID: 5969
[Token(Token = "0x2001751")]
[StructLayout(3)]
public class CmsCompressedDataGenerator
{
// Token: 0x0600A141 RID: 41281 RVA: 0x00258100 File Offset: 0x00256300
[Token(Token = "0x600A141")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public CmsCompressedDataGenerator()
{
}
// Token: 0x0600A142 RID: 41282 RVA: 0x00258114 File Offset: 0x00256314
[Token(Token = "0x600A142")]
[Address(RVA = "0x1C73E20", Offset = "0x1C72820", VA = "0x181C73E20")]
public CmsCompressedData Generate(CmsProcessable content, string compressionOid)
{
Platform.Dispose(new ZOutputStream(new MemoryStream(), -1));
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(new DerObjectIdentifier(compressionOid));
BerOctetString berOctetString;
ContentInfo contentInfo = new ContentInfo(CmsObjectIdentifiers.Data, berOctetString);
DerObjectIdentifier compressedData = CmsObjectIdentifiers.CompressedData;
CompressedData compressedData2 = new CompressedData(algorithmIdentifier, contentInfo);
ContentInfo contentInfo2 = new ContentInfo(compressedData, compressedData2);
CmsCompressedData cmsCompressedData;
cmsCompressedData.contentInfo = contentInfo2;
return cmsCompressedData;
}
// Token: 0x04006A2A RID: 27178
[Token(Token = "0x4006A2A")]
public const string ZLib = "1.2.840.113549.1.9.16.3.8";
}
}
@@ -0,0 +1,61 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001752 RID: 5970
[Token(Token = "0x2001752")]
[StructLayout(3)]
public class CmsCompressedDataParser : CmsContentInfoParser
{
// Token: 0x0600A143 RID: 41283 RVA: 0x0025817C File Offset: 0x0025637C
[Token(Token = "0x600A143")]
[Address(RVA = "0x1C74280", Offset = "0x1C72C80", VA = "0x181C74280")]
public CmsCompressedDataParser(byte[] compressedData)
{
int num;
MemoryStream memoryStream = new MemoryStream(compressedData, num != 0);
num = 0;
base..ctor(memoryStream);
}
// Token: 0x0600A144 RID: 41284 RVA: 0x0025819C File Offset: 0x0025639C
[Token(Token = "0x600A144")]
[Address(RVA = "0x1C742F0", Offset = "0x1C72CF0", VA = "0x181C742F0")]
public CmsCompressedDataParser(Stream compressedData)
: base(compressedData)
{
}
// Token: 0x0600A145 RID: 41285 RVA: 0x002581B0 File Offset: 0x002563B0
[Token(Token = "0x600A145")]
[Address(RVA = "0x1C74080", Offset = "0x1C72A80", VA = "0x181C74080")]
public CmsTypedStream GetContent()
{
if (this.contentInfo.GetContent(16) == 0)
{
}
CompressedDataParser compressedDataParser;
if (compressedDataParser == 0)
{
throw new NullReferenceException();
}
ContentInfoParser encapContentInfo = compressedDataParser._encapContentInfo;
IAsn1Convertible content = encapContentInfo.GetContent(4);
if (content == 0)
{
}
if (content != 0)
{
int hashCode = encapContentInfo.contentType.GetHashCode();
CmsTypedStream cmsTypedStream;
return cmsTypedStream;
}
throw new NullReferenceException();
}
}
}
@@ -0,0 +1,143 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001753 RID: 5971
[Token(Token = "0x2001753")]
[StructLayout(3)]
public class CmsCompressedDataStreamGenerator
{
// Token: 0x0600A146 RID: 41286 RVA: 0x00258214 File Offset: 0x00256414
[Token(Token = "0x600A146")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public CmsCompressedDataStreamGenerator()
{
}
// Token: 0x0600A147 RID: 41287 RVA: 0x00258228 File Offset: 0x00256428
[Token(Token = "0x600A147")]
[Address(RVA = "0x3C1C90", Offset = "0x3C0690", VA = "0x1803C1C90")]
public void SetBufferSize(int bufferSize)
{
this._bufferSize = bufferSize;
}
// Token: 0x0600A148 RID: 41288 RVA: 0x0025823C File Offset: 0x0025643C
[Token(Token = "0x600A148")]
[Address(RVA = "0x1C74300", Offset = "0x1C72D00", VA = "0x181C74300")]
public Stream Open(Stream outStream, string compressionOID)
{
string identifier = CmsObjectIdentifiers.Data.identifier;
return this.Open(outStream, identifier, compressionOID);
}
// Token: 0x0600A149 RID: 41289 RVA: 0x00258264 File Offset: 0x00256464
[Token(Token = "0x600A149")]
[Address(RVA = "0x1C743A0", Offset = "0x1C72DA0", VA = "0x181C743A0")]
public Stream Open(Stream outStream, string contentOID, string compressionOID)
{
BerSequenceGenerator berSequenceGenerator = new BerSequenceGenerator(outStream);
string text = berSequenceGenerator.ToString();
int num;
DerInteger derInteger = new DerInteger(num);
num = 0;
BerSequenceGenerator berSequenceGenerator2;
string text2 = berSequenceGenerator2.ToString();
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(new DerObjectIdentifier("1.2.840.113549.1.9.16.3.8"));
string text3 = berSequenceGenerator2.ToString();
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(contentOID);
BerSequenceGenerator berSequenceGenerator3;
string text4 = berSequenceGenerator3.ToString();
Stream stream;
ZOutputStream zoutputStream = new ZOutputStream(stream, -1);
CmsCompressedDataStreamGenerator.CmsCompressedOutputStream cmsCompressedOutputStream;
cmsCompressedOutputStream._out = zoutputStream;
cmsCompressedOutputStream._cGen = berSequenceGenerator2;
cmsCompressedOutputStream._eiGen = berSequenceGenerator3;
cmsCompressedOutputStream._sGen = berSequenceGenerator;
throw new NullReferenceException();
}
// Token: 0x04006A2B RID: 27179
[Token(Token = "0x4006A2B")]
public const string ZLib = "1.2.840.113549.1.9.16.3.8";
// Token: 0x04006A2C RID: 27180
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A2C")]
private int _bufferSize;
// Token: 0x02001754 RID: 5972
[Token(Token = "0x2001754")]
private class CmsCompressedOutputStream : BaseOutputStream
{
// Token: 0x0600A14A RID: 41290 RVA: 0x002582F0 File Offset: 0x002564F0
[Token(Token = "0x600A14A")]
[Address(RVA = "0x1C74BF0", Offset = "0x1C735F0", VA = "0x181C74BF0")]
internal CmsCompressedOutputStream(ZOutputStream outStream, BerSequenceGenerator sGen, BerSequenceGenerator cGen, BerSequenceGenerator eiGen)
{
this._out = outStream;
this._cGen = cGen;
this._eiGen = 0;
this._sGen = sGen;
}
// Token: 0x0600A14B RID: 41291 RVA: 0x00258320 File Offset: 0x00256520
[Token(Token = "0x600A14B")]
[Address(RVA = "0x1C720D0", Offset = "0x1C70AD0", VA = "0x181C720D0", Slot = "30")]
public override void WriteByte(byte b)
{
((IDisposable)this._out).Dispose();
}
// Token: 0x0600A14C RID: 41292 RVA: 0x00258340 File Offset: 0x00256540
[Token(Token = "0x600A14C")]
[Address(RVA = "0x1C72100", Offset = "0x1C70B00", VA = "0x181C72100", Slot = "29")]
public override void Write(byte[] bytes, int off, int len)
{
int num = this._out.Read(bytes, off, len);
}
// Token: 0x0600A14D RID: 41293 RVA: 0x00258364 File Offset: 0x00256564
[Token(Token = "0x600A14D")]
[Address(RVA = "0x1C74B30", Offset = "0x1C73530", VA = "0x181C74B30", Slot = "15")]
public override void Close()
{
Platform.Dispose(this._out);
Stream rawOutputStream = this._eiGen.GetRawOutputStream();
Stream rawOutputStream2 = this._cGen.GetRawOutputStream();
Stream rawOutputStream3 = this._sGen.GetRawOutputStream();
base.Close();
}
// Token: 0x04006A2D RID: 27181
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006A2D")]
private ZOutputStream _out;
// Token: 0x04006A2E RID: 27182
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006A2E")]
private BerSequenceGenerator _sGen;
// Token: 0x04006A2F RID: 27183
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006A2F")]
private BerSequenceGenerator _cGen;
// Token: 0x04006A30 RID: 27184
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006A30")]
private BerSequenceGenerator _eiGen;
}
}
}
@@ -0,0 +1,57 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001755 RID: 5973
[Token(Token = "0x2001755")]
[StructLayout(3)]
public class CmsContentInfoParser
{
// Token: 0x0600A14E RID: 41294 RVA: 0x002583AC File Offset: 0x002565AC
[Token(Token = "0x600A14E")]
[Address(RVA = "0x1C74CB0", Offset = "0x1C736B0", VA = "0x181C74CB0")]
protected CmsContentInfoParser(Stream data)
{
do
{
base..ctor();
}
while (data == 0);
this.data = data;
if (new Asn1StreamParser(data).ToString() == 0)
{
}
ContentInfoParser contentInfoParser;
if (contentInfoParser != 0)
{
this.contentInfo = contentInfoParser;
return;
}
throw new NullReferenceException();
}
// Token: 0x0600A14F RID: 41295 RVA: 0x002583F8 File Offset: 0x002565F8
[Token(Token = "0x600A14F")]
[Address(RVA = "0x1C74C50", Offset = "0x1C73650", VA = "0x181C74C50")]
public void Close()
{
Platform.Dispose(this.data);
}
// Token: 0x04006A31 RID: 27185
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A31")]
protected ContentInfoParser contentInfo;
// Token: 0x04006A32 RID: 27186
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A32")]
protected Stream data;
}
}
@@ -0,0 +1,144 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001756 RID: 5974
[Token(Token = "0x2001756")]
[StructLayout(3)]
public class CmsEnvelopedData
{
// Token: 0x0600A150 RID: 41296 RVA: 0x00258410 File Offset: 0x00256610
[Token(Token = "0x600A150")]
[Address(RVA = "0x1C77070", Offset = "0x1C75A70", VA = "0x181C77070")]
public CmsEnvelopedData(byte[] envelopedData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(envelopedData));
}
// Token: 0x0600A151 RID: 41297 RVA: 0x0025842C File Offset: 0x0025662C
[Token(Token = "0x600A151")]
[Address(RVA = "0x1C76EB0", Offset = "0x1C758B0", VA = "0x181C76EB0")]
public CmsEnvelopedData(Stream envelopedData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(envelopedData, int.MaxValue));
}
// Token: 0x0600A152 RID: 41298 RVA: 0x0025844C File Offset: 0x0025664C
[Token(Token = "0x600A152")]
[Address(RVA = "0x1C76F30", Offset = "0x1C75930", VA = "0x181C76F30")]
public CmsEnvelopedData(ContentInfo contentInfo)
{
this.contentInfo = contentInfo;
EnvelopedData instance = EnvelopedData.GetInstance(contentInfo.content);
Asn1Set recipientInfos = instance.recipientInfos;
EncryptedContentInfo encryptedContentInfo = instance.encryptedContentInfo;
AlgorithmIdentifier contentEncryptionAlgorithm = encryptedContentInfo.contentEncryptionAlgorithm;
this.encAlg = contentEncryptionAlgorithm;
Stream octetStream = encryptedContentInfo.encryptedContent.GetOctetStream();
CmsProcessableByteArray cmsProcessableByteArray;
cmsProcessableByteArray.bytes = octetStream;
AlgorithmIdentifier algorithmIdentifier = this.encAlg;
CmsEnvelopedHelper.CmsEnvelopedSecureReadable cmsEnvelopedSecureReadable;
cmsEnvelopedSecureReadable.readable = cmsProcessableByteArray;
cmsEnvelopedSecureReadable.algorithm = algorithmIdentifier;
RecipientInformationStore recipientInformationStore = CmsEnvelopedHelper.BuildRecipientInformationStore(recipientInfos, cmsEnvelopedSecureReadable);
this.recipientInfoStore = recipientInformationStore;
Asn1Set unprotectedAttrs = instance.unprotectedAttrs;
this.unprotectedAttributes = unprotectedAttrs;
}
// Token: 0x1700194D RID: 6477
// (get) Token: 0x0600A153 RID: 41299 RVA: 0x002584E8 File Offset: 0x002566E8
[Token(Token = "0x1700194D")]
public AlgorithmIdentifier EncryptionAlgorithmID
{
[Token(Token = "0x600A153")]
[Address(RVA = "0x3C1220", Offset = "0x3BFC20", VA = "0x1803C1220")]
get
{
return this.encAlg;
}
}
// Token: 0x1700194E RID: 6478
// (get) Token: 0x0600A154 RID: 41300 RVA: 0x002584FC File Offset: 0x002566FC
[Token(Token = "0x1700194E")]
public string EncryptionAlgOid
{
[Token(Token = "0x600A154")]
[Address(RVA = "0x668A50", Offset = "0x667450", VA = "0x180668A50")]
get
{
Asn1Object asn1Object = this.encAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x0600A155 RID: 41301 RVA: 0x0025851C File Offset: 0x0025671C
[Token(Token = "0x600A155")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0")]
public RecipientInformationStore GetRecipientInfos()
{
return this.recipientInfoStore;
}
// Token: 0x1700194F RID: 6479
// (get) Token: 0x0600A156 RID: 41302 RVA: 0x00258530 File Offset: 0x00256730
[Token(Token = "0x1700194F")]
public ContentInfo ContentInfo
{
[Token(Token = "0x600A156")]
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240")]
get
{
return this.contentInfo;
}
}
// Token: 0x0600A157 RID: 41303 RVA: 0x00258544 File Offset: 0x00256744
[Token(Token = "0x600A157")]
[Address(RVA = "0x1C76E40", Offset = "0x1C75840", VA = "0x181C76E40")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable GetUnprotectedAttributes()
{
Asn1Set asn1Set = this.unprotectedAttributes;
if (asn1Set != 0)
{
return new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(asn1Set);
}
}
// Token: 0x0600A158 RID: 41304 RVA: 0x00258564 File Offset: 0x00256764
[Token(Token = "0x600A158")]
[Address(RVA = "0x1C73790", Offset = "0x1C72190", VA = "0x181C73790")]
public byte[] GetEncoded()
{
return this.contentInfo.GetEncoded();
}
// Token: 0x04006A33 RID: 27187
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A33")]
internal RecipientInformationStore recipientInfoStore;
// Token: 0x04006A34 RID: 27188
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A34")]
internal ContentInfo contentInfo;
// Token: 0x04006A35 RID: 27189
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006A35")]
private AlgorithmIdentifier encAlg;
// Token: 0x04006A36 RID: 27190
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006A36")]
private Asn1Set unprotectedAttributes;
}
}
@@ -0,0 +1,122 @@
using System;
using System.Collections;
using System.IO;
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.Crypto.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001757 RID: 5975
[Token(Token = "0x2001757")]
[StructLayout(3)]
public class CmsEnvelopedDataGenerator : CmsEnvelopedGenerator
{
// Token: 0x0600A159 RID: 41305 RVA: 0x00258584 File Offset: 0x00256784
[Token(Token = "0x600A159")]
[Address(RVA = "0x1C757F0", Offset = "0x1C741F0", VA = "0x181C757F0")]
public CmsEnvelopedDataGenerator()
{
}
// Token: 0x0600A15A RID: 41306 RVA: 0x00258598 File Offset: 0x00256798
[Token(Token = "0x600A15A")]
[Address(RVA = "0x1C75850", Offset = "0x1C74250", VA = "0x181C75850")]
public CmsEnvelopedDataGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this.recipientInfoGenerators = list;
base..ctor();
this.rand = rand;
}
// Token: 0x0600A15B RID: 41307 RVA: 0x002585C4 File Offset: 0x002567C4
[Token(Token = "0x600A15B")]
[Address(RVA = "0x1C750B0", Offset = "0x1C73AB0", VA = "0x181C750B0")]
private CmsEnvelopedData Generate(CmsProcessable content, string encryptionOid, CipherKeyGenerator keyGen)
{
Asn1EncodableVector asn1EncodableVector;
for (;;)
{
byte[] array = keyGen.GenerateKey();
KeyParameter keyParameter = ParameterUtilities.CreateKeyParameter(encryptionOid, array);
string text = this.ToString();
IBufferedCipher cipher = CipherUtilities.GetCipher(encryptionOid);
SecureRandom rand = this.rand;
ParametersWithRandom parametersWithRandom = new ParametersWithRandom(keyParameter, rand);
int num;
CipherStream cipherStream = new CipherStream(new MemoryStream(), num, cipher);
num = 0;
Platform.Dispose(cipherStream);
IList recipientInfoGenerators = this.recipientInfoGenerators;
if (asn1EncodableVector != 0)
{
break;
}
int num2 = 0;
ArrayTypeMismatchException ex;
if (ex != 0)
{
}
if (num2 != -1)
{
}
if (num2 == 0)
{
goto Block_2;
}
}
if (asn1EncodableVector == 0)
{
}
if (asn1EncodableVector != 0)
{
Asn1Encodable[] array2 = new Asn1Encodable[1];
SecureRandom rand2 = this.rand;
throw new ArrayTypeMismatchException();
}
throw new NullReferenceException();
Block_2:
if (this.unprotectedAttributeGenerator != 0)
{
IDictionary dictionary = Platform.CreateHashtable();
Asn1EncodableVector asn1EncodableVector2;
BerSet berSet = new BerSet(asn1EncodableVector2);
}
DerObjectIdentifier envelopedData = CmsObjectIdentifiers.EnvelopedData;
DerSet derSet = new DerSet(asn1EncodableVector);
EnvelopedData envelopedData2;
return new CmsEnvelopedData(new ContentInfo(envelopedData, envelopedData2));
}
// Token: 0x0600A15C RID: 41308 RVA: 0x00258700 File Offset: 0x00256900
[Token(Token = "0x600A15C")]
[Address(RVA = "0x1C74E50", Offset = "0x1C73850", VA = "0x181C74E50")]
public CmsEnvelopedData Generate(CmsProcessable content, string encryptionOid)
{
CipherKeyGenerator keyGenerator = GeneratorUtilities.GetKeyGenerator(encryptionOid);
SecureRandom rand = this.rand;
int defaultStrength = keyGenerator.defaultStrength;
KeyGenerationParameters keyGenerationParameters = new KeyGenerationParameters(rand, defaultStrength);
keyGenerator.Init(keyGenerationParameters);
return this.Generate(content, encryptionOid, keyGenerator);
}
// Token: 0x0600A15D RID: 41309 RVA: 0x00258740 File Offset: 0x00256940
[Token(Token = "0x600A15D")]
[Address(RVA = "0x1C74F80", Offset = "0x1C73980", VA = "0x181C74F80")]
public CmsEnvelopedData Generate(CmsProcessable content, string encryptionOid, int keySize)
{
CipherKeyGenerator keyGenerator = GeneratorUtilities.GetKeyGenerator(encryptionOid);
KeyGenerationParameters keyGenerationParameters = new KeyGenerationParameters(this.rand, keySize);
keyGenerator.Init(keyGenerationParameters);
return this.Generate(content, encryptionOid, keyGenerator);
}
}
}
@@ -0,0 +1,188 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001758 RID: 5976
[Token(Token = "0x2001758")]
[StructLayout(3)]
public class CmsEnvelopedDataParser : CmsContentInfoParser
{
// Token: 0x0600A15E RID: 41310 RVA: 0x00258778 File Offset: 0x00256978
[Token(Token = "0x600A15E")]
[Address(RVA = "0x1C75DE0", Offset = "0x1C747E0", VA = "0x181C75DE0")]
public CmsEnvelopedDataParser(byte[] envelopedData)
{
int num;
MemoryStream memoryStream = new MemoryStream(envelopedData, num != 0);
num = 0;
}
// Token: 0x0600A15F RID: 41311 RVA: 0x00258790 File Offset: 0x00256990
[Token(Token = "0x600A15F")]
[Address(RVA = "0x1C75E50", Offset = "0x1C74850", VA = "0x181C75E50")]
public CmsEnvelopedDataParser(Stream envelopedData)
{
IAsn1Convertible encryptedContent;
for (;;)
{
base..ctor(envelopedData);
ContentInfoParser contentInfo = this.contentInfo;
this._attrNotRead = true;
if (contentInfo.GetContent(16) == 0)
{
}
EnvelopedDataParser envelopedDataParser;
if (envelopedDataParser != 0)
{
this.envelopedData = envelopedDataParser;
Asn1SetParser recipientInfos = envelopedDataParser.GetRecipientInfos();
EncryptedContentInfoParser encryptedContentInfo = this.envelopedData.GetEncryptedContentInfo();
AlgorithmIdentifier contentEncryptionAlgorithm = encryptedContentInfo._contentEncryptionAlgorithm;
this._encAlg = contentEncryptionAlgorithm;
encryptedContent = encryptedContentInfo.GetEncryptedContent(4);
if (encryptedContent != 0 && encryptedContent != 0)
{
break;
}
}
}
CmsProcessableInputStream cmsProcessableInputStream;
cmsProcessableInputStream.input = encryptedContent;
AlgorithmIdentifier encAlg = this._encAlg;
CmsEnvelopedHelper.CmsEnvelopedSecureReadable cmsEnvelopedSecureReadable;
cmsEnvelopedSecureReadable.algorithm = encAlg;
cmsEnvelopedSecureReadable.readable = cmsProcessableInputStream;
Asn1Set asn1Set;
RecipientInformationStore recipientInformationStore = CmsEnvelopedHelper.BuildRecipientInformationStore(asn1Set, cmsEnvelopedSecureReadable);
this.recipientInfoStore = recipientInformationStore;
}
// Token: 0x17001950 RID: 6480
// (get) Token: 0x0600A160 RID: 41312 RVA: 0x0025883C File Offset: 0x00256A3C
[Token(Token = "0x17001950")]
public AlgorithmIdentifier EncryptionAlgorithmID
{
[Token(Token = "0x600A160")]
[Address(RVA = "0x3C1250", Offset = "0x3BFC50", VA = "0x1803C1250")]
get
{
return this._encAlg;
}
}
// Token: 0x17001951 RID: 6481
// (get) Token: 0x0600A161 RID: 41313 RVA: 0x00258850 File Offset: 0x00256A50
[Token(Token = "0x17001951")]
public string EncryptionAlgOid
{
[Token(Token = "0x600A161")]
[Address(RVA = "0x1C72A70", Offset = "0x1C71470", VA = "0x181C72A70")]
get
{
Asn1Object asn1Object = this._encAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001952 RID: 6482
// (get) Token: 0x0600A162 RID: 41314 RVA: 0x00258870 File Offset: 0x00256A70
[Token(Token = "0x17001952")]
public Asn1Object EncryptionAlgParams
{
[Token(Token = "0x600A162")]
[Address(RVA = "0x1C72AB0", Offset = "0x1C714B0", VA = "0x181C72AB0")]
get
{
DerObjectIdentifier objectID = this._encAlg.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600A163 RID: 41315 RVA: 0x0025889C File Offset: 0x00256A9C
[Token(Token = "0x600A163")]
[Address(RVA = "0x3C1220", Offset = "0x3BFC20", VA = "0x1803C1220")]
public RecipientInformationStore GetRecipientInfos()
{
return this.recipientInfoStore;
}
// Token: 0x0600A164 RID: 41316 RVA: 0x002588B0 File Offset: 0x00256AB0
[Token(Token = "0x600A164")]
[Address(RVA = "0x1C75B20", Offset = "0x1C74520", VA = "0x181C75B20")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable GetUnprotectedAttributes()
{
while (this._unprotectedAttributes == (ulong)0L && this._attrNotRead)
{
Asn1SetParser unprotectedAttrs = this.envelopedData.GetUnprotectedAttrs();
this._attrNotRead = false;
if (unprotectedAttrs != 0)
{
int num = 0;
int num2 = 0;
if (num2 < num)
{
num2 += num2;
num2++;
}
Asn1EncodableVector asn1EncodableVector;
if (asn1EncodableVector != 0)
{
if (asn1EncodableVector == 0)
{
continue;
}
Asn1Encodable[] array = new Asn1Encodable[1];
num2 += num2;
num2++;
if (num2 != 0)
{
}
array[0] = num2;
asn1EncodableVector.Add(array);
array += array;
array += array;
}
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(new DerSet(asn1EncodableVector));
this._unprotectedAttributes = attributeTable;
break;
}
break;
}
return this._unprotectedAttributes;
}
// Token: 0x04006A37 RID: 27191
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006A37")]
internal RecipientInformationStore recipientInfoStore;
// Token: 0x04006A38 RID: 27192
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006A38")]
internal EnvelopedDataParser envelopedData;
// Token: 0x04006A39 RID: 27193
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006A39")]
private AlgorithmIdentifier _encAlg;
// Token: 0x04006A3A RID: 27194
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006A3A")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable _unprotectedAttributes;
// Token: 0x04006A3B RID: 27195
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006A3B")]
private bool _attrNotRead;
}
}
@@ -0,0 +1,308 @@
using System;
using System.Collections;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001759 RID: 5977
[Token(Token = "0x2001759")]
[StructLayout(3)]
public class CmsEnvelopedDataStreamGenerator : CmsEnvelopedGenerator
{
// Token: 0x0600A165 RID: 41317 RVA: 0x00258960 File Offset: 0x00256B60
[Token(Token = "0x600A165")]
[Address(RVA = "0x1C76CC0", Offset = "0x1C756C0", VA = "0x181C76CC0")]
public CmsEnvelopedDataStreamGenerator()
{
}
// Token: 0x0600A166 RID: 41318 RVA: 0x00258974 File Offset: 0x00256B74
[Token(Token = "0x600A166")]
[Address(RVA = "0x1C76D20", Offset = "0x1C75720", VA = "0x181C76D20")]
public CmsEnvelopedDataStreamGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this.recipientInfoGenerators = list;
base..ctor();
this.rand = rand;
}
// Token: 0x0600A167 RID: 41319 RVA: 0x002589A0 File Offset: 0x00256BA0
[Token(Token = "0x600A167")]
[Address(RVA = "0x3D4040", Offset = "0x3D2A40", VA = "0x1803D4040")]
public void SetBufferSize(int bufferSize)
{
this._bufferSize = bufferSize;
}
// Token: 0x0600A168 RID: 41320 RVA: 0x002589B4 File Offset: 0x00256BB4
[Token(Token = "0x600A168")]
[Address(RVA = "0x683A70", Offset = "0x682470", VA = "0x180683A70")]
public void SetBerEncodeRecipients(bool berEncodeRecipientSet)
{
this._berEncodeRecipientSet = berEncodeRecipientSet;
}
// Token: 0x17001953 RID: 6483
// (get) Token: 0x0600A169 RID: 41321 RVA: 0x002589C8 File Offset: 0x00256BC8
[Token(Token = "0x17001953")]
private DerInteger Version
{
[Token(Token = "0x600A169")]
[Address(RVA = "0x1C76DD0", Offset = "0x1C757D0", VA = "0x181C76DD0")]
get
{
if (this._originatorInfo != (ulong)0L || this._unprotectedAttributes == (ulong)0L)
{
}
return new DerInteger(2);
}
}
// Token: 0x0600A16A RID: 41322 RVA: 0x002589F4 File Offset: 0x00256BF4
[Token(Token = "0x600A16A")]
[Address(RVA = "0x1C76920", Offset = "0x1C75320", VA = "0x181C76920")]
private Stream Open(Stream outStream, string encryptionOid, CipherKeyGenerator keyGen)
{
Asn1EncodableVector asn1EncodableVector;
for (;;)
{
byte[] array = keyGen.GenerateKey();
KeyParameter keyParameter = ParameterUtilities.CreateKeyParameter(encryptionOid, array);
string text = this.ToString();
IList recipientInfoGenerators = this.recipientInfoGenerators;
if (asn1EncodableVector != 0)
{
break;
}
int num = 0;
int num2 = 0;
ArrayTypeMismatchException ex;
if (ex != 0)
{
}
if (num != -1)
{
}
if (num2 == 0)
{
Stream stream;
return stream;
}
}
if (asn1EncodableVector == 0)
{
}
if (asn1EncodableVector != 0)
{
Asn1Encodable[] array2 = new Asn1Encodable[1];
SecureRandom rand = this.rand;
throw new ArrayTypeMismatchException();
}
throw new NullReferenceException();
}
// Token: 0x0600A16B RID: 41323 RVA: 0x00258AB4 File Offset: 0x00256CB4
[Token(Token = "0x600A16B")]
[Address(RVA = "0x1C76080", Offset = "0x1C74A80", VA = "0x181C76080")]
private Stream Open(Stream outStream, AlgorithmIdentifier encAlgID, ICipherParameters cipherParameters, Asn1EncodableVector recipientInfos)
{
int num = 0;
BerSequenceGenerator berSequenceGenerator = new BerSequenceGenerator(outStream);
string text = berSequenceGenerator.ToString();
if (this._originatorInfo != (ulong)0L || this._unprotectedAttributes != (ulong)0L)
{
}
DerInteger derInteger = new DerInteger(num);
BerSequenceGenerator berSequenceGenerator2;
string text2 = berSequenceGenerator2.ToString();
if (this._berEncodeRecipientSet)
{
}
IEnumerator enumerator;
DerSetGenerator derSetGenerator;
string text3;
if (enumerator != 0)
{
if (num < enumerator)
{
num += num;
num++;
}
if (enumerator == 0)
{
num += num;
}
if (enumerator == 0)
{
throw new NullReferenceException();
}
text3 = derSetGenerator.ToString();
}
if (text3 != 0)
{
}
if (num != -1)
{
}
if (num == 0)
{
Stream rawOutputStream = derSetGenerator.GetRawOutputStream();
BerSequenceGenerator berSequenceGenerator3;
string text4 = berSequenceGenerator3.ToString();
string text5 = berSequenceGenerator3.ToString();
BerOctetStringGenerator berOctetStringGenerator;
Stream rawOutputStream2 = berOctetStringGenerator.GetRawOutputStream();
Stream stream;
int num2;
IBufferedCipher bufferedCipher;
CipherStream cipherStream = new CipherStream(stream, num2, bufferedCipher);
num2 = 0;
CmsEnvelopedDataStreamGenerator.CmsEnvelopedDataOutputStream cmsEnvelopedDataOutputStream;
cmsEnvelopedDataOutputStream._outer = cmsEnvelopedDataOutputStream;
cmsEnvelopedDataOutputStream._out = cipherStream;
cmsEnvelopedDataOutputStream._cGen = berSequenceGenerator;
cmsEnvelopedDataOutputStream._envGen = cmsEnvelopedDataOutputStream;
cmsEnvelopedDataOutputStream._eiGen = berSequenceGenerator3;
CmsException ex = new CmsException("exception decoding algorithm parameters.", num2);
throw new NullReferenceException();
}
throw new NullReferenceException();
}
// Token: 0x0600A16C RID: 41324 RVA: 0x00258BF8 File Offset: 0x00256DF8
[Token(Token = "0x600A16C")]
[Address(RVA = "0x1C76740", Offset = "0x1C75140", VA = "0x181C76740")]
public Stream Open(Stream outStream, string encryptionOid)
{
CipherKeyGenerator keyGenerator = GeneratorUtilities.GetKeyGenerator(encryptionOid);
SecureRandom rand = this.rand;
int defaultStrength = keyGenerator.defaultStrength;
KeyGenerationParameters keyGenerationParameters = new KeyGenerationParameters(rand, defaultStrength);
keyGenerator.Init(keyGenerationParameters);
return this.Open(outStream, encryptionOid, keyGenerator);
}
// Token: 0x0600A16D RID: 41325 RVA: 0x00258C38 File Offset: 0x00256E38
[Token(Token = "0x600A16D")]
[Address(RVA = "0x1C76830", Offset = "0x1C75230", VA = "0x181C76830")]
public Stream Open(Stream outStream, string encryptionOid, int keySize)
{
CipherKeyGenerator keyGenerator = GeneratorUtilities.GetKeyGenerator(encryptionOid);
KeyGenerationParameters keyGenerationParameters = new KeyGenerationParameters(this.rand, keySize);
keyGenerator.Init(keyGenerationParameters);
return this.Open(outStream, encryptionOid, keyGenerator);
}
// Token: 0x04006A3C RID: 27196
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006A3C")]
private object _originatorInfo;
// Token: 0x04006A3D RID: 27197
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006A3D")]
private object _unprotectedAttributes;
// Token: 0x04006A3E RID: 27198
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006A3E")]
private int _bufferSize;
// Token: 0x04006A3F RID: 27199
[global::Cpp2IlInjected.FieldOffset(Offset = "0x3C")]
[Token(Token = "0x4006A3F")]
private bool _berEncodeRecipientSet;
// Token: 0x0200175A RID: 5978
[Token(Token = "0x200175A")]
private class CmsEnvelopedDataOutputStream : BaseOutputStream
{
// Token: 0x0600A16E RID: 41326 RVA: 0x00258C70 File Offset: 0x00256E70
[Token(Token = "0x600A16E")]
[Address(RVA = "0x1C72130", Offset = "0x1C70B30", VA = "0x181C72130")]
public CmsEnvelopedDataOutputStream(CmsEnvelopedGenerator outer, CipherStream outStream, BerSequenceGenerator cGen, BerSequenceGenerator envGen, BerSequenceGenerator eiGen)
{
this._envGen = 0;
this._outer = outer;
this._cGen = cGen;
this._eiGen = 0;
this._out = outStream;
}
// Token: 0x0600A16F RID: 41327 RVA: 0x00258CA8 File Offset: 0x00256EA8
[Token(Token = "0x600A16F")]
[Address(RVA = "0x1C75AC0", Offset = "0x1C744C0", VA = "0x181C75AC0", Slot = "30")]
public override void WriteByte(byte b)
{
((IDisposable)this._out).Dispose();
}
// Token: 0x0600A170 RID: 41328 RVA: 0x00258CC8 File Offset: 0x00256EC8
[Token(Token = "0x600A170")]
[Address(RVA = "0x1C75AF0", Offset = "0x1C744F0", VA = "0x181C75AF0", Slot = "29")]
public override void Write(byte[] bytes, int off, int len)
{
int num = this._out.Read(bytes, off, len);
}
// Token: 0x0600A171 RID: 41329 RVA: 0x00258CEC File Offset: 0x00256EEC
[Token(Token = "0x600A171")]
[Address(RVA = "0x1C75900", Offset = "0x1C74300", VA = "0x181C75900", Slot = "15")]
public override void Close()
{
Platform.Dispose(this._out);
Stream rawOutputStream = this._eiGen.GetRawOutputStream();
if (this._outer.unprotectedAttributeGenerator != 0)
{
IDictionary dictionary = Platform.CreateHashtable();
Asn1EncodableVector asn1EncodableVector;
BerSet berSet = new BerSet(asn1EncodableVector);
BerSequenceGenerator envGen = this._envGen;
int num;
DerTaggedObject derTaggedObject = new DerTaggedObject(num != 0, 1, berSet);
num = 0;
string text = envGen.ToString();
}
Stream rawOutputStream2 = this._envGen.GetRawOutputStream();
Stream rawOutputStream3 = this._cGen.GetRawOutputStream();
base.Close();
}
// Token: 0x04006A40 RID: 27200
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006A40")]
private readonly CmsEnvelopedGenerator _outer;
// Token: 0x04006A41 RID: 27201
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006A41")]
private readonly CipherStream _out;
// Token: 0x04006A42 RID: 27202
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006A42")]
private readonly BerSequenceGenerator _cGen;
// Token: 0x04006A43 RID: 27203
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006A43")]
private readonly BerSequenceGenerator _envGen;
// Token: 0x04006A44 RID: 27204
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
[Token(Token = "0x4006A44")]
private readonly BerSequenceGenerator _eiGen;
}
}
}
@@ -0,0 +1,368 @@
using System;
using System.Collections;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Kisa;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ntt;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
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.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200175B RID: 5979
[Token(Token = "0x200175B")]
[StructLayout(3)]
public class CmsEnvelopedGenerator
{
// Token: 0x0600A172 RID: 41330 RVA: 0x00258D74 File Offset: 0x00256F74
[Token(Token = "0x600A172")]
[Address(RVA = "0x1C78190", Offset = "0x1C76B90", VA = "0x181C78190")]
public CmsEnvelopedGenerator()
{
SecureRandom secureRandom = new SecureRandom();
IList list = Platform.CreateArrayList();
this.recipientInfoGenerators = list;
base..ctor();
this.rand = secureRandom;
}
// Token: 0x0600A173 RID: 41331 RVA: 0x00258DA4 File Offset: 0x00256FA4
[Token(Token = "0x600A173")]
[Address(RVA = "0x1C78120", Offset = "0x1C76B20", VA = "0x181C78120")]
public CmsEnvelopedGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this.recipientInfoGenerators = list;
base..ctor();
this.rand = rand;
}
// Token: 0x17001954 RID: 6484
// (get) Token: 0x0600A174 RID: 41332 RVA: 0x00258DD0 File Offset: 0x00256FD0
// (set) Token: 0x0600A175 RID: 41333 RVA: 0x00258DE4 File Offset: 0x00256FE4
[Token(Token = "0x17001954")]
public CmsAttributeTableGenerator UnprotectedAttributeGenerator
{
[Token(Token = "0x600A174")]
[Address(RVA = "0x3C1220", Offset = "0x3BFC20", VA = "0x1803C1220")]
get
{
return this.unprotectedAttributeGenerator;
}
[Token(Token = "0x600A175")]
[Address(RVA = "0x3C1260", Offset = "0x3BFC60", VA = "0x1803C1260")]
set
{
this.unprotectedAttributeGenerator = value;
}
}
// Token: 0x0600A176 RID: 41334 RVA: 0x00258DF8 File Offset: 0x00256FF8
[Token(Token = "0x600A176")]
[Address(RVA = "0x1C77740", Offset = "0x1C76140", VA = "0x181C77740")]
public void AddKeyTransRecipient(X509Certificate cert)
{
new KeyTransRecipientInfoGenerator().RecipientCert = cert;
IList list = this.recipientInfoGenerators;
throw new NullReferenceException();
}
// Token: 0x0600A177 RID: 41335 RVA: 0x00258E1C File Offset: 0x0025701C
[Token(Token = "0x600A177")]
[Address(RVA = "0x1C77680", Offset = "0x1C76080", VA = "0x181C77680")]
public void AddKeyTransRecipient(AsymmetricKeyParameter pubKey, byte[] subKeyId)
{
KeyTransRecipientInfoGenerator keyTransRecipientInfoGenerator = new KeyTransRecipientInfoGenerator();
keyTransRecipientInfoGenerator.RecipientPublicKey = pubKey;
DerOctetString derOctetString = new DerOctetString(subKeyId);
keyTransRecipientInfoGenerator.subjectKeyIdentifier = derOctetString;
IList list = this.recipientInfoGenerators;
throw new NullReferenceException();
}
// Token: 0x0600A178 RID: 41336 RVA: 0x00258E50 File Offset: 0x00257050
[Token(Token = "0x600A178")]
[Address(RVA = "0x1C770F0", Offset = "0x1C75AF0", VA = "0x181C770F0")]
public void AddKekRecipient(string keyAlgorithm, KeyParameter key, byte[] keyIdentifier)
{
int num;
int num2;
KekIdentifier kekIdentifier = new KekIdentifier(keyIdentifier, num, num2);
num2 = 0;
num = 0;
KekRecipientInfoGenerator kekRecipientInfoGenerator = new KekRecipientInfoGenerator();
kekRecipientInfoGenerator.kekIdentifier = kekIdentifier;
kekRecipientInfoGenerator.keyEncryptionKeyOID = keyAlgorithm;
kekRecipientInfoGenerator.KeyEncryptionKey = key;
IList list = this.recipientInfoGenerators;
throw new NullReferenceException();
}
// Token: 0x0600A179 RID: 41337 RVA: 0x00258E98 File Offset: 0x00257098
[Token(Token = "0x600A179")]
[Address(RVA = "0x1C771F0", Offset = "0x1C75BF0", VA = "0x181C771F0")]
public void AddKekRecipient(string keyAlgorithm, KeyParameter key, KekIdentifier kekIdentifier)
{
KekRecipientInfoGenerator kekRecipientInfoGenerator = new KekRecipientInfoGenerator();
kekRecipientInfoGenerator.kekIdentifier = kekIdentifier;
kekRecipientInfoGenerator.keyEncryptionKeyOID = keyAlgorithm;
kekRecipientInfoGenerator.KeyEncryptionKey = key;
IList list = this.recipientInfoGenerators;
throw new NullReferenceException();
}
// Token: 0x0600A17A RID: 41338 RVA: 0x00258ECC File Offset: 0x002570CC
[Token(Token = "0x600A17A")]
[Address(RVA = "0x1C777D0", Offset = "0x1C761D0", VA = "0x181C777D0")]
public void AddPasswordRecipient(CmsPbeKey pbeKey, string kekAlgorithmOid)
{
byte[] array = Arrays.Clone(pbeKey.salt);
int iterationCount = pbeKey.iterationCount;
Pbkdf2Params pbkdf2Params = new Pbkdf2Params(array, iterationCount);
PasswordRecipientInfoGenerator passwordRecipientInfoGenerator = new PasswordRecipientInfoGenerator();
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(PkcsObjectIdentifiers.IdPbkdf2, pbkdf2Params);
passwordRecipientInfoGenerator.keyDerivationAlgorithm = algorithmIdentifier;
passwordRecipientInfoGenerator.keyEncryptionKeyOID = kekAlgorithmOid;
string text = pbeKey.ToString();
passwordRecipientInfoGenerator.keyEncryptionKey = text;
IList list = this.recipientInfoGenerators;
throw new NullReferenceException();
}
// Token: 0x0600A17B RID: 41339 RVA: 0x00258F34 File Offset: 0x00257134
[Token(Token = "0x600A17B")]
[Address(RVA = "0x1C772B0", Offset = "0x1C75CB0", VA = "0x181C772B0")]
public void AddKeyAgreementRecipient(string agreementAlgorithm, AsymmetricKeyParameter senderPrivateKey, AsymmetricKeyParameter senderPublicKey, X509Certificate recipientCert, string cekWrapAlgorithm)
{
/*
An exception occurred when decompiling this method (0600A17B)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsEnvelopedGenerator::AddKeyAgreementRecipient(System.String,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter,BestHTTP.SecureProtocol.Org.BouncyCastle.X509.X509Certificate,System.String)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_5A:
stloc:ArgumentException(var_6_69, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Expected public key"), ldstr:string("senderPublicKey")))
}
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: 0x0600A17C RID: 41340 RVA: 0x00258FAC File Offset: 0x002571AC
[Token(Token = "0x600A17C")]
[Address(RVA = "0x1C774D0", Offset = "0x1C75ED0", VA = "0x181C774D0")]
public void AddKeyAgreementRecipients(string agreementAlgorithm, AsymmetricKeyParameter senderPrivateKey, AsymmetricKeyParameter senderPublicKey, ICollection recipientCerts, string cekWrapAlgorithm)
{
/*
An exception occurred when decompiling this method (0600A17C)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsEnvelopedGenerator::AddKeyAgreementRecipients(System.String,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter,System.Collections.ICollection,System.String)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_4A:
stloc:ArgumentException(var_5_59, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Expected public key"), ldstr:string("senderPublicKey")))
}
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: 0x0600A17D RID: 41341 RVA: 0x00259014 File Offset: 0x00257214
[Token(Token = "0x600A17D")]
[Address(RVA = "0x1C77B30", Offset = "0x1C76530", VA = "0x181C77B30", Slot = "4")]
protected internal virtual AlgorithmIdentifier GetAlgorithmIdentifier(string encryptionOid, KeyParameter encKey, Asn1Encodable asn1Params, out ICipherParameters cipherParameters)
{
if (asn1Params == 0)
{
}
Asn1Object asn1Object = asn1Params.ToAsn1Object();
ICipherParameters cipherParameters2 = ParameterUtilities.GetCipherParameters(encryptionOid, encKey, asn1Object);
return new AlgorithmIdentifier(new DerObjectIdentifier(encryptionOid), asn1Object);
}
// Token: 0x0600A17E RID: 41342 RVA: 0x00259044 File Offset: 0x00257244
[Token(Token = "0x600A17E")]
[Address(RVA = "0x1C77960", Offset = "0x1C76360", VA = "0x181C77960", Slot = "5")]
protected internal virtual Asn1Encodable GenerateAsn1Parameters(string encryptionOid, byte[] encKeyBytes)
{
string rc2Cbc = CmsEnvelopedGenerator.RC2Cbc;
if (!encryptionOid.Equals(rc2Cbc))
{
SecureRandom secureRandom = this.rand;
Asn1Encodable asn1Encodable = ParameterUtilities.GenerateParameters(encryptionOid, secureRandom);
}
byte[] array = new byte[8];
double num = this.rand.NextDouble();
int length = encKeyBytes.Length;
if (length < 256)
{
short[] array2 = CmsEnvelopedGenerator.rc2Table;
}
RC2CbcParameter rc2CbcParameter = new RC2CbcParameter(length, array);
throw new IndexOutOfRangeException();
}
// Token: 0x0600A17F RID: 41343 RVA: 0x002590C4 File Offset: 0x002572C4
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600A17F")]
[Address(RVA = "0x1C77C50", Offset = "0x1C76650", VA = "0x181C77C50")]
static CmsEnvelopedGenerator()
{
short[] array = new short[256];
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.0D762A448FEF55A8E0DA63AB8F3FFC8D3A3F1070).FieldHandle);
CmsEnvelopedGenerator.rc2Table = array;
CmsEnvelopedGenerator.DesEde3Cbc = PkcsObjectIdentifiers.DesEde3Cbc.identifier;
CmsEnvelopedGenerator.RC2Cbc = PkcsObjectIdentifiers.RC2Cbc.identifier;
CmsEnvelopedGenerator.Aes128Cbc = NistObjectIdentifiers.IdAes128Cbc.identifier;
CmsEnvelopedGenerator.Aes192Cbc = NistObjectIdentifiers.IdAes192Cbc.identifier;
CmsEnvelopedGenerator.Aes256Cbc = NistObjectIdentifiers.IdAes256Cbc.identifier;
CmsEnvelopedGenerator.Camellia128Cbc = NttObjectIdentifiers.IdCamellia128Cbc.identifier;
CmsEnvelopedGenerator.Camellia192Cbc = NttObjectIdentifiers.IdCamellia192Cbc.identifier;
CmsEnvelopedGenerator.Camellia256Cbc = NttObjectIdentifiers.IdCamellia256Cbc.identifier;
CmsEnvelopedGenerator.SeedCbc = KisaObjectIdentifiers.IdSeedCbc.identifier;
CmsEnvelopedGenerator.DesEde3Wrap = PkcsObjectIdentifiers.IdAlgCms3DesWrap.identifier;
CmsEnvelopedGenerator.Aes128Wrap = NistObjectIdentifiers.IdAes128Wrap.identifier;
CmsEnvelopedGenerator.Aes192Wrap = NistObjectIdentifiers.IdAes192Wrap.identifier;
CmsEnvelopedGenerator.Aes256Wrap = NistObjectIdentifiers.IdAes256Wrap.identifier;
CmsEnvelopedGenerator.Camellia128Wrap = NttObjectIdentifiers.IdCamellia128Wrap.identifier;
CmsEnvelopedGenerator.Camellia192Wrap = NttObjectIdentifiers.IdCamellia192Wrap.identifier;
CmsEnvelopedGenerator.Camellia256Wrap = NttObjectIdentifiers.IdCamellia256Wrap.identifier;
CmsEnvelopedGenerator.SeedWrap = KisaObjectIdentifiers.IdNpkiAppCmsSeedWrap.identifier;
CmsEnvelopedGenerator.ECDHSha1Kdf = X9ObjectIdentifiers.DHSinglePassStdDHSha1KdfScheme.identifier;
CmsEnvelopedGenerator.ECMqvSha1Kdf = X9ObjectIdentifiers.MqvSinglePassSha1KdfScheme.identifier;
}
// Token: 0x04006A45 RID: 27205
[Token(Token = "0x4006A45")]
internal static readonly short[] rc2Table;
// Token: 0x04006A46 RID: 27206
[Token(Token = "0x4006A46")]
public static readonly string DesEde3Cbc;
// Token: 0x04006A47 RID: 27207
[Token(Token = "0x4006A47")]
public static readonly string RC2Cbc;
// Token: 0x04006A48 RID: 27208
[Token(Token = "0x4006A48")]
public const string IdeaCbc = "1.3.6.1.4.1.188.7.1.1.2";
// Token: 0x04006A49 RID: 27209
[Token(Token = "0x4006A49")]
public const string Cast5Cbc = "1.2.840.113533.7.66.10";
// Token: 0x04006A4A RID: 27210
[Token(Token = "0x4006A4A")]
public static readonly string Aes128Cbc;
// Token: 0x04006A4B RID: 27211
[Token(Token = "0x4006A4B")]
public static readonly string Aes192Cbc;
// Token: 0x04006A4C RID: 27212
[Token(Token = "0x4006A4C")]
public static readonly string Aes256Cbc;
// Token: 0x04006A4D RID: 27213
[Token(Token = "0x4006A4D")]
public static readonly string Camellia128Cbc;
// Token: 0x04006A4E RID: 27214
[Token(Token = "0x4006A4E")]
public static readonly string Camellia192Cbc;
// Token: 0x04006A4F RID: 27215
[Token(Token = "0x4006A4F")]
public static readonly string Camellia256Cbc;
// Token: 0x04006A50 RID: 27216
[Token(Token = "0x4006A50")]
public static readonly string SeedCbc;
// Token: 0x04006A51 RID: 27217
[Token(Token = "0x4006A51")]
public static readonly string DesEde3Wrap;
// Token: 0x04006A52 RID: 27218
[Token(Token = "0x4006A52")]
public static readonly string Aes128Wrap;
// Token: 0x04006A53 RID: 27219
[Token(Token = "0x4006A53")]
public static readonly string Aes192Wrap;
// Token: 0x04006A54 RID: 27220
[Token(Token = "0x4006A54")]
public static readonly string Aes256Wrap;
// Token: 0x04006A55 RID: 27221
[Token(Token = "0x4006A55")]
public static readonly string Camellia128Wrap;
// Token: 0x04006A56 RID: 27222
[Token(Token = "0x4006A56")]
public static readonly string Camellia192Wrap;
// Token: 0x04006A57 RID: 27223
[Token(Token = "0x4006A57")]
public static readonly string Camellia256Wrap;
// Token: 0x04006A58 RID: 27224
[Token(Token = "0x4006A58")]
public static readonly string SeedWrap;
// Token: 0x04006A59 RID: 27225
[Token(Token = "0x4006A59")]
public static readonly string ECDHSha1Kdf;
// Token: 0x04006A5A RID: 27226
[Token(Token = "0x4006A5A")]
public static readonly string ECMqvSha1Kdf;
// Token: 0x04006A5B RID: 27227
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A5B")]
internal readonly IList recipientInfoGenerators;
// Token: 0x04006A5C RID: 27228
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A5C")]
internal readonly SecureRandom rand;
// Token: 0x04006A5D RID: 27229
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006A5D")]
internal CmsAttributeTableGenerator unprotectedAttributeGenerator;
}
}
@@ -0,0 +1,370 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200175C RID: 5980
[Token(Token = "0x200175C")]
[StructLayout(3)]
internal class CmsEnvelopedHelper
{
// Token: 0x0600A180 RID: 41344 RVA: 0x00259210 File Offset: 0x00257410
[Token(Token = "0x600A180")]
[Address(RVA = "0x1C78B60", Offset = "0x1C77560", VA = "0x181C78B60")]
static CmsEnvelopedHelper()
{
IDictionary dictionary = Platform.CreateHashtable();
CmsEnvelopedHelper.KeySizes = dictionary;
CmsEnvelopedHelper.BaseCipherNames = Platform.CreateHashtable();
IDictionary keySizes = CmsEnvelopedHelper.KeySizes;
IDictionary keySizes2 = CmsEnvelopedHelper.KeySizes;
IDictionary keySizes3 = CmsEnvelopedHelper.KeySizes;
IDictionary keySizes4 = CmsEnvelopedHelper.KeySizes;
IDictionary baseCipherNames = CmsEnvelopedHelper.BaseCipherNames;
IDictionary baseCipherNames2 = CmsEnvelopedHelper.BaseCipherNames;
IDictionary baseCipherNames3 = CmsEnvelopedHelper.BaseCipherNames;
IDictionary baseCipherNames4 = CmsEnvelopedHelper.BaseCipherNames;
}
// Token: 0x0600A181 RID: 41345 RVA: 0x00259280 File Offset: 0x00257480
[Token(Token = "0x600A181")]
[Address(RVA = "0x1C78500", Offset = "0x1C76F00", VA = "0x181C78500")]
private string GetAsymmetricEncryptionAlgName(string encryptionAlgOid)
{
bool flag = PkcsObjectIdentifiers.RsaEncryption.identifier.Equals(encryptionAlgOid);
return encryptionAlgOid;
}
// Token: 0x0600A182 RID: 41346 RVA: 0x002592A8 File Offset: 0x002574A8
[Token(Token = "0x600A182")]
[Address(RVA = "0x1C78350", Offset = "0x1C76D50", VA = "0x181C78350")]
internal IBufferedCipher CreateAsymmetricCipher(string encryptionOid)
{
string asymmetricEncryptionAlgName = this.GetAsymmetricEncryptionAlgName(encryptionOid);
if (!asymmetricEncryptionAlgName.Equals(encryptionOid))
{
return CipherUtilities.GetCipher(asymmetricEncryptionAlgName);
}
return CipherUtilities.GetCipher(encryptionOid);
}
// Token: 0x0600A183 RID: 41347 RVA: 0x002592DC File Offset: 0x002574DC
[Token(Token = "0x600A183")]
[Address(RVA = "0x1C78440", Offset = "0x1C76E40", VA = "0x181C78440")]
internal IWrapper CreateWrapper(string encryptionOid)
{
IWrapper wrapper = WrapperUtilities.GetWrapper(encryptionOid);
string text;
return WrapperUtilities.GetWrapper(text);
}
// Token: 0x0600A184 RID: 41348 RVA: 0x002592F8 File Offset: 0x002574F8
[Token(Token = "0x600A184")]
[Address(RVA = "0x1C786E0", Offset = "0x1C770E0", VA = "0x181C786E0")]
internal string GetRfc3211WrapperName(string oid)
{
if (oid != 0)
{
IDictionary baseCipherNames = CmsEnvelopedHelper.BaseCipherNames;
string text;
return text;
}
ArgumentNullException ex = new ArgumentNullException("oid");
string text2;
ArgumentException ex2 = new ArgumentException(text2, "oid");
throw new NullReferenceException();
}
// Token: 0x0600A185 RID: 41349 RVA: 0x00259330 File Offset: 0x00257530
[Token(Token = "0x600A185")]
[Address(RVA = "0x1C78590", Offset = "0x1C76F90", VA = "0x181C78590")]
internal int GetKeySize(string oid)
{
IDictionary keySizes = CmsEnvelopedHelper.KeySizes;
IDictionary keySizes2 = CmsEnvelopedHelper.KeySizes;
CmsEnvelopedHelper instance = CmsEnvelopedHelper.Instance;
throw new NullReferenceException();
}
// Token: 0x0600A186 RID: 41350 RVA: 0x00259370 File Offset: 0x00257570
[Token(Token = "0x600A186")]
[Address(RVA = "0x1C78230", Offset = "0x1C76C30", VA = "0x181C78230")]
internal static RecipientInformationStore BuildRecipientInformationStore(Asn1Set recipientInfos, CmsSecureReadable secureReadable)
{
IList list = Platform.CreateArrayList();
int num = 0;
Asn1Encodable asn1Encodable;
if (num != asn1Encodable)
{
IEnumerator enumerator = recipientInfos.GetEnumerator();
RecipientInfo recipientInfo;
CmsEnvelopedHelper.ReadRecipientInfo(list, recipientInfo, secureReadable);
num++;
}
return new RecipientInformationStore(list);
}
// Token: 0x0600A187 RID: 41351 RVA: 0x002593AC File Offset: 0x002575AC
[Token(Token = "0x600A187")]
[Address(RVA = "0x1C78820", Offset = "0x1C77220", VA = "0x181C78820")]
private static void ReadRecipientInfo(IList infos, RecipientInfo info, CmsSecureReadable secureReadable)
{
Asn1Encodable info2;
do
{
info2 = info.Info;
if (info2 == 0)
{
break;
}
if (info2 != 0)
{
goto IL_35;
}
if (info2 != 0)
{
goto IL_32;
}
if (info2 != 0)
{
goto IL_2F;
}
}
while (info2 != 0 && info2 == 0);
return;
IL_2F:
IL_32:
IL_35:
throw new NullReferenceException();
}
// Token: 0x0600A188 RID: 41352 RVA: 0x002593F8 File Offset: 0x002575F8
[Token(Token = "0x600A188")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public CmsEnvelopedHelper()
{
}
// Token: 0x04006A5E RID: 27230
[Token(Token = "0x4006A5E")]
internal static readonly CmsEnvelopedHelper Instance = new CmsEnvelopedHelper();
// Token: 0x04006A5F RID: 27231
[Token(Token = "0x4006A5F")]
private static readonly IDictionary KeySizes;
// Token: 0x04006A60 RID: 27232
[Token(Token = "0x4006A60")]
private static readonly IDictionary BaseCipherNames;
// Token: 0x0200175D RID: 5981
[Token(Token = "0x200175D")]
internal class CmsAuthenticatedSecureReadable : CmsSecureReadable
{
// Token: 0x0600A189 RID: 41353 RVA: 0x0025940C File Offset: 0x0025760C
[Token(Token = "0x600A189")]
[Address(RVA = "0x1C73DE0", Offset = "0x1C727E0", VA = "0x181C73DE0")]
internal CmsAuthenticatedSecureReadable(AlgorithmIdentifier algorithm, CmsReadable readable)
{
this.algorithm = algorithm;
this.readable = readable;
}
// Token: 0x17001955 RID: 6485
// (get) Token: 0x0600A18A RID: 41354 RVA: 0x00259430 File Offset: 0x00257630
[Token(Token = "0x17001955")]
public AlgorithmIdentifier Algorithm
{
[Token(Token = "0x600A18A")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0", Slot = "4")]
get
{
return this.algorithm;
}
}
// Token: 0x17001956 RID: 6486
// (get) Token: 0x0600A18B RID: 41355 RVA: 0x00259444 File Offset: 0x00257644
[Token(Token = "0x17001956")]
public object CryptoObject
{
[Token(Token = "0x600A18B")]
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240", Slot = "5")]
get
{
/*
An exception occurred when decompiling this method (0600A18B)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Object BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsEnvelopedHelper/CmsAuthenticatedSecureReadable::get_CryptoObject()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:IMac(var_0_06, ldfld:IMac(CmsAuthenticatedSecureReadable::mac, ldloc:CmsAuthenticatedSecureReadable(this)))
}
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: 0x0600A18C RID: 41356 RVA: 0x00259458 File Offset: 0x00257658
[Token(Token = "0x600A18C")]
[Address(RVA = "0x1C73BA0", Offset = "0x1C725A0", VA = "0x181C73BA0", Slot = "6")]
public CmsReadable GetReadable(KeyParameter sKey)
{
Asn1Object asn1Object = this.algorithm.ToAsn1Object();
IMac mac;
this.mac = mac;
CmsReadable cmsReadable = this.readable;
MacSink macSink = new MacSink(this.mac);
CmsProcessableInputStream cmsProcessableInputStream;
TeeInputStream teeInputStream;
cmsProcessableInputStream.input = teeInputStream;
throw new NullReferenceException();
}
// Token: 0x04006A61 RID: 27233
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A61")]
private AlgorithmIdentifier algorithm;
// Token: 0x04006A62 RID: 27234
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A62")]
private IMac mac;
// Token: 0x04006A63 RID: 27235
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006A63")]
private CmsReadable readable;
}
// Token: 0x0200175E RID: 5982
[Token(Token = "0x200175E")]
internal class CmsEnvelopedSecureReadable : CmsSecureReadable
{
// Token: 0x0600A18D RID: 41357 RVA: 0x002594A8 File Offset: 0x002576A8
[Token(Token = "0x600A18D")]
[Address(RVA = "0x1C73DE0", Offset = "0x1C727E0", VA = "0x181C73DE0")]
internal CmsEnvelopedSecureReadable(AlgorithmIdentifier algorithm, CmsReadable readable)
{
this.algorithm = algorithm;
this.readable = readable;
}
// Token: 0x17001957 RID: 6487
// (get) Token: 0x0600A18E RID: 41358 RVA: 0x002594CC File Offset: 0x002576CC
[Token(Token = "0x17001957")]
public AlgorithmIdentifier Algorithm
{
[Token(Token = "0x600A18E")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0", Slot = "4")]
get
{
return this.algorithm;
}
}
// Token: 0x17001958 RID: 6488
// (get) Token: 0x0600A18F RID: 41359 RVA: 0x002594E0 File Offset: 0x002576E0
[Token(Token = "0x17001958")]
public object CryptoObject
{
[Token(Token = "0x600A18F")]
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240", Slot = "5")]
get
{
/*
An exception occurred when decompiling this method (0600A18F)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Object BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsEnvelopedHelper/CmsEnvelopedSecureReadable::get_CryptoObject()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:IBufferedCipher(var_0_06, ldfld:IBufferedCipher(CmsEnvelopedSecureReadable::cipher, ldloc:CmsEnvelopedSecureReadable(this)))
}
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: 0x0600A190 RID: 41360 RVA: 0x002594F4 File Offset: 0x002576F4
[Token(Token = "0x600A190")]
[Address(RVA = "0x1C78EE0", Offset = "0x1C778E0", VA = "0x181C78EE0", Slot = "6")]
public CmsReadable GetReadable(KeyParameter sKey)
{
Asn1Object asn1Object = this.algorithm.ToAsn1Object();
IBufferedCipher bufferedCipher;
this.cipher = bufferedCipher;
DerObjectIdentifier objectID = this.algorithm.ObjectID;
if (objectID == 0)
{
}
Asn1Object asn1Object2 = objectID.ToAsn1Object();
if (asn1Object2 != 0 && asn1Object2 == 0)
{
Asn1Object asn1Object3 = this.algorithm.ToAsn1Object();
}
Asn1Object asn1Object4 = this.algorithm.ToAsn1Object();
string desEde3Cbc = CmsEnvelopedGenerator.DesEde3Cbc;
bool flag;
bool flag2;
bool flag3;
if (flag || flag2 || flag3)
{
byte[] array = new byte[8];
ICipherParameters cipherParameters;
ParametersWithIV parametersWithIV = new ParametersWithIV(cipherParameters, array);
}
IBufferedCipher bufferedCipher2 = this.cipher;
CmsReadable cmsReadable = this.readable;
CmsProcessableInputStream cmsProcessableInputStream;
CipherStream cipherStream;
cmsProcessableInputStream.input = cipherStream;
throw new NullReferenceException();
}
// Token: 0x04006A64 RID: 27236
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A64")]
private AlgorithmIdentifier algorithm;
// Token: 0x04006A65 RID: 27237
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A65")]
private IBufferedCipher cipher;
// Token: 0x04006A66 RID: 27238
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006A66")]
private CmsReadable readable;
}
}
}
@@ -0,0 +1,36 @@
using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200175F RID: 5983
[Token(Token = "0x200175F")]
[Serializable]
[StructLayout(3)]
public class CmsException : Exception
{
// Token: 0x0600A191 RID: 41361 RVA: 0x002595C4 File Offset: 0x002577C4
[Token(Token = "0x600A191")]
[Address(RVA = "0x1C71240", Offset = "0x1C6FC40", VA = "0x181C71240")]
public CmsException()
{
}
// Token: 0x0600A192 RID: 41362 RVA: 0x002595D8 File Offset: 0x002577D8
[Token(Token = "0x600A192")]
[Address(RVA = "0x1C71320", Offset = "0x1C6FD20", VA = "0x181C71320")]
public CmsException(string msg)
: base(msg)
{
}
// Token: 0x0600A193 RID: 41363 RVA: 0x002595EC File Offset: 0x002577EC
[Token(Token = "0x600A193")]
[Address(RVA = "0x1C712A0", Offset = "0x1C6FCA0", VA = "0x181C712A0")]
public CmsException(string msg, Exception e)
: base(msg, e)
{
}
}
}
@@ -0,0 +1,201 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001760 RID: 5984
[Token(Token = "0x2001760")]
[StructLayout(3)]
public abstract class CmsPbeKey : ICipherParameters
{
// Token: 0x0600A194 RID: 41364 RVA: 0x00259604 File Offset: 0x00257804
[Token(Token = "0x600A194")]
[Address(RVA = "0x1C795E0", Offset = "0x1C77FE0", VA = "0x181C795E0")]
[Obsolete]
public CmsPbeKey(string password, byte[] salt, int iterationCount)
{
char[] array;
do
{
array = password.ToCharArray();
base..ctor();
}
while (array != 0 && array == 0);
this.password = array;
byte[] array2 = Arrays.Clone(salt);
this.iterationCount = iterationCount;
this.salt = array2;
}
// Token: 0x0600A195 RID: 41365 RVA: 0x00259648 File Offset: 0x00257848
[Token(Token = "0x600A195")]
[Address(RVA = "0x662620", Offset = "0x661020", VA = "0x180662620")]
[Obsolete]
public CmsPbeKey(string password, AlgorithmIdentifier keyDerivationAlgorithm)
{
char[] array = password.ToCharArray();
}
// Token: 0x0600A196 RID: 41366 RVA: 0x00259664 File Offset: 0x00257864
[Token(Token = "0x600A196")]
[Address(RVA = "0x1C796D0", Offset = "0x1C780D0", VA = "0x181C796D0")]
public CmsPbeKey(char[] password, byte[] salt, int iterationCount)
{
byte[] array = Arrays.Clone(salt);
this.iterationCount = iterationCount;
this.salt = array;
}
// Token: 0x0600A197 RID: 41367 RVA: 0x00259694 File Offset: 0x00257894
[Token(Token = "0x600A197")]
[Address(RVA = "0x1C793E0", Offset = "0x1C77DE0", VA = "0x181C793E0")]
public CmsPbeKey(char[] password, AlgorithmIdentifier keyDerivationAlgorithm)
{
Pbkdf2Params instance;
do
{
base..ctor();
Asn1Object asn1Object = keyDerivationAlgorithm.ToAsn1Object();
instance = Pbkdf2Params.GetInstance(keyDerivationAlgorithm.ObjectID.ToAsn1Object());
}
while (instance != 0 && instance == 0);
this.password = instance;
byte[] array = instance.GetSalt();
this.salt = array;
int intValue = instance.IterationCount.IntValue;
this.iterationCount = intValue;
}
// Token: 0x0600A198 RID: 41368 RVA: 0x002596F8 File Offset: 0x002578F8
[Token(Token = "0x600A198")]
[Address(RVA = "0x1C792D0", Offset = "0x1C77CD0", VA = "0x181C792D0", Slot = "1")]
protected override void Finalize()
{
int num;
do
{
num = 0;
char[] array = this.password;
int length = array.Length;
int num2 = 0;
Array.Clear(array, num2, length);
base..ctor();
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x17001959 RID: 6489
// (get) Token: 0x0600A199 RID: 41369 RVA: 0x00259734 File Offset: 0x00257934
[Token(Token = "0x17001959")]
[Obsolete]
public string Password
{
[Token(Token = "0x600A199")]
[Address(RVA = "0x1C79810", Offset = "0x1C78210", VA = "0x181C79810")]
get
{
char[] array = this.password;
string text;
return text;
}
}
// Token: 0x1700195A RID: 6490
// (get) Token: 0x0600A19A RID: 41370 RVA: 0x0025974C File Offset: 0x0025794C
[Token(Token = "0x1700195A")]
public byte[] Salt
{
[Token(Token = "0x600A19A")]
[Address(RVA = "0x1C79380", Offset = "0x1C77D80", VA = "0x181C79380")]
get
{
return Arrays.Clone(this.salt);
}
}
// Token: 0x0600A19B RID: 41371 RVA: 0x00259764 File Offset: 0x00257964
[Token(Token = "0x600A19B")]
[Address(RVA = "0x1C79380", Offset = "0x1C77D80", VA = "0x181C79380")]
[Obsolete]
public byte[] GetSalt()
{
return Arrays.Clone(this.salt);
}
// Token: 0x1700195B RID: 6491
// (get) Token: 0x0600A19C RID: 41372 RVA: 0x0025977C File Offset: 0x0025797C
[Token(Token = "0x1700195B")]
public int IterationCount
{
[Token(Token = "0x600A19C")]
[Address(RVA = "0x4FBD40", Offset = "0x4FA740", VA = "0x1804FBD40")]
get
{
return this.iterationCount;
}
}
// Token: 0x1700195C RID: 6492
// (get) Token: 0x0600A19D RID: 41373 RVA: 0x00259790 File Offset: 0x00257990
[Token(Token = "0x1700195C")]
public string Algorithm
{
[Token(Token = "0x600A19D")]
[Address(RVA = "0x1C797B0", Offset = "0x1C781B0", VA = "0x181C797B0")]
get
{
return "PKCS5S2";
}
}
// Token: 0x1700195D RID: 6493
// (get) Token: 0x0600A19E RID: 41374 RVA: 0x002597A4 File Offset: 0x002579A4
[Token(Token = "0x1700195D")]
public string Format
{
[Token(Token = "0x600A19E")]
[Address(RVA = "0x1C797E0", Offset = "0x1C781E0", VA = "0x181C797E0")]
get
{
return "RAW";
}
}
// Token: 0x0600A19F RID: 41375 RVA: 0x002597B8 File Offset: 0x002579B8
[Token(Token = "0x600A19F")]
[Address(RVA = "0x3F8880", Offset = "0x3F7280", VA = "0x1803F8880")]
public byte[] GetEncoded()
{
}
// Token: 0x0600A1A0 RID: 41376
[Token(Token = "0x600A1A0")]
[Address(Slot = "4")]
internal abstract KeyParameter GetEncoded(string algorithmOid);
// Token: 0x04006A67 RID: 27239
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A67")]
internal readonly char[] password;
// Token: 0x04006A68 RID: 27240
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A68")]
internal readonly byte[] salt;
// Token: 0x04006A69 RID: 27241
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006A69")]
internal readonly int iterationCount;
}
}
@@ -0,0 +1,24 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001761 RID: 5985
[Token(Token = "0x2001761")]
[StructLayout(3)]
public interface CmsProcessable
{
// Token: 0x0600A1A1 RID: 41377
[Token(Token = "0x600A1A1")]
[Address(Slot = "0")]
void Write(Stream outStream);
// Token: 0x0600A1A2 RID: 41378
[Token(Token = "0x600A1A2")]
[Address(Slot = "1")]
[Obsolete]
object GetContent();
}
}
@@ -0,0 +1,72 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001762 RID: 5986
[Token(Token = "0x2001762")]
[StructLayout(3)]
public class CmsProcessableByteArray : CmsProcessable, CmsReadable
{
// Token: 0x0600A1A3 RID: 41379 RVA: 0x002597C8 File Offset: 0x002579C8
[Token(Token = "0x600A1A3")]
[Address(RVA = "0x3C3A30", Offset = "0x3C2430", VA = "0x1803C3A30")]
public CmsProcessableByteArray(byte[] bytes)
{
this.bytes = bytes;
}
// Token: 0x0600A1A4 RID: 41380 RVA: 0x002597E4 File Offset: 0x002579E4
[Token(Token = "0x600A1A4")]
[Address(RVA = "0x1C79840", Offset = "0x1C78240", VA = "0x181C79840", Slot = "7")]
public virtual Stream GetInputStream()
{
/*
An exception occurred when decompiling this method (0600A1A4)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.IO.Stream BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsProcessableByteArray::GetInputStream()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:MemoryStream(var_0_0C, newobj:MemoryStream(MemoryStream::.ctor, ldfld:uint8[](CmsProcessableByteArray::bytes, ldloc:CmsProcessableByteArray(this)), ldloc:int32[exp:bool](var_1)))
stloc:int32(var_1, ldc.i4:int32(0))
}
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: 0x0600A1A5 RID: 41381 RVA: 0x00259800 File Offset: 0x00257A00
[Token(Token = "0x600A1A5")]
[Address(RVA = "0x5FE580", Offset = "0x5FCF80", VA = "0x1805FE580", Slot = "8")]
public virtual void Write(Stream zOut)
{
byte[] array = this.bytes;
int num = zOut.ReadByte();
}
// Token: 0x0600A1A6 RID: 41382 RVA: 0x00259824 File Offset: 0x00257A24
[Token(Token = "0x600A1A6")]
[Address(RVA = "0x1C79820", Offset = "0x1C78220", VA = "0x181C79820", Slot = "9")]
[Obsolete]
public virtual object GetContent()
{
byte[] array = this.bytes;
throw new NullReferenceException();
}
// Token: 0x04006A6A RID: 27242
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A6A")]
private readonly byte[] bytes;
}
}
@@ -0,0 +1,94 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001763 RID: 5987
[Token(Token = "0x2001763")]
[StructLayout(3)]
public class CmsProcessableFile : CmsProcessable, CmsReadable
{
// Token: 0x0600A1A7 RID: 41383 RVA: 0x00259840 File Offset: 0x00257A40
[Token(Token = "0x600A1A7")]
[Address(RVA = "0x1C799D0", Offset = "0x1C783D0", VA = "0x181C799D0")]
public CmsProcessableFile(FileInfo file)
{
this._file = file;
this._bufSize = (int)((ulong)32768L);
}
// Token: 0x0600A1A8 RID: 41384 RVA: 0x00259868 File Offset: 0x00257A68
[Token(Token = "0x600A1A8")]
[Address(RVA = "0x67E170", Offset = "0x67CB70", VA = "0x18067E170")]
public CmsProcessableFile(FileInfo file, int bufSize)
{
this._file = file;
this._bufSize = bufSize;
}
// Token: 0x0600A1A9 RID: 41385 RVA: 0x0025988C File Offset: 0x00257A8C
[Token(Token = "0x600A1A9")]
[Address(RVA = "0x1C798A0", Offset = "0x1C782A0", VA = "0x181C798A0", Slot = "7")]
public virtual Stream GetInputStream()
{
FileInfo file = this._file;
int bufSize = this._bufSize;
throw new NullReferenceException();
}
// Token: 0x0600A1AA RID: 41386 RVA: 0x002598AC File Offset: 0x00257AAC
[Token(Token = "0x600A1AA")]
[Address(RVA = "0x1C79940", Offset = "0x1C78340", VA = "0x181C79940", Slot = "8")]
public virtual void Write(Stream zOut)
{
Stream inputStream = this.GetInputStream();
Streams.PipeAll(inputStream, zOut);
Platform.Dispose(inputStream);
}
// Token: 0x0600A1AB RID: 41387 RVA: 0x002598D0 File Offset: 0x00257AD0
[Token(Token = "0x600A1AB")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0", Slot = "9")]
[Obsolete]
public virtual object GetContent()
{
/*
An exception occurred when decompiling this method (0600A1AB)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Object BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsProcessableFile::GetContent()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:FileInfo(var_0_06, ldfld:FileInfo(CmsProcessableFile::_file, ldloc:CmsProcessableFile(this)))
}
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: 0x04006A6B RID: 27243
[Token(Token = "0x4006A6B")]
private const int DefaultBufSize = 32768;
// Token: 0x04006A6C RID: 27244
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A6C")]
private readonly FileInfo _file;
// Token: 0x04006A6D RID: 27245
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A6D")]
private readonly int _bufSize;
}
}
@@ -0,0 +1,87 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001764 RID: 5988
[Token(Token = "0x2001764")]
[StructLayout(3)]
public class CmsProcessableInputStream : CmsProcessable, CmsReadable
{
// Token: 0x0600A1AC RID: 41388 RVA: 0x002598E4 File Offset: 0x00257AE4
[Token(Token = "0x600A1AC")]
[Address(RVA = "0x3C3A30", Offset = "0x3C2430", VA = "0x1803C3A30")]
public CmsProcessableInputStream(Stream input)
{
this.input = input;
}
// Token: 0x0600A1AD RID: 41389 RVA: 0x00259900 File Offset: 0x00257B00
[Token(Token = "0x600A1AD")]
[Address(RVA = "0x1C79B00", Offset = "0x1C78500", VA = "0x181C79B00", Slot = "7")]
public virtual Stream GetInputStream()
{
object content = this.GetContent();
return this.input;
}
// Token: 0x0600A1AE RID: 41390 RVA: 0x0025991C File Offset: 0x00257B1C
[Token(Token = "0x600A1AE")]
[Address(RVA = "0x1C79B30", Offset = "0x1C78530", VA = "0x181C79B30", Slot = "8")]
public virtual void Write(Stream output)
{
object content = this.GetContent();
Streams.PipeAll(this.input, output);
Platform.Dispose(this.input);
}
// Token: 0x0600A1AF RID: 41391 RVA: 0x00259948 File Offset: 0x00257B48
[Token(Token = "0x600A1AF")]
[Address(RVA = "0x50F4B0", Offset = "0x50DEB0", VA = "0x18050F4B0", Slot = "9")]
[Obsolete]
public virtual object GetContent()
{
return ((CmsProcessable)this).GetContent();
}
// Token: 0x0600A1B0 RID: 41392 RVA: 0x0025995C File Offset: 0x00257B5C
[Token(Token = "0x600A1B0")]
[Address(RVA = "0x1C79A00", Offset = "0x1C78400", VA = "0x181C79A00", Slot = "10")]
protected virtual void CheckSingleUsage()
{
/*
An exception occurred when decompiling this method (0600A1B0)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsProcessableInputStream::CheckSingleUsage()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_21:
stloc:InvalidOperationException(var_1_2B, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("CmsProcessableInputStream can only be used once")))
}
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: 0x04006A6E RID: 27246
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A6E")]
private readonly Stream input;
// Token: 0x04006A6F RID: 27247
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A6F")]
private bool used;
}
}
@@ -0,0 +1,18 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001765 RID: 5989
[Token(Token = "0x2001765")]
[StructLayout(3)]
public interface CmsReadable
{
// Token: 0x0600A1B1 RID: 41393
[Token(Token = "0x600A1B1")]
[Address(Slot = "0")]
Stream GetInputStream();
}
}
@@ -0,0 +1,39 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001766 RID: 5990
[Token(Token = "0x2001766")]
[StructLayout(3)]
internal interface CmsSecureReadable
{
// Token: 0x1700195E RID: 6494
// (get) Token: 0x0600A1B2 RID: 41394
[Token(Token = "0x1700195E")]
AlgorithmIdentifier Algorithm
{
[Token(Token = "0x600A1B2")]
[Address(Slot = "0")]
get;
}
// Token: 0x1700195F RID: 6495
// (get) Token: 0x0600A1B3 RID: 41395
[Token(Token = "0x1700195F")]
object CryptoObject
{
[Token(Token = "0x600A1B3")]
[Address(Slot = "1")]
get;
}
// Token: 0x0600A1B4 RID: 41396
[Token(Token = "0x600A1B4")]
[Address(Slot = "2")]
CmsReadable GetReadable(KeyParameter key);
}
}
@@ -0,0 +1,390 @@
using System;
using System.Collections;
using System.IO;
using System.Runtime.InteropServices;
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: 0x02001767 RID: 5991
[Token(Token = "0x2001767")]
[StructLayout(3)]
public class CmsSignedData
{
// Token: 0x0600A1B5 RID: 41397 RVA: 0x00259994 File Offset: 0x00257B94
[Token(Token = "0x600A1B5")]
[Address(RVA = "0x1C812B0", Offset = "0x1C7FCB0", VA = "0x181C812B0")]
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: 0x0600A1B6 RID: 41398 RVA: 0x002599E8 File Offset: 0x00257BE8
[Token(Token = "0x600A1B6")]
[Address(RVA = "0x1C81300", Offset = "0x1C7FD00", VA = "0x181C81300")]
public CmsSignedData(byte[] sigBlock)
{
int num;
MemoryStream memoryStream = new MemoryStream(sigBlock, num != 0);
num = 0;
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(memoryStream, int.MaxValue));
}
// Token: 0x0600A1B7 RID: 41399 RVA: 0x00259A10 File Offset: 0x00257C10
[Token(Token = "0x600A1B7")]
[Address(RVA = "0x1C81100", Offset = "0x1C7FB00", VA = "0x181C81100")]
public CmsSignedData(CmsProcessable signedContent, byte[] sigBlock)
{
int num;
MemoryStream memoryStream = new MemoryStream(sigBlock, num != 0);
num = 0;
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(memoryStream, int.MaxValue));
}
// Token: 0x0600A1B8 RID: 41400 RVA: 0x00259A38 File Offset: 0x00257C38
[Token(Token = "0x600A1B8")]
[Address(RVA = "0x1C811D0", Offset = "0x1C7FBD0", VA = "0x181C811D0")]
public CmsSignedData(IDictionary hashes, byte[] sigBlock)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(sigBlock));
base..ctor();
this.hashes = hashes;
this.contentInfo = contentInfo;
SignedData instance = SignedData.GetInstance(contentInfo.content);
this.signedData = instance;
}
// Token: 0x0600A1B9 RID: 41401 RVA: 0x00259A80 File Offset: 0x00257C80
[Token(Token = "0x600A1B9")]
[Address(RVA = "0x1C80ED0", Offset = "0x1C7F8D0", VA = "0x181C80ED0")]
public CmsSignedData(CmsProcessable signedContent, Stream sigData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(sigData, int.MaxValue));
}
// Token: 0x0600A1BA RID: 41402 RVA: 0x00259AA0 File Offset: 0x00257CA0
[Token(Token = "0x600A1BA")]
[Address(RVA = "0x1C80F60", Offset = "0x1C7F960", VA = "0x181C80F60")]
public CmsSignedData(Stream sigData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(sigData, int.MaxValue));
}
// Token: 0x0600A1BB RID: 41403 RVA: 0x00259AC0 File Offset: 0x00257CC0
[Token(Token = "0x600A1BB")]
[Address(RVA = "0x1C80FE0", Offset = "0x1C7F9E0", VA = "0x181C80FE0")]
public CmsSignedData(CmsProcessable signedContent, ContentInfo sigData)
{
this.signedContent = signedContent;
this.contentInfo = sigData;
SignedData instance = SignedData.GetInstance(sigData.content);
this.signedData = instance;
}
// Token: 0x0600A1BC RID: 41404 RVA: 0x00259AFC File Offset: 0x00257CFC
[Token(Token = "0x600A1BC")]
[Address(RVA = "0x1C81070", Offset = "0x1C7FA70", VA = "0x181C81070")]
public CmsSignedData(IDictionary hashes, ContentInfo sigData)
{
this.hashes = hashes;
this.contentInfo = sigData;
SignedData instance = SignedData.GetInstance(sigData.content);
this.signedData = instance;
}
// Token: 0x0600A1BD RID: 41405 RVA: 0x00259B38 File Offset: 0x00257D38
[Token(Token = "0x600A1BD")]
[Address(RVA = "0x1C813C0", Offset = "0x1C7FDC0", VA = "0x181C813C0")]
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: 0x17001960 RID: 6496
// (get) Token: 0x0600A1BE RID: 41406 RVA: 0x00259B90 File Offset: 0x00257D90
[Token(Token = "0x17001960")]
public int Version
{
[Token(Token = "0x600A1BE")]
[Address(RVA = "0x668C80", Offset = "0x667680", VA = "0x180668C80")]
get
{
return this.signedData.version.Value.IntValue;
}
}
// Token: 0x0600A1BF RID: 41407 RVA: 0x00259BB8 File Offset: 0x00257DB8
[Token(Token = "0x600A1BF")]
[Address(RVA = "0x1C800A0", Offset = "0x1C7EAA0", VA = "0x181C800A0")]
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)
{
}
if (num5 != -1)
{
}
}
while (num5 != 0);
SignerInformationStore signerInformationStore2 = new SignerInformationStore(list);
this.signerInfoStore = signerInformationStore2;
return signerInformationStore;
}
// Token: 0x0600A1C0 RID: 41408 RVA: 0x00259CD4 File Offset: 0x00257ED4
[Token(Token = "0x600A1C0")]
[Address(RVA = "0x1C7FEA0", Offset = "0x1C7E8A0", VA = "0x181C7FEA0")]
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: 0x0600A1C1 RID: 41409 RVA: 0x00259D18 File Offset: 0x00257F18
[Token(Token = "0x600A1C1")]
[Address(RVA = "0x1C7FF40", Offset = "0x1C7E940", VA = "0x181C7FF40")]
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: 0x0600A1C2 RID: 41410 RVA: 0x00259D5C File Offset: 0x00257F5C
[Token(Token = "0x600A1C2")]
[Address(RVA = "0x1C7FFE0", Offset = "0x1C7E9E0", VA = "0x181C7FFE0")]
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: 0x17001961 RID: 6497
// (get) Token: 0x0600A1C3 RID: 41411 RVA: 0x00259DA0 File Offset: 0x00257FA0
[Token(Token = "0x17001961")]
[Obsolete]
public string SignedContentTypeOid
{
[Token(Token = "0x600A1C3")]
[Address(RVA = "0x1C81530", Offset = "0x1C7FF30", VA = "0x181C81530")]
get
{
return this.signedData.contentInfo.contentType.identifier;
}
}
// Token: 0x17001962 RID: 6498
// (get) Token: 0x0600A1C4 RID: 41412 RVA: 0x00259DC8 File Offset: 0x00257FC8
[Token(Token = "0x17001962")]
public DerObjectIdentifier SignedContentType
{
[Token(Token = "0x600A1C4")]
[Address(RVA = "0x1C81560", Offset = "0x1C7FF60", VA = "0x181C81560")]
get
{
return this.signedData.contentInfo.contentType;
}
}
// Token: 0x17001963 RID: 6499
// (get) Token: 0x0600A1C5 RID: 41413 RVA: 0x00259DEC File Offset: 0x00257FEC
[Token(Token = "0x17001963")]
public CmsProcessable SignedContent
{
[Token(Token = "0x600A1C5")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0")]
get
{
return this.signedContent;
}
}
// Token: 0x17001964 RID: 6500
// (get) Token: 0x0600A1C6 RID: 41414 RVA: 0x00259E00 File Offset: 0x00258000
[Token(Token = "0x17001964")]
public ContentInfo ContentInfo
{
[Token(Token = "0x600A1C6")]
[Address(RVA = "0x3C1220", Offset = "0x3BFC20", VA = "0x1803C1220")]
get
{
return this.contentInfo;
}
}
// Token: 0x0600A1C7 RID: 41415 RVA: 0x00259E14 File Offset: 0x00258014
[Token(Token = "0x600A1C7")]
[Address(RVA = "0x1C80080", Offset = "0x1C7EA80", VA = "0x181C80080")]
public byte[] GetEncoded()
{
return this.contentInfo.GetEncoded();
}
// Token: 0x0600A1C8 RID: 41416 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600A1C8")]
[Address(RVA = "0x1C806F0", Offset = "0x1C7F0F0", VA = "0x181C806F0")]
public static CmsSignedData ReplaceSigners(CmsSignedData signedData, SignerInformationStore signerInformationStore)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600A1C9 RID: 41417 RVA: 0x00259E34 File Offset: 0x00258034
[Token(Token = "0x600A1C9")]
[Address(RVA = "0x1C80460", Offset = "0x1C7EE60", VA = "0x181C80460")]
public static CmsSignedData ReplaceCertificatesAndCrls(CmsSignedData signedData, IX509Store x509Certs, IX509Store x509Crls, IX509Store x509AttrCerts)
{
/*
An exception occurred when decompiling this method (0600A1C9)
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: 0x04006A70 RID: 27248
[Token(Token = "0x4006A70")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x04006A71 RID: 27249
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A71")]
private readonly CmsProcessable signedContent;
// Token: 0x04006A72 RID: 27250
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A72")]
private SignedData signedData;
// Token: 0x04006A73 RID: 27251
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006A73")]
private ContentInfo contentInfo;
// Token: 0x04006A74 RID: 27252
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006A74")]
private SignerInformationStore signerInfoStore;
// Token: 0x04006A75 RID: 27253
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006A75")]
private IX509Store attrCertStore;
// Token: 0x04006A76 RID: 27254
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006A76")]
private IX509Store certificateStore;
// Token: 0x04006A77 RID: 27255
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006A77")]
private IX509Store crlStore;
// Token: 0x04006A78 RID: 27256
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006A78")]
private IDictionary hashes;
}
}
@@ -0,0 +1,538 @@
using System;
using System.Collections;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001768 RID: 5992
[Token(Token = "0x2001768")]
[StructLayout(3)]
public class CmsSignedDataGenerator : CmsSignedGenerator
{
// Token: 0x0600A1CB RID: 41419 RVA: 0x00259F1C File Offset: 0x0025811C
[Token(Token = "0x600A1CB")]
[Address(RVA = "0x1C7B5E0", Offset = "0x1C79FE0", VA = "0x181C7B5E0")]
public CmsSignedDataGenerator()
{
IList list = Platform.CreateArrayList();
this.signerInfs = list;
SecureRandom secureRandom = new SecureRandom();
base..ctor(secureRandom);
}
// Token: 0x0600A1CC RID: 41420 RVA: 0x00259F48 File Offset: 0x00258148
[Token(Token = "0x600A1CC")]
[Address(RVA = "0x1C7B550", Offset = "0x1C79F50", VA = "0x181C7B550")]
public CmsSignedDataGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this.signerInfs = list;
base..ctor(rand);
}
// Token: 0x0600A1CD RID: 41421 RVA: 0x00259F6C File Offset: 0x0025816C
[Token(Token = "0x600A1CD")]
[Address(RVA = "0x1C79DE0", Offset = "0x1C787E0", VA = "0x181C79DE0")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOID)
{
string encOid = CmsSignedDataGenerator.Helper.GetEncOid(privateKey, digestOID);
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
int num = 0;
this.doAddSigner(privateKey, signerIdentifier, encOid, digestOID, defaultSignedAttributeTableGenerator, num, num);
}
// Token: 0x0600A1CE RID: 41422 RVA: 0x00259FA8 File Offset: 0x002581A8
[Token(Token = "0x600A1CE")]
[Address(RVA = "0x1C7A3B0", Offset = "0x1C78DB0", VA = "0x181C7A3B0")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOID, string digestOID)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
}
// Token: 0x0600A1CF RID: 41423 RVA: 0x00259FC4 File Offset: 0x002581C4
[Token(Token = "0x600A1CF")]
[Address(RVA = "0x1C79CA0", Offset = "0x1C786A0", VA = "0x181C79CA0")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOID)
{
string encOid = CmsSignedDataGenerator.Helper.GetEncOid(privateKey, digestOID);
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
int num = 0;
this.doAddSigner(privateKey, signerIdentifier, encOid, digestOID, defaultSignedAttributeTableGenerator, num, num);
}
// Token: 0x0600A1D0 RID: 41424 RVA: 0x0025A000 File Offset: 0x00258200
[Token(Token = "0x600A1D0")]
[Address(RVA = "0x1C7A490", Offset = "0x1C78E90", VA = "0x181C7A490")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOID, string digestOID)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
}
// Token: 0x0600A1D1 RID: 41425 RVA: 0x0025A01C File Offset: 0x0025821C
[Token(Token = "0x600A1D1")]
[Address(RVA = "0x1C7A160", Offset = "0x1C78B60", VA = "0x181C7A160")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOID, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttr, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttr)
{
string encOid = CmsSignedDataGenerator.Helper.GetEncOid(privateKey, digestOID);
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
}
// Token: 0x0600A1D2 RID: 41426 RVA: 0x0025A044 File Offset: 0x00258244
[Token(Token = "0x600A1D2")]
[Address(RVA = "0x1C7A050", Offset = "0x1C78A50", VA = "0x181C7A050")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOID, string digestOID, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttr, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttr)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
}
// Token: 0x0600A1D3 RID: 41427 RVA: 0x0025A058 File Offset: 0x00258258
[Token(Token = "0x600A1D3")]
[Address(RVA = "0x1C7A570", Offset = "0x1C78F70", VA = "0x181C7A570")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOID, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttr, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttr)
{
string encOid = CmsSignedDataGenerator.Helper.GetEncOid(privateKey, digestOID);
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
}
// Token: 0x0600A1D4 RID: 41428 RVA: 0x0025A080 File Offset: 0x00258280
[Token(Token = "0x600A1D4")]
[Address(RVA = "0x1C7A700", Offset = "0x1C79100", VA = "0x181C7A700")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOID, string digestOID, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttr, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttr)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
}
// Token: 0x0600A1D5 RID: 41429 RVA: 0x0025A094 File Offset: 0x00258294
[Token(Token = "0x600A1D5")]
[Address(RVA = "0x1C79F20", Offset = "0x1C78920", VA = "0x181C79F20")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOID, CmsAttributeTableGenerator signedAttrGen, CmsAttributeTableGenerator unsignedAttrGen)
{
string encOid = CmsSignedDataGenerator.Helper.GetEncOid(privateKey, digestOID);
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
}
// Token: 0x0600A1D6 RID: 41430 RVA: 0x0025A0C0 File Offset: 0x002582C0
[Token(Token = "0x600A1D6")]
[Address(RVA = "0x1C7A2F0", Offset = "0x1C78CF0", VA = "0x181C7A2F0")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOID, string digestOID, CmsAttributeTableGenerator signedAttrGen, CmsAttributeTableGenerator unsignedAttrGen)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
}
// Token: 0x0600A1D7 RID: 41431 RVA: 0x0025A0D8 File Offset: 0x002582D8
[Token(Token = "0x600A1D7")]
[Address(RVA = "0x1C7A810", Offset = "0x1C79210", VA = "0x181C7A810")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOID, CmsAttributeTableGenerator signedAttrGen, CmsAttributeTableGenerator unsignedAttrGen)
{
string encOid = CmsSignedDataGenerator.Helper.GetEncOid(privateKey, digestOID);
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
}
// Token: 0x0600A1D8 RID: 41432 RVA: 0x0025A104 File Offset: 0x00258304
[Token(Token = "0x600A1D8")]
[Address(RVA = "0x1C7A940", Offset = "0x1C79340", VA = "0x181C7A940")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOID, string digestOID, CmsAttributeTableGenerator signedAttrGen, CmsAttributeTableGenerator unsignedAttrGen)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
}
// Token: 0x0600A1D9 RID: 41433 RVA: 0x0025A11C File Offset: 0x0025831C
[Token(Token = "0x600A1D9")]
[Address(RVA = "0x1C79BC0", Offset = "0x1C785C0", VA = "0x181C79BC0")]
public void AddSignerInfoGenerator(SignerInfoGenerator signerInfoGenerator)
{
IList list = this.signerInfs;
ISignatureFactory contentSigner = signerInfoGenerator.contentSigner;
SignerIdentifier sigId = signerInfoGenerator.sigId;
CmsAttributeTableGenerator signedGen = signerInfoGenerator.signedGen;
CmsAttributeTableGenerator unsignedGen = signerInfoGenerator.unsignedGen;
int num;
CmsSignedDataGenerator.SignerInf signerInf = new CmsSignedDataGenerator.SignerInf(this, contentSigner, sigId, signedGen, unsignedGen, num);
num = 0;
throw new NullReferenceException();
}
// Token: 0x0600A1DA RID: 41434 RVA: 0x0025A164 File Offset: 0x00258364
[Token(Token = "0x600A1DA")]
[Address(RVA = "0x1C7B6A0", Offset = "0x1C7A0A0", VA = "0x181C7B6A0")]
private void doAddSigner(AsymmetricKeyParameter privateKey, SignerIdentifier signerIdentifier, string encryptionOID, string digestOID, CmsAttributeTableGenerator signedAttrGen, CmsAttributeTableGenerator unsignedAttrGen, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable baseSignedTable)
{
IList list = this.signerInfs;
CmsSignedHelper helper = CmsSignedDataGenerator.Helper;
string encryptionAlgName = CmsSignedDataGenerator.Helper.GetEncryptionAlgName(encryptionOID);
string text2;
string text = text2 + "with" + encryptionAlgName;
CmsSignedDataGenerator.SignerInf signerInf;
signerInf.outer = this;
Asn1SignatureFactory asn1SignatureFactory = new Asn1SignatureFactory(text, privateKey);
signerInf.sAttr = 0;
signerInf.unsAttr = 0;
signerInf.baseSignedTable = 0;
signerInf.sigCalc = asn1SignatureFactory;
signerInf.signerIdentifier = signerIdentifier;
signerInf.digestOID = 0;
signerInf.encOID = encryptionOID;
throw new NullReferenceException();
}
// Token: 0x0600A1DB RID: 41435 RVA: 0x0025A1E4 File Offset: 0x002583E4
[Token(Token = "0x600A1DB")]
[Address(RVA = "0x1C7AAA0", Offset = "0x1C794A0", VA = "0x181C7AAA0")]
public CmsSignedData Generate(CmsProcessable content)
{
int num = 0;
string data = CmsSignedGenerator.Data;
return this.Generate(data, content, num != 0);
}
// Token: 0x0600A1DC RID: 41436 RVA: 0x0025A204 File Offset: 0x00258404
[Token(Token = "0x600A1DC")]
[Address(RVA = "0x1C7AB20", Offset = "0x1C79520", VA = "0x181C7AB20")]
public CmsSignedData Generate(string signedContentType, CmsProcessable content, bool encapsulate)
{
int num;
Asn1EncodableVector asn1EncodableVector;
for (;;)
{
num = 0;
IDictionary digests = this._digests;
IList signers = this._signers;
if (asn1EncodableVector != 0)
{
break;
}
ArrayTypeMismatchException ex;
if (ex != 0)
{
}
Asn1Encodable[] array;
if ((num == -1 || array == 0) && num != 0)
{
goto IL_18A;
}
DerObjectIdentifier derObjectIdentifier;
if (derObjectIdentifier != 0)
{
goto Block_3;
}
num++;
if (num != 0)
{
}
AlgorithmIdentifier algorithmIdentifier;
if ((num != -1 && "{il2cpp array field local34->}" == (ulong)345L) || algorithmIdentifier == 0)
{
goto IL_DE;
}
}
if (asn1EncodableVector == 0)
{
}
if (asn1EncodableVector != 0)
{
Asn1Encodable[] array2 = new Asn1Encodable[1];
CmsSignedHelper helper = CmsSignedDataGenerator.Helper;
throw new ArrayTypeMismatchException();
}
throw new NullReferenceException();
Block_3:
Asn1Encodable[] array3 = new Asn1Encodable[1];
throw new ArrayTypeMismatchException();
IL_DE:
SignerInfo signerInfo;
DerInteger version = signerInfo.version;
if (num != 0)
{
int num2 = 0;
DerInteger version2 = signerInfo.version;
if (signerInfo.digEncryptionAlgorithm != num2)
{
}
}
SignerIdentifier sid = signerInfo.sid;
Asn1Set asn1Set;
if (asn1Set != 0)
{
SignerIdentifier sid2 = signerInfo.sid;
}
if (new MemoryStream() != 0)
{
}
DerSet derSet = new DerSet(asn1EncodableVector);
DerSet derSet2;
ContentInfo contentInfo;
Asn1Set asn1Set2;
SignedData signedData = new SignedData(derSet2, contentInfo, asn1Set, asn1Set2, derSet);
ContentInfo contentInfo2 = new ContentInfo(CmsObjectIdentifiers.SignedData, signedData);
CmsSignedData cmsSignedData;
return cmsSignedData;
IL_18A:
throw new IndexOutOfRangeException();
}
// Token: 0x0600A1DD RID: 41437 RVA: 0x0025A3CC File Offset: 0x002585CC
[Token(Token = "0x600A1DD")]
[Address(RVA = "0x1C7B450", Offset = "0x1C79E50", VA = "0x181C7B450")]
public CmsSignedData Generate(CmsProcessable content, bool encapsulate)
{
string data = CmsSignedGenerator.Data;
return this.Generate(data, content, encapsulate);
}
// Token: 0x0600A1DE RID: 41438 RVA: 0x0025A3E8 File Offset: 0x002585E8
[Token(Token = "0x600A1DE")]
[Address(RVA = "0x1C7AA00", Offset = "0x1C79400", VA = "0x181C7AA00")]
public SignerInformationStore GenerateCounterSigners(SignerInformation signer)
{
byte[] signature = signer.GetSignature();
int num = 0;
CmsProcessableByteArray cmsProcessableByteArray;
cmsProcessableByteArray.bytes = signature;
int num2 = 0;
return this.Generate(num2, cmsProcessableByteArray, num != 0).GetSignerInfos();
}
// Token: 0x04006A79 RID: 27257
[Token(Token = "0x4006A79")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x04006A7A RID: 27258
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006A7A")]
private readonly IList signerInfs;
// Token: 0x02001769 RID: 5993
[Token(Token = "0x2001769")]
private class SignerInf
{
// Token: 0x0600A1E0 RID: 41440 RVA: 0x0025A438 File Offset: 0x00258638
[Token(Token = "0x600A1E0")]
[Address(RVA = "0x1C86C10", Offset = "0x1C85610", VA = "0x181C86C10")]
internal SignerInf(CmsSignedGenerator outer, AsymmetricKeyParameter key, SignerIdentifier signerIdentifier, string digestOID, string encOID, CmsAttributeTableGenerator sAttr, CmsAttributeTableGenerator unsAttr, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable baseSignedTable)
{
CmsSignedHelper helper = CmsSignedDataGenerator.Helper;
CmsSignedHelper helper2 = CmsSignedDataGenerator.Helper;
string text2;
string text3;
string text = text2 + "with" + text3;
this.outer = outer;
Asn1SignatureFactory asn1SignatureFactory = new Asn1SignatureFactory(text, key);
this.sAttr = 0;
this.unsAttr = 0;
this.sigCalc = asn1SignatureFactory;
this.digestOID = 0;
this.encOID = 0;
this.baseSignedTable = 0;
this.signerIdentifier = signerIdentifier;
}
// Token: 0x0600A1E1 RID: 41441 RVA: 0x0025A4B0 File Offset: 0x002586B0
[Token(Token = "0x600A1E1")]
[Address(RVA = "0x1C86D70", Offset = "0x1C85770", VA = "0x181C86D70")]
internal SignerInf(CmsSignedGenerator outer, ISignatureFactory sigCalc, SignerIdentifier signerIdentifier, CmsAttributeTableGenerator sAttr, CmsAttributeTableGenerator unsAttr, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable baseSignedTable)
{
Asn1Object asn1Object;
for (;;)
{
base..ctor();
this.outer = outer;
this.sigCalc = sigCalc;
this.signerIdentifier = signerIdentifier;
DefaultDigestAlgorithmIdentifierFinder defaultDigestAlgorithmIdentifierFinder = new DefaultDigestAlgorithmIdentifierFinder();
if (defaultDigestAlgorithmIdentifierFinder == 0)
{
}
if (defaultDigestAlgorithmIdentifierFinder != 0)
{
AlgorithmIdentifier algorithmIdentifier;
asn1Object = algorithmIdentifier.ToAsn1Object();
this.digestOID = asn1Object;
if (asn1Object != 0 && asn1Object != 0)
{
break;
}
}
}
Asn1Object asn1Object2 = asn1Object.ToAsn1Object();
this.encOID = asn1Object2;
this.sAttr = 0;
this.unsAttr = 0;
this.baseSignedTable = 0;
}
// Token: 0x17001965 RID: 6501
// (get) Token: 0x0600A1E2 RID: 41442 RVA: 0x0025A538 File Offset: 0x00258738
[Token(Token = "0x17001965")]
internal AlgorithmIdentifier DigestAlgorithmID
{
[Token(Token = "0x600A1E2")]
[Address(RVA = "0x1C86F90", Offset = "0x1C85990", VA = "0x181C86F90")]
get
{
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(this.digestOID);
DerNull instance = DerNull.Instance;
return new AlgorithmIdentifier(derObjectIdentifier, instance);
}
}
// Token: 0x17001966 RID: 6502
// (get) Token: 0x0600A1E3 RID: 41443 RVA: 0x0025A560 File Offset: 0x00258760
[Token(Token = "0x17001966")]
internal CmsAttributeTableGenerator SignedAttributes
{
[Token(Token = "0x600A1E3")]
[Address(RVA = "0x3EE8E0", Offset = "0x3ED2E0", VA = "0x1803EE8E0")]
get
{
return this.sAttr;
}
}
// Token: 0x17001967 RID: 6503
// (get) Token: 0x0600A1E4 RID: 41444 RVA: 0x0025A574 File Offset: 0x00258774
[Token(Token = "0x17001967")]
internal CmsAttributeTableGenerator UnsignedAttributes
{
[Token(Token = "0x600A1E4")]
[Address(RVA = "0x3D32F0", Offset = "0x3D1CF0", VA = "0x1803D32F0")]
get
{
return this.unsAttr;
}
}
// Token: 0x0600A1E5 RID: 41445 RVA: 0x0025A588 File Offset: 0x00258788
[Token(Token = "0x600A1E5")]
[Address(RVA = "0x1C864D0", Offset = "0x1C84ED0", VA = "0x181C864D0")]
internal SignerInfo ToSignerInfo(DerObjectIdentifier contentType, CmsProcessable content, SecureRandom random)
{
string text3;
for (;;)
{
AlgorithmIdentifier digestAlgorithmID = this.DigestAlgorithmID;
CmsSignedHelper helper = CmsSignedDataGenerator.Helper;
string text = this.digestOID;
string digestAlgName = helper.GetDigestAlgName(text);
CmsSignedHelper helper2 = CmsSignedDataGenerator.Helper;
string text2 = this.encOID;
string encryptionAlgName = helper2.GetEncryptionAlgName(text2);
text3 = digestAlgName + "with" + encryptionAlgName;
IDictionary digests = this.outer._digests;
if (text3 == 0)
{
IDigest digestInstance = CmsSignedDataGenerator.Helper.GetDigestInstance(digestAlgName);
if (content != 0)
{
DigestSink digestSink = new DigestSink(digestInstance);
}
byte[] array = DigestUtilities.DoFinal(digestInstance);
IDictionary digests2 = this.outer._digests;
}
CmsSignedGenerator cmsSignedGenerator = this.outer;
IDictionary digests3 = cmsSignedGenerator._digests;
if (cmsSignedGenerator == 0)
{
}
if (cmsSignedGenerator != 0)
{
ISignatureFactory signatureFactory = this.sigCalc;
int num = 0;
BufferedStream bufferedStream;
DerOutputStream derOutputStream;
if (this.sAttr != num || content != 0)
{
string text4 = this.outer.ToString();
CmsAttributeTableGenerator cmsAttributeTableGenerator = this.sAttr;
if (text4 != 0)
{
DerObjectIdentifier contentType2 = CmsAttributes.ContentType;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute attribute;
if (attribute != 0)
{
IDictionary dictionary;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(dictionary);
}
}
CmsSignedGenerator cmsSignedGenerator2 = this.outer;
derOutputStream = new DerOutputStream(bufferedStream);
}
Platform.Dispose(bufferedStream);
if (derOutputStream != 0 && derOutputStream != 0)
{
break;
}
}
}
int num2 = 0;
if (this.unsAttr != num2)
{
string text5 = this.outer.ToString();
CmsAttributeTableGenerator cmsAttributeTableGenerator2 = this.unsAttr;
CmsSignedGenerator cmsSignedGenerator3 = this.outer;
}
Asn1Encodable defaultX509Parameters = SignerUtilities.GetDefaultX509Parameters(text3);
string text6 = this.encOID;
CmsSignedHelper helper3 = CmsSignedDataGenerator.Helper;
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(text6);
AlgorithmIdentifier encAlgorithmIdentifier = helper3.GetEncAlgorithmIdentifier(derObjectIdentifier, defaultX509Parameters);
SignerInfo signerInfo;
return signerInfo;
}
// Token: 0x04006A7B RID: 27259
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A7B")]
private readonly CmsSignedGenerator outer;
// Token: 0x04006A7C RID: 27260
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A7C")]
private readonly ISignatureFactory sigCalc;
// Token: 0x04006A7D RID: 27261
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006A7D")]
private readonly SignerIdentifier signerIdentifier;
// Token: 0x04006A7E RID: 27262
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006A7E")]
private readonly string digestOID;
// Token: 0x04006A7F RID: 27263
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006A7F")]
private readonly string encOID;
// Token: 0x04006A80 RID: 27264
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006A80")]
private readonly CmsAttributeTableGenerator sAttr;
// Token: 0x04006A81 RID: 27265
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006A81")]
private readonly CmsAttributeTableGenerator unsAttr;
// Token: 0x04006A82 RID: 27266
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006A82")]
private readonly BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable baseSignedTable;
}
}
}
@@ -0,0 +1,503 @@
using System;
using System.Collections;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200176A RID: 5994
[Token(Token = "0x200176A")]
[StructLayout(3)]
public class CmsSignedDataParser : CmsContentInfoParser
{
// Token: 0x0600A1E6 RID: 41446 RVA: 0x0025A70C File Offset: 0x0025890C
[Token(Token = "0x600A1E6")]
[Address(RVA = "0x1C7D9E0", Offset = "0x1C7C3E0", VA = "0x181C7D9E0")]
public CmsSignedDataParser(byte[] sigBlock)
{
int num;
MemoryStream memoryStream = new MemoryStream(sigBlock, num != 0);
num = 0;
}
// Token: 0x0600A1E7 RID: 41447 RVA: 0x0025A728 File Offset: 0x00258928
[Token(Token = "0x600A1E7")]
[Address(RVA = "0x1C7D4C0", Offset = "0x1C7BEC0", VA = "0x181C7D4C0")]
public CmsSignedDataParser(CmsTypedStream signedContent, byte[] sigBlock)
{
int num;
MemoryStream memoryStream = new MemoryStream(sigBlock, num != 0);
num = 0;
}
// Token: 0x0600A1E8 RID: 41448 RVA: 0x0025A740 File Offset: 0x00258940
[Token(Token = "0x600A1E8")]
[Address(RVA = "0x1C7D9D0", Offset = "0x1C7C3D0", VA = "0x181C7D9D0")]
public CmsSignedDataParser(Stream sigData)
{
}
// Token: 0x0600A1E9 RID: 41449 RVA: 0x0025A750 File Offset: 0x00258950
[Token(Token = "0x600A1E9")]
[Address(RVA = "0x1C7D540", Offset = "0x1C7BF40", VA = "0x181C7D540")]
public CmsSignedDataParser(CmsTypedStream signedContent, Stream sigData)
: base(sigData)
{
this._signedContent = signedContent;
IAsn1Convertible content = this.contentInfo.GetContent(16);
SignedDataParser signedDataParser;
this._signedData = signedDataParser;
IDictionary dictionary = Platform.CreateHashtable();
this._digests = dictionary;
HashSet hashSet = new HashSet();
this._digestOids = hashSet;
if (this._signedData.GetDigestAlgorithms() != 0)
{
AlgorithmIdentifier algorithmIdentifier;
Asn1Object asn1Object = algorithmIdentifier.ToAsn1Object();
CmsSignedHelper helper = CmsSignedDataParser.Helper;
IDictionary digests = this._digests;
string text;
if (text == 0)
{
IDictionary digests2 = this._digests;
IDigest digestInstance = CmsSignedDataParser.Helper.GetDigestInstance(text);
ISet digestOids = this._digestOids;
}
}
ContentInfoParser encapContentInfo = this._signedData.GetEncapContentInfo();
IAsn1Convertible content2 = encapContentInfo.GetContent(4);
if (content2 != 0)
{
if (content2 == 0)
{
throw new NullReferenceException();
}
DerObjectIdentifier contentType = encapContentInfo.contentType;
if (this._signedContent == (ulong)0L)
{
goto IL_F0;
}
CmsTypedStream cmsTypedStream;
Streams.Drain(cmsTypedStream._in);
Platform.Dispose(cmsTypedStream._in);
}
CmsTypedStream signedContent2 = this._signedContent;
if (signedContent2 == 0)
{
DerObjectIdentifier contentType2 = encapContentInfo.contentType;
}
IL_F0:
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(signedContent2._oid);
this._signedContentType = derObjectIdentifier;
}
// Token: 0x17001968 RID: 6504
// (get) Token: 0x0600A1EA RID: 41450 RVA: 0x0025A8C4 File Offset: 0x00258AC4
[Token(Token = "0x17001968")]
public int Version
{
[Token(Token = "0x600A1EA")]
[Address(RVA = "0x1C7DAB0", Offset = "0x1C7C4B0", VA = "0x181C7DAB0")]
get
{
return this._signedData._version.Value.IntValue;
}
}
// Token: 0x17001969 RID: 6505
// (get) Token: 0x0600A1EB RID: 41451 RVA: 0x0025A8EC File Offset: 0x00258AEC
[Token(Token = "0x17001969")]
public ISet DigestOids
{
[Token(Token = "0x600A1EB")]
[Address(RVA = "0x1C7DA50", Offset = "0x1C7C450", VA = "0x181C7DA50")]
get
{
/*
An exception occurred when decompiling this method (0600A1EB)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections.ISet BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedDataParser::get_DigestOids()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:HashSet(var_0_0B, newobj:HashSet(HashSet::.ctor, ldfld:ISet[exp:IEnumerable](CmsSignedDataParser::_digestOids, ldloc:CmsSignedDataParser(this))))
}
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: 0x0600A1EC RID: 41452 RVA: 0x0025A904 File Offset: 0x00258B04
[Token(Token = "0x600A1EC")]
[Address(RVA = "0x1C7C930", Offset = "0x1C7B330", VA = "0x181C7C930")]
public SignerInformationStore GetSignerInfos()
{
int num = 0;
SignerInformationStore signerInfoStore = this._signerInfoStore;
if (signerInfoStore == 0)
{
this.PopulateCertCrlSets();
IList list = Platform.CreateArrayList();
IDictionary dictionary = Platform.CreateHashtable();
IDictionary digests = this._digests;
if (dictionary != 0)
{
IDictionary digests2 = this._digests;
}
int num2 = 0;
byte[] array;
if (array != 0)
{
}
if (num2 != -1)
{
}
if (num != 0)
{
throw new NullReferenceException();
}
if (this._signedData.GetSignerInfos() != 0)
{
CmsSignedHelper helper = CmsSignedDataParser.Helper;
SignerInfo signerInfo;
Asn1Object asn1Object = signerInfo.digAlgorithm.ToAsn1Object();
DerObjectIdentifier signedContentType = this._signedContentType;
BaseDigestCalculator baseDigestCalculator;
string text;
baseDigestCalculator.digest = text;
int num3;
SignerInformation signerInformation = new SignerInformation(signerInfo, signedContentType, num3, baseDigestCalculator);
num3 = 0;
}
SignerInformationStore signerInformationStore;
this._signerInfoStore = signerInformationStore;
}
return signerInfoStore;
}
// Token: 0x0600A1ED RID: 41453 RVA: 0x0025AA0C File Offset: 0x00258C0C
[Token(Token = "0x600A1ED")]
[Address(RVA = "0x1C7C4A0", Offset = "0x1C7AEA0", VA = "0x181C7C4A0")]
public IX509Store GetAttributeCertificates(string type)
{
IX509Store attributeStore = this._attributeStore;
if (attributeStore == 0)
{
this.PopulateCertCrlSets();
CmsSignedHelper helper = CmsSignedDataParser.Helper;
Asn1Set certSet = this._certSet;
IX509Store ix509Store = helper.CreateAttributeStore(type, certSet);
this._attributeStore = ix509Store;
}
return attributeStore;
}
// Token: 0x0600A1EE RID: 41454 RVA: 0x0025AA50 File Offset: 0x00258C50
[Token(Token = "0x600A1EE")]
[Address(RVA = "0x1C7C540", Offset = "0x1C7AF40", VA = "0x181C7C540")]
public IX509Store GetCertificates(string type)
{
IX509Store certificateStore = this._certificateStore;
if (certificateStore == 0)
{
this.PopulateCertCrlSets();
CmsSignedHelper helper = CmsSignedDataParser.Helper;
Asn1Set certSet = this._certSet;
IX509Store ix509Store = helper.CreateCertificateStore(type, certSet);
this._certificateStore = ix509Store;
}
return certificateStore;
}
// Token: 0x0600A1EF RID: 41455 RVA: 0x0025AA94 File Offset: 0x00258C94
[Token(Token = "0x600A1EF")]
[Address(RVA = "0x1C7C5E0", Offset = "0x1C7AFE0", VA = "0x181C7C5E0")]
public IX509Store GetCrls(string type)
{
IX509Store crlStore = this._crlStore;
if (crlStore == 0)
{
this.PopulateCertCrlSets();
CmsSignedHelper helper = CmsSignedDataParser.Helper;
Asn1Set crlSet = this._crlSet;
IX509Store ix509Store = helper.CreateCrlStore(type, crlSet);
this._crlStore = ix509Store;
}
return crlStore;
}
// Token: 0x0600A1F0 RID: 41456 RVA: 0x0025AAD8 File Offset: 0x00258CD8
[Token(Token = "0x600A1F0")]
[Address(RVA = "0x1C7CDC0", Offset = "0x1C7B7C0", VA = "0x181C7CDC0")]
private void PopulateCertCrlSets()
{
if (!this._isCertCrlParsed)
{
this._isCertCrlParsed = true;
if (this._signedData.GetCertificates() == 0)
{
}
Asn1Set asn1Set;
this._certSet = asn1Set;
if (this._signedData.GetCrls() != 0)
{
}
Asn1Set asn1Set2;
this._crlSet = asn1Set2;
}
}
// Token: 0x1700196A RID: 6506
// (get) Token: 0x0600A1F1 RID: 41457 RVA: 0x0025AB2C File Offset: 0x00258D2C
[Token(Token = "0x1700196A")]
public DerObjectIdentifier SignedContentType
{
[Token(Token = "0x600A1F1")]
[Address(RVA = "0x3C1230", Offset = "0x3BFC30", VA = "0x1803C1230")]
get
{
return this._signedContentType;
}
}
// Token: 0x0600A1F2 RID: 41458 RVA: 0x0025AB40 File Offset: 0x00258D40
[Token(Token = "0x600A1F2")]
[Address(RVA = "0x1C7C680", Offset = "0x1C7B080", VA = "0x181C7C680")]
public CmsTypedStream GetSignedContent()
{
int num;
CmsTypedStream signedContent;
DigestStream digestStream;
do
{
num = 0;
signedContent = this._signedContent;
if (signedContent == 0)
{
return signedContent;
}
IDictionary digests = this._digests;
if (signedContent != 0)
{
if (num < signedContent)
{
num += num;
num++;
}
if (signedContent == 0)
{
}
if (signedContent == 0)
{
goto IL_58;
}
}
if (digestStream != 0)
{
}
if (num != -1)
{
}
}
while (num != 0);
uint num2;
CmsTypedStream cmsTypedStream = new CmsTypedStream(this._signedContent._oid, digestStream, (int)num2);
return signedContent;
IL_58:
throw new NullReferenceException();
}
// Token: 0x0600A1F3 RID: 41459 RVA: 0x0025ABAC File Offset: 0x00258DAC
[Token(Token = "0x600A1F3")]
[Address(RVA = "0x1C7D140", Offset = "0x1C7BB40", VA = "0x181C7D140")]
public static Stream ReplaceSigners(Stream original, SignerInformationStore signerInformationStore, Stream outStr)
{
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator = new CmsSignedDataStreamGenerator();
int num;
CmsSignedDataParser cmsSignedDataParser = new CmsSignedDataParser(num, original);
num = 0;
cmsSignedDataStreamGenerator.AddSigners(signerInformationStore);
CmsTypedStream signedContent = cmsSignedDataParser.GetSignedContent();
DerObjectIdentifier signedContentType = cmsSignedDataParser._signedContentType;
bool flag = signedContent != 0;
string identifier = signedContentType.identifier;
int num2 = 0;
Stream stream = cmsSignedDataStreamGenerator.Open(outStr, identifier, flag, num2);
if (flag)
{
Streams.PipeAll(signedContent._in, stream);
}
IX509Store ix509Store;
if (cmsSignedDataParser._attributeStore == 0)
{
cmsSignedDataParser.PopulateCertCrlSets();
CmsSignedHelper helper = CmsSignedDataParser.Helper;
Asn1Set certSet = cmsSignedDataParser._certSet;
ix509Store = helper.CreateAttributeStore("Collection", certSet);
cmsSignedDataParser._attributeStore = ix509Store;
}
cmsSignedDataStreamGenerator.AddAttributeCertificates(ix509Store);
IX509Store ix509Store2;
if (cmsSignedDataParser._certificateStore == 0)
{
cmsSignedDataParser.PopulateCertCrlSets();
CmsSignedHelper helper2 = CmsSignedDataParser.Helper;
Asn1Set certSet2 = cmsSignedDataParser._certSet;
ix509Store2 = helper2.CreateCertificateStore("Collection", certSet2);
cmsSignedDataParser._certificateStore = ix509Store2;
}
IList certs = cmsSignedDataStreamGenerator._certs;
IList certificatesFromStore = CmsUtilities.GetCertificatesFromStore(ix509Store2);
CollectionUtilities.AddRange(certs, certificatesFromStore);
IX509Store ix509Store3;
if (cmsSignedDataParser._crlStore == 0)
{
cmsSignedDataParser.PopulateCertCrlSets();
CmsSignedHelper helper3 = CmsSignedDataParser.Helper;
Asn1Set crlSet = cmsSignedDataParser._crlSet;
ix509Store3 = helper3.CreateCrlStore("Collection", crlSet);
cmsSignedDataParser._crlStore = ix509Store3;
}
IList crls = cmsSignedDataStreamGenerator._crls;
IList crlsFromStore = CmsUtilities.GetCrlsFromStore(ix509Store3);
CollectionUtilities.AddRange(crls, crlsFromStore);
Platform.Dispose(stream);
return outStr;
}
// Token: 0x0600A1F4 RID: 41460 RVA: 0x0025AD04 File Offset: 0x00258F04
[Token(Token = "0x600A1F4")]
[Address(RVA = "0x1C7CF40", Offset = "0x1C7B940", VA = "0x181C7CF40")]
public static Stream ReplaceCertificatesAndCrls(Stream original, IX509Store x509Certs, IX509Store x509Crls, IX509Store x509AttrCerts, Stream outStr)
{
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator = new CmsSignedDataStreamGenerator();
int num;
CmsSignedDataParser cmsSignedDataParser = new CmsSignedDataParser(num, original);
num = 0;
HashSet hashSet = new HashSet(cmsSignedDataParser._digestOids);
cmsSignedDataStreamGenerator.AddDigests(hashSet);
CmsTypedStream signedContent = cmsSignedDataParser.GetSignedContent();
DerObjectIdentifier signedContentType = cmsSignedDataParser._signedContentType;
bool flag = signedContent != 0;
Stream stream;
if (flag)
{
Streams.PipeAll(signedContent._in, stream);
}
if (x509AttrCerts != 0)
{
cmsSignedDataStreamGenerator.AddAttributeCertificates(x509AttrCerts);
}
if (x509Certs != 0)
{
IList certs = cmsSignedDataStreamGenerator._certs;
IList certificatesFromStore = CmsUtilities.GetCertificatesFromStore(x509Certs);
CollectionUtilities.AddRange(certs, certificatesFromStore);
}
if (x509Crls != 0)
{
IList crls = cmsSignedDataStreamGenerator._crls;
IList crlsFromStore = CmsUtilities.GetCrlsFromStore(x509Crls);
CollectionUtilities.AddRange(crls, crlsFromStore);
}
SignerInformationStore signerInfos = cmsSignedDataParser.GetSignerInfos();
cmsSignedDataStreamGenerator.AddSigners(signerInfos);
Platform.Dispose(stream);
throw new NullReferenceException();
}
// Token: 0x0600A1F5 RID: 41461 RVA: 0x0025ADC8 File Offset: 0x00258FC8
[Token(Token = "0x600A1F5")]
[Address(RVA = "0x1C7C440", Offset = "0x1C7AE40", VA = "0x181C7C440")]
private static Asn1Set GetAsn1Set(Asn1SetParser asn1SetParser)
{
if (asn1SetParser == 0)
{
}
return Asn1Set.GetInstance(0);
}
// Token: 0x04006A83 RID: 27267
[Token(Token = "0x4006A83")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x04006A84 RID: 27268
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006A84")]
private SignedDataParser _signedData;
// Token: 0x04006A85 RID: 27269
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006A85")]
private DerObjectIdentifier _signedContentType;
// Token: 0x04006A86 RID: 27270
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006A86")]
private CmsTypedStream _signedContent;
// Token: 0x04006A87 RID: 27271
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006A87")]
private IDictionary _digests;
// Token: 0x04006A88 RID: 27272
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006A88")]
private ISet _digestOids;
// Token: 0x04006A89 RID: 27273
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006A89")]
private SignerInformationStore _signerInfoStore;
// Token: 0x04006A8A RID: 27274
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
[Token(Token = "0x4006A8A")]
private Asn1Set _certSet;
// Token: 0x04006A8B RID: 27275
[global::Cpp2IlInjected.FieldOffset(Offset = "0x58")]
[Token(Token = "0x4006A8B")]
private Asn1Set _crlSet;
// Token: 0x04006A8C RID: 27276
[global::Cpp2IlInjected.FieldOffset(Offset = "0x60")]
[Token(Token = "0x4006A8C")]
private bool _isCertCrlParsed;
// Token: 0x04006A8D RID: 27277
[global::Cpp2IlInjected.FieldOffset(Offset = "0x68")]
[Token(Token = "0x4006A8D")]
private IX509Store _attributeStore;
// Token: 0x04006A8E RID: 27278
[global::Cpp2IlInjected.FieldOffset(Offset = "0x70")]
[Token(Token = "0x4006A8E")]
private IX509Store _certificateStore;
// Token: 0x04006A8F RID: 27279
[global::Cpp2IlInjected.FieldOffset(Offset = "0x78")]
[Token(Token = "0x4006A8F")]
private IX509Store _crlStore;
}
}
@@ -0,0 +1,947 @@
using System;
using System.Collections;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200176B RID: 5995
[Token(Token = "0x200176B")]
[StructLayout(3)]
public class CmsSignedDataStreamGenerator : CmsSignedGenerator
{
// Token: 0x0600A1F7 RID: 41463 RVA: 0x0025ADFC File Offset: 0x00258FFC
[Token(Token = "0x600A1F7")]
[Address(RVA = "0x1C7FCE0", Offset = "0x1C7E6E0", VA = "0x181C7FCE0")]
public CmsSignedDataStreamGenerator()
{
IList list = Platform.CreateArrayList();
this._signerInfs = list;
HashSet hashSet = new HashSet();
this._messageDigestOids = hashSet;
IDictionary dictionary = Platform.CreateHashtable();
this._messageDigests = dictionary;
IDictionary dictionary2 = Platform.CreateHashtable();
this._messageHashes = dictionary2;
SecureRandom secureRandom = new SecureRandom();
base..ctor(secureRandom);
}
// Token: 0x0600A1F8 RID: 41464 RVA: 0x0025AE58 File Offset: 0x00259058
[Token(Token = "0x600A1F8")]
[Address(RVA = "0x1C7FDD0", Offset = "0x1C7E7D0", VA = "0x181C7FDD0")]
public CmsSignedDataStreamGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this._signerInfs = list;
HashSet hashSet = new HashSet();
this._messageDigestOids = hashSet;
IDictionary dictionary = Platform.CreateHashtable();
this._messageDigests = dictionary;
IDictionary dictionary2 = Platform.CreateHashtable();
this._messageHashes = dictionary2;
base..ctor(rand);
}
// Token: 0x0600A1F9 RID: 41465 RVA: 0x0025AEAC File Offset: 0x002590AC
[Token(Token = "0x600A1F9")]
[Address(RVA = "0x568460", Offset = "0x566E60", VA = "0x180568460")]
public void SetBufferSize(int bufferSize)
{
this._bufferSize = bufferSize;
}
// Token: 0x0600A1FA RID: 41466 RVA: 0x0025AEC0 File Offset: 0x002590C0
[Token(Token = "0x600A1FA")]
[Address(RVA = "0x1C7DAF0", Offset = "0x1C7C4F0", VA = "0x181C7DAF0")]
public void AddDigests(params string[] digestOids)
{
this.AddDigests(digestOids);
}
// Token: 0x0600A1FB RID: 41467 RVA: 0x0025AED4 File Offset: 0x002590D4
[Token(Token = "0x600A1FB")]
[Address(RVA = "0x1C7DB00", Offset = "0x1C7C500", VA = "0x181C7DB00")]
public void AddDigests(IEnumerable digestOids)
{
int num;
do
{
num = 0;
num += num;
num++;
if (num != 0 && num == 0)
{
goto IL_33;
}
this.ConfigureDigest(num);
num += num;
num++;
num += 19;
if (num != 0)
{
}
if (num != -1)
{
}
}
while (num != 0);
return;
IL_33:
throw new NullReferenceException();
}
// Token: 0x0600A1FC RID: 41468 RVA: 0x0025AF1C File Offset: 0x0025911C
[Token(Token = "0x600A1FC")]
[Address(RVA = "0x1C7E290", Offset = "0x1C7CC90", VA = "0x181C7E290")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOid)
{
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
int num = 0;
this.AddSigner(privateKey, cert, digestOid, defaultSignedAttributeTableGenerator, num);
}
// Token: 0x0600A1FD RID: 41469 RVA: 0x0025AF3C File Offset: 0x0025913C
[Token(Token = "0x600A1FD")]
[Address(RVA = "0x1C7DD20", Offset = "0x1C7C720", VA = "0x181C7DD20")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid)
{
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
}
// Token: 0x0600A1FE RID: 41470 RVA: 0x0025AF58 File Offset: 0x00259158
[Token(Token = "0x600A1FE")]
[Address(RVA = "0x1C7DEE0", Offset = "0x1C7C8E0", VA = "0x181C7DEE0")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOid, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttr, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttr)
{
}
// Token: 0x0600A1FF RID: 41471 RVA: 0x0025AF68 File Offset: 0x00259168
[Token(Token = "0x600A1FF")]
[Address(RVA = "0x1C7E1C0", Offset = "0x1C7CBC0", VA = "0x181C7E1C0")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttr, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttr)
{
}
// Token: 0x0600A200 RID: 41472 RVA: 0x0025AF78 File Offset: 0x00259178
[Token(Token = "0x600A200")]
[Address(RVA = "0x1C7DE10", Offset = "0x1C7C810", VA = "0x181C7DE10")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
string encOid = CmsSignedDataStreamGenerator.Helper.GetEncOid(privateKey, digestOid);
}
// Token: 0x0600A201 RID: 41473 RVA: 0x0025AF98 File Offset: 0x00259198
[Token(Token = "0x600A201")]
[Address(RVA = "0x1C7E4F0", Offset = "0x1C7CEF0", VA = "0x181C7E4F0")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
}
// Token: 0x0600A202 RID: 41474 RVA: 0x0025AFAC File Offset: 0x002591AC
[Token(Token = "0x600A202")]
[Address(RVA = "0x1C7E120", Offset = "0x1C7CB20", VA = "0x181C7E120")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOid)
{
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
int num = 0;
this.AddSigner(privateKey, subjectKeyID, digestOid, defaultSignedAttributeTableGenerator, num);
}
// Token: 0x0600A203 RID: 41475 RVA: 0x0025AFCC File Offset: 0x002591CC
[Token(Token = "0x600A203")]
[Address(RVA = "0x1C7E330", Offset = "0x1C7CD30", VA = "0x181C7E330")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOid, string digestOid)
{
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
}
// Token: 0x0600A204 RID: 41476 RVA: 0x0025AFE8 File Offset: 0x002591E8
[Token(Token = "0x600A204")]
[Address(RVA = "0x1C7E050", Offset = "0x1C7CA50", VA = "0x181C7E050")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOid, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttr, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttr)
{
}
// Token: 0x0600A205 RID: 41477 RVA: 0x0025AFF8 File Offset: 0x002591F8
[Token(Token = "0x600A205")]
[Address(RVA = "0x1C7E420", Offset = "0x1C7CE20", VA = "0x181C7E420")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
string encOid = CmsSignedDataStreamGenerator.Helper.GetEncOid(privateKey, digestOid);
}
// Token: 0x0600A206 RID: 41478 RVA: 0x0025B018 File Offset: 0x00259218
[Token(Token = "0x600A206")]
[Address(RVA = "0x1C7DFB0", Offset = "0x1C7C9B0", VA = "0x181C7DFB0")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
}
// Token: 0x0600A207 RID: 41479 RVA: 0x0025B02C File Offset: 0x0025922C
[Token(Token = "0x600A207")]
[Address(RVA = "0x1C7EFA0", Offset = "0x1C7D9A0", VA = "0x181C7EFA0")]
private void DoAddSigner(AsymmetricKeyParameter privateKey, SignerIdentifier signerIdentifier, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
IList signerInfs = this._signerInfs;
CmsSignedDataStreamGenerator.DigestAndSignerInfoGeneratorHolder digestAndSignerInfoGeneratorHolder;
CmsSignedDataStreamGenerator.SignerInfoGeneratorImpl signerInfoGeneratorImpl;
digestAndSignerInfoGeneratorHolder.signerInf = signerInfoGeneratorImpl;
digestAndSignerInfoGeneratorHolder.digestOID = 0;
throw new NullReferenceException();
}
// Token: 0x0600A208 RID: 41480 RVA: 0x0025B054 File Offset: 0x00259254
[Token(Token = "0x600A208")]
[Address(RVA = "0x1C7DCD0", Offset = "0x1C7C6D0", VA = "0x181C7DCD0", Slot = "6")]
internal override void AddSignerCallback(SignerInformation si)
{
Asn1Object asn1Object = si.digestAlgorithm.ToAsn1Object();
}
// Token: 0x0600A209 RID: 41481 RVA: 0x0025B074 File Offset: 0x00259274
[Token(Token = "0x600A209")]
[Address(RVA = "0x1C7F420", Offset = "0x1C7DE20", VA = "0x181C7F420")]
public Stream Open(Stream outStream)
{
int num = 0;
int num2 = 0;
string data = CmsSignedGenerator.Data;
return this.Open(outStream, data, num2 != 0, num);
}
// Token: 0x0600A20A RID: 41482 RVA: 0x0025B098 File Offset: 0x00259298
[Token(Token = "0x600A20A")]
[Address(RVA = "0x1C7F380", Offset = "0x1C7DD80", VA = "0x181C7F380")]
public Stream Open(Stream outStream, bool encapsulate)
{
int num = 0;
string data = CmsSignedGenerator.Data;
return this.Open(outStream, data, encapsulate, num);
}
// Token: 0x0600A20B RID: 41483 RVA: 0x0025B0B8 File Offset: 0x002592B8
[Token(Token = "0x600A20B")]
[Address(RVA = "0x1C7F2E0", Offset = "0x1C7DCE0", VA = "0x181C7F2E0")]
public Stream Open(Stream outStream, bool encapsulate, Stream dataOutputStream)
{
string data = CmsSignedGenerator.Data;
return this.Open(outStream, data, encapsulate, dataOutputStream);
}
// Token: 0x0600A20C RID: 41484 RVA: 0x0025B0D8 File Offset: 0x002592D8
[Token(Token = "0x600A20C")]
[Address(RVA = "0x1C7FBA0", Offset = "0x1C7E5A0", VA = "0x181C7FBA0")]
public Stream Open(Stream outStream, string signedContentType, bool encapsulate)
{
int num = 0;
return this.Open(outStream, signedContentType, encapsulate, num);
}
// Token: 0x0600A20D RID: 41485 RVA: 0x0025B0F4 File Offset: 0x002592F4
[Token(Token = "0x600A20D")]
[Address(RVA = "0x1C7F4B0", Offset = "0x1C7DEB0", VA = "0x181C7F4B0")]
public Stream Open(Stream outStream, string signedContentType, bool encapsulate, Stream dataOutputStream)
{
int num;
Asn1EncodableVector asn1EncodableVector;
for (;;)
{
num = 0;
if (outStream == 0)
{
goto IL_127;
}
if (outStream.CanSeek)
{
if (outStream != 0 && !outStream.CanSeek)
{
goto IL_133;
}
this._messageDigestsLocked = true;
string text = new BerSequenceGenerator(outStream).ToString();
if (signedContentType == 0)
{
}
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(signedContentType);
DerInteger derInteger = this.CalculateVersion(derObjectIdentifier);
BerSequenceGenerator berSequenceGenerator;
string text2 = berSequenceGenerator.ToString();
ISet messageDigestOids = this._messageDigestOids;
if (asn1EncodableVector != 0)
{
break;
}
ArrayTypeMismatchException ex;
if (ex != 0)
{
}
if (num != -1)
{
}
if (num == 0)
{
goto Block_5;
}
}
}
Asn1Encodable[] array;
DerNull instance;
if (asn1EncodableVector == 0 || asn1EncodableVector != 0)
{
array = new Asn1Encodable[1];
DerObjectIdentifier derObjectIdentifier2 = new DerObjectIdentifier(num);
instance = DerNull.Instance;
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(derObjectIdentifier2, instance);
throw new ArrayTypeMismatchException();
}
throw new NullReferenceException();
Block_5:
byte[] encoded = new DerSet(asn1EncodableVector).GetEncoded();
Asn1Object asn1Object = array.ToAsn1Object();
Asn1Object asn1Object2 = array.ToAsn1Object();
BerSequenceGenerator berSequenceGenerator2;
string text3 = berSequenceGenerator2.ToString();
int num2 = 0;
CmsSignedDataStreamGenerator.CmsSignedDataOutputStream cmsSignedDataOutputStream;
cmsSignedDataOutputStream.outer = instance;
Stream stream;
cmsSignedDataOutputStream._out = stream;
DerObjectIdentifier derObjectIdentifier3 = new DerObjectIdentifier(num2);
cmsSignedDataOutputStream._contentOID = derObjectIdentifier3;
cmsSignedDataOutputStream._sGen = derObjectIdentifier3;
cmsSignedDataOutputStream._sigGen = derObjectIdentifier3;
cmsSignedDataOutputStream._eiGen = berSequenceGenerator2;
IL_127:
ArgumentNullException ex2 = new ArgumentNullException("outStream");
IL_133:
ArgumentException ex3 = new ArgumentException("Expected writeable stream", "dataOutputStream");
throw new IndexOutOfRangeException();
}
// Token: 0x0600A20E RID: 41486 RVA: 0x0025B25C File Offset: 0x0025945C
[Token(Token = "0x600A20E")]
[Address(RVA = "0x1C7FBC0", Offset = "0x1C7E5C0", VA = "0x181C7FBC0")]
private void RegisterDigestOid(string digestOid)
{
ISet messageDigestOids = this._messageDigestOids;
if (!this._messageDigestsLocked)
{
return;
}
throw new NullReferenceException();
}
// Token: 0x0600A20F RID: 41487 RVA: 0x0025B28C File Offset: 0x0025948C
[Token(Token = "0x600A20F")]
[Address(RVA = "0x1C7EE00", Offset = "0x1C7D800", VA = "0x181C7EE00")]
private void ConfigureDigest(string digestOid)
{
/*
An exception occurred when decompiling this method (0600A20F)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedDataStreamGenerator::ConfigureDigest(System.String)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_45:
stloc:InvalidOperationException(var_4_4F, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Cannot configure new digests after the data stream is opened")))
}
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: 0x0600A210 RID: 41488 RVA: 0x0025B2EC File Offset: 0x002594EC
[Token(Token = "0x600A210")]
[Address(RVA = "0x1C7F0B0", Offset = "0x1C7DAB0", VA = "0x181C7F0B0")]
internal void Generate(Stream outStream, string eContentType, bool encapsulate, Stream dataOutputStream, CmsProcessable content)
{
Stream stream;
Platform.Dispose(stream);
}
// Token: 0x0600A211 RID: 41489 RVA: 0x0025B300 File Offset: 0x00259500
[Token(Token = "0x600A211")]
[Address(RVA = "0x1C7E770", Offset = "0x1C7D170", VA = "0x181C7E770")]
private DerInteger CalculateVersion(DerObjectIdentifier contentOid)
{
for (;;)
{
int num = 0;
if (this._certs == 0)
{
goto IL_19;
}
if (num != -1)
{
if ((ulong)1L == 0UL)
{
goto IL_19;
}
goto IL_67;
}
IL_22:
if (num != 0)
{
continue;
}
if ((uint)(-1) != 0U)
{
}
if ((ulong)((uint)(-1)) != (ulong)(-1L))
{
}
if (num == 0)
{
break;
}
continue;
IL_19:
if (this._crls != 0)
{
goto IL_22;
}
break;
}
DerObjectIdentifier data = CmsObjectIdentifiers.Data;
IList signers = this._signers;
if (!this.CheckForVersion3(signers))
{
DerInteger derInteger = new DerInteger(5);
}
DerInteger derInteger2 = new DerInteger(5);
DerInteger derInteger3 = new DerInteger(5);
IL_67:
return new DerInteger(5);
}
// Token: 0x0600A212 RID: 41490 RVA: 0x0025B388 File Offset: 0x00259588
[Token(Token = "0x600A212")]
[Address(RVA = "0x1C7EBA0", Offset = "0x1C7D5A0", VA = "0x181C7EBA0")]
private bool CheckForVersion3(IList signerInfos)
{
for (;;)
{
int num = 0;
SignerInfo signerInfo;
int intValue = signerInfo.version.Value.IntValue;
while (intValue != 3)
{
}
if (intValue != 0)
{
}
if (num != -1)
{
if (typeof(IDisposable).TypeHandle == (ulong)81L)
{
break;
}
if (typeof(IDisposable).TypeHandle == (ulong)79L)
{
goto IL_42;
}
}
if (num == 0)
{
goto IL_42;
}
}
return true;
IL_42:
throw new NullReferenceException();
}
// Token: 0x0600A213 RID: 41491 RVA: 0x0025B400 File Offset: 0x00259600
[Token(Token = "0x600A213")]
[Address(RVA = "0x1C7E590", Offset = "0x1C7CF90", VA = "0x181C7E590")]
private static Stream AttachDigestsToOutputStream(ICollection digests, Stream s)
{
int num;
Stream safeTeeOutputStream;
do
{
num = 0;
DigestSink digestSink;
safeTeeOutputStream = CmsSignedDataStreamGenerator.GetSafeTeeOutputStream(s, digestSink);
if (safeTeeOutputStream != 0)
{
}
if (num != -1)
{
}
}
while (num != 0);
return safeTeeOutputStream;
}
// Token: 0x0600A214 RID: 41492 RVA: 0x0025B430 File Offset: 0x00259630
[Token(Token = "0x600A214")]
[Address(RVA = "0x1C7F170", Offset = "0x1C7DB70", VA = "0x181C7F170")]
private static Stream GetSafeOutputStream(Stream s)
{
if (s == 0)
{
NullOutputStream nullOutputStream = new NullOutputStream();
}
return s;
}
// Token: 0x0600A215 RID: 41493 RVA: 0x0025B448 File Offset: 0x00259648
[Token(Token = "0x600A215")]
[Address(RVA = "0x1C7F1C0", Offset = "0x1C7DBC0", VA = "0x181C7F1C0")]
private static Stream GetSafeTeeOutputStream(Stream s1, Stream s2)
{
/*
An exception occurred when decompiling this method (0600A215)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.IO.Stream BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedDataStreamGenerator::GetSafeTeeOutputStream(System.IO.Stream,System.IO.Stream)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_2:
stloc:NullOutputStream(var_1_1B, newobj:NullOutputStream(NullOutputStream::.ctor))
}
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.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: 0x04006A90 RID: 27280
[Token(Token = "0x4006A90")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x04006A91 RID: 27281
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006A91")]
private readonly IList _signerInfs;
// Token: 0x04006A92 RID: 27282
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006A92")]
private readonly ISet _messageDigestOids;
// Token: 0x04006A93 RID: 27283
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
[Token(Token = "0x4006A93")]
private readonly IDictionary _messageDigests;
// Token: 0x04006A94 RID: 27284
[global::Cpp2IlInjected.FieldOffset(Offset = "0x58")]
[Token(Token = "0x4006A94")]
private readonly IDictionary _messageHashes;
// Token: 0x04006A95 RID: 27285
[global::Cpp2IlInjected.FieldOffset(Offset = "0x60")]
[Token(Token = "0x4006A95")]
private bool _messageDigestsLocked;
// Token: 0x04006A96 RID: 27286
[global::Cpp2IlInjected.FieldOffset(Offset = "0x64")]
[Token(Token = "0x4006A96")]
private int _bufferSize;
// Token: 0x0200176C RID: 5996
[Token(Token = "0x200176C")]
private class DigestAndSignerInfoGeneratorHolder
{
// Token: 0x0600A217 RID: 41495 RVA: 0x0025B488 File Offset: 0x00259688
[Token(Token = "0x600A217")]
[Address(RVA = "0x3C39C0", Offset = "0x3C23C0", VA = "0x1803C39C0")]
internal DigestAndSignerInfoGeneratorHolder(ISignerInfoGenerator signerInf, string digestOID)
{
this.signerInf = signerInf;
this.digestOID = digestOID;
}
// Token: 0x1700196B RID: 6507
// (get) Token: 0x0600A218 RID: 41496 RVA: 0x0025B4AC File Offset: 0x002596AC
[Token(Token = "0x1700196B")]
internal AlgorithmIdentifier DigestAlgorithm
{
[Token(Token = "0x600A218")]
[Address(RVA = "0x1C863E0", Offset = "0x1C84DE0", VA = "0x181C863E0")]
get
{
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(this.digestOID);
DerNull instance = DerNull.Instance;
return new AlgorithmIdentifier(derObjectIdentifier, instance);
}
}
// Token: 0x04006A97 RID: 27287
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A97")]
internal readonly ISignerInfoGenerator signerInf;
// Token: 0x04006A98 RID: 27288
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A98")]
internal readonly string digestOID;
}
// Token: 0x0200176D RID: 5997
[Token(Token = "0x200176D")]
private class SignerInfoGeneratorImpl : ISignerInfoGenerator
{
// Token: 0x0600A219 RID: 41497 RVA: 0x0025B4D4 File Offset: 0x002596D4
[Token(Token = "0x600A219")]
[Address(RVA = "0x1C87650", Offset = "0x1C86050", VA = "0x181C87650")]
internal SignerInfoGeneratorImpl(CmsSignedDataStreamGenerator outer, AsymmetricKeyParameter key, SignerIdentifier signerIdentifier, string digestOID, string encOID, CmsAttributeTableGenerator sAttr, CmsAttributeTableGenerator unsAttr)
{
/*
An exception occurred when decompiling this method (0600A219)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedDataStreamGenerator/SignerInfoGeneratorImpl::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedDataStreamGenerator,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter,BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.SignerIdentifier,System.String,System.String,BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsAttributeTableGenerator,BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsAttributeTableGenerator)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_E3:
stloc:SignatureException(var_12_EA, newobj:SignatureException(SignatureException::.ctor, ldloc:string(var_11)))
}
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.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: 0x0600A21A RID: 41498 RVA: 0x0025B5CC File Offset: 0x002597CC
[Token(Token = "0x600A21A")]
[Address(RVA = "0x1C87050", Offset = "0x1C85A50", VA = "0x181C87050", Slot = "4")]
public SignerInfo Generate(DerObjectIdentifier contentType, AlgorithmIdentifier digestAlgorithm, byte[] calculatedDigest)
{
CmsSignedHelper helper = CmsSignedDataStreamGenerator.Helper;
string digestOID = this._digestOID;
string digestAlgName = helper.GetDigestAlgName(digestOID);
string encName = this._encName;
string text = digestAlgName + "with" + encName;
int num = 0;
if (this._sAttr == num)
{
if (!this._encName.Equals("RSA"))
{
goto IL_9B;
}
byte[] encoded = new DigestInfo(digestAlgorithm, calculatedDigest).GetEncoded("DER");
}
string text2 = this.outer.ToString();
CmsAttributeTableGenerator sAttr = this._sAttr;
if (contentType == 0 && text2 != 0)
{
DerObjectIdentifier contentType2 = CmsAttributes.ContentType;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute attribute;
if (attribute != 0)
{
IDictionary dictionary;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(dictionary);
}
}
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator = this.outer;
int num2 = 0;
IL_9B:
ISigner sig = this._sig;
if (num < num2)
{
num += num;
num++;
}
ISigner sig2 = this._sig;
if (this._unsAttr != num)
{
string text3 = this.outer.ToString();
CmsAttributeTableGenerator unsAttr = this._unsAttr;
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator2 = this.outer;
}
CmsSignedHelper helper2 = CmsSignedDataStreamGenerator.Helper;
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(this._encOID);
Asn1Encodable asn1Encodable;
AlgorithmIdentifier encAlgorithmIdentifier = helper2.GetEncAlgorithmIdentifier(derObjectIdentifier, asn1Encodable);
SignerIdentifier signerIdentifier = this._signerIdentifier;
SignerInfo signerInfo;
return signerInfo;
}
// Token: 0x04006A99 RID: 27289
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A99")]
private readonly CmsSignedDataStreamGenerator outer;
// Token: 0x04006A9A RID: 27290
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A9A")]
private readonly SignerIdentifier _signerIdentifier;
// Token: 0x04006A9B RID: 27291
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006A9B")]
private readonly string _digestOID;
// Token: 0x04006A9C RID: 27292
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006A9C")]
private readonly string _encOID;
// Token: 0x04006A9D RID: 27293
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006A9D")]
private readonly CmsAttributeTableGenerator _sAttr;
// Token: 0x04006A9E RID: 27294
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006A9E")]
private readonly CmsAttributeTableGenerator _unsAttr;
// Token: 0x04006A9F RID: 27295
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006A9F")]
private readonly string _encName;
// Token: 0x04006AA0 RID: 27296
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006AA0")]
private readonly ISigner _sig;
}
// Token: 0x0200176E RID: 5998
[Token(Token = "0x200176E")]
private class CmsSignedDataOutputStream : BaseOutputStream
{
// Token: 0x0600A21B RID: 41499 RVA: 0x0025B778 File Offset: 0x00259978
[Token(Token = "0x600A21B")]
[Address(RVA = "0x1C7C3A0", Offset = "0x1C7ADA0", VA = "0x181C7C3A0")]
public CmsSignedDataOutputStream(CmsSignedDataStreamGenerator outer, Stream outStream, string contentOID, BerSequenceGenerator sGen, BerSequenceGenerator sigGen, BerSequenceGenerator eiGen)
{
this.outer = outer;
this._out = outStream;
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(contentOID);
this._sGen = 0;
this._sigGen = 0;
this._contentOID = derObjectIdentifier;
this._eiGen = 0;
}
// Token: 0x0600A21C RID: 41500 RVA: 0x0025B7BC File Offset: 0x002599BC
[Token(Token = "0x600A21C")]
[Address(RVA = "0x1C75AC0", Offset = "0x1C744C0", VA = "0x181C75AC0", Slot = "30")]
public override void WriteByte(byte b)
{
bool canRead = this._out.CanRead;
}
// Token: 0x0600A21D RID: 41501 RVA: 0x0025B7DC File Offset: 0x002599DC
[Token(Token = "0x600A21D")]
[Address(RVA = "0x1C75AF0", Offset = "0x1C744F0", VA = "0x181C75AF0", Slot = "29")]
public override void Write(byte[] bytes, int off, int len)
{
bool canRead = this._out.CanRead;
}
// Token: 0x0600A21E RID: 41502 RVA: 0x0025B7FC File Offset: 0x002599FC
[Token(Token = "0x600A21E")]
[Address(RVA = "0x1C7B840", Offset = "0x1C7A240", VA = "0x181C7B840", Slot = "15")]
public override void Close()
{
this.DoClose();
base.Close();
}
// Token: 0x0600A21F RID: 41503 RVA: 0x0025B818 File Offset: 0x00259A18
[Token(Token = "0x600A21F")]
[Address(RVA = "0x1C7B860", Offset = "0x1C7A260", VA = "0x181C7B860")]
private void DoClose()
{
int num4;
Asn1EncodableVector asn1EncodableVector;
Asn1Encodable[] array2;
Asn1Encodable[] array3;
for (;;)
{
Platform.Dispose(this._out);
Stream rawOutputStream = this._eiGen.GetRawOutputStream();
IDictionary digests = this.outer._digests;
IList certs = this.outer._certs;
if (rawOutputStream > 0)
{
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator = this.outer;
Asn1Set asn1Set = CmsUtilities.CreateDerSetFromList(cmsSignedDataStreamGenerator._certs);
Asn1Set asn1Set2 = CmsUtilities.CreateBerSetFromList(cmsSignedDataStreamGenerator._certs);
int num;
int num2;
BerTaggedObject berTaggedObject = new BerTaggedObject(num != 0, num2, asn1Set2);
num2 = 0;
num = 0;
}
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator2 = this.outer;
IList crls = cmsSignedDataStreamGenerator2._crls;
BerTaggedObject berTaggedObject2;
if (cmsSignedDataStreamGenerator2 > 0)
{
IList crls2 = this.outer._crls;
Asn1Set asn1Set3 = CmsUtilities.CreateDerSetFromList(crls2);
Asn1Set asn1Set4 = CmsUtilities.CreateBerSetFromList(crls2);
int num3;
berTaggedObject2 = new BerTaggedObject(num3 != 0, 1, asn1Set4);
num3 = 0;
}
if (berTaggedObject2 != 0)
{
}
num4 = 0;
byte[] array;
if (array != 0)
{
}
if (num4 != -1)
{
if (asn1EncodableVector != 0)
{
break;
}
}
else
{
if (asn1EncodableVector != 0)
{
continue;
}
array2[0] = array2;
}
num4++;
if (num4 != 0)
{
}
if (num4 != -1 && "{il2cpp array field local55->}" == (ulong)511L)
{
if (num4 == 0)
{
goto IL_169;
}
if (num4 != 0)
{
goto IL_147;
}
}
if (asn1EncodableVector != 0)
{
continue;
}
IL_147:
if (num4 == 0)
{
continue;
}
array3 = new Asn1Encodable[1];
if (num4 != 0)
{
}
array3[0] = num4;
IL_169:
num4++;
if (num4 != 0)
{
}
if ((num4 != -1 && "{il2cpp array field local66->}" == (ulong)599L) || asn1EncodableVector == 0)
{
goto IL_18F;
}
}
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(num4);
DerNull instance = DerNull.Instance;
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(derObjectIdentifier, instance);
CmsSignedHelper helper = CmsSignedDataStreamGenerator.Helper;
array2 = new Asn1Encodable[1];
IList v = asn1EncodableVector.v;
throw new ArrayTypeMismatchException();
IL_18F:
Asn1Object asn1Object = array3.ToAsn1Object();
Asn1Object asn1Object2 = array3.ToAsn1Object();
}
// Token: 0x0600A220 RID: 41504 RVA: 0x0025B9CC File Offset: 0x00259BCC
[Token(Token = "0x600A220")]
[Address(RVA = "0x1C7C320", Offset = "0x1C7AD20", VA = "0x181C7C320")]
private static void WriteToGenerator(Asn1Generator ag, Asn1Encodable ae)
{
byte[] encoded = ae.GetEncoded();
}
// Token: 0x04006AA1 RID: 27297
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006AA1")]
private readonly CmsSignedDataStreamGenerator outer;
// Token: 0x04006AA2 RID: 27298
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006AA2")]
private Stream _out;
// Token: 0x04006AA3 RID: 27299
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006AA3")]
private DerObjectIdentifier _contentOID;
// Token: 0x04006AA4 RID: 27300
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006AA4")]
private BerSequenceGenerator _sGen;
// Token: 0x04006AA5 RID: 27301
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
[Token(Token = "0x4006AA5")]
private BerSequenceGenerator _sigGen;
// Token: 0x04006AA6 RID: 27302
[global::Cpp2IlInjected.FieldOffset(Offset = "0x58")]
[Token(Token = "0x4006AA6")]
private BerSequenceGenerator _eiGen;
}
}
}
@@ -0,0 +1,387 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
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.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001770 RID: 6000
[Token(Token = "0x2001770")]
[StructLayout(3)]
public class CmsSignedGenerator
{
// Token: 0x0600A225 RID: 41509 RVA: 0x0025BD74 File Offset: 0x00259F74
[Token(Token = "0x600A225")]
[Address(RVA = "0x1C82470", Offset = "0x1C80E70", VA = "0x181C82470")]
protected CmsSignedGenerator()
{
SecureRandom secureRandom = new SecureRandom();
}
// Token: 0x0600A226 RID: 41510 RVA: 0x0025BD88 File Offset: 0x00259F88
[Token(Token = "0x600A226")]
[Address(RVA = "0x1C823E0", Offset = "0x1C80DE0", VA = "0x181C823E0")]
protected CmsSignedGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this._certs = list;
IList list2 = Platform.CreateArrayList();
this._crls = list2;
IList list3 = Platform.CreateArrayList();
this._signers = list3;
IDictionary dictionary = Platform.CreateHashtable();
int num = 0;
this._digests = dictionary;
this.AddSignerCallback(num);
this.rand = rand;
}
// Token: 0x0600A227 RID: 41511 RVA: 0x0025BDEC File Offset: 0x00259FEC
[Token(Token = "0x600A227")]
[Address(RVA = "0x1C81C80", Offset = "0x1C80680", VA = "0x181C81C80", Slot = "4")]
protected internal virtual IDictionary GetBaseParameters(DerObjectIdentifier contentType, AlgorithmIdentifier digAlgId, byte[] hash)
{
IDictionary dictionary = Platform.CreateHashtable();
if (contentType != 0)
{
}
return dictionary;
}
// Token: 0x0600A228 RID: 41512 RVA: 0x0025BE0C File Offset: 0x0025A00C
[Token(Token = "0x600A228")]
[Address(RVA = "0x1C81C10", Offset = "0x1C80610", VA = "0x181C81C10", Slot = "5")]
protected internal virtual Asn1Set GetAttributeSet(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attr)
{
/*
An exception occurred when decompiling this method (0600A228)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Asn1Set BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedGenerator::GetAttributeSet(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_06:
stloc:DerSet(var_1_11, newobj:DerSet(DerSet::.ctor, call:Asn1EncodableVector(AttributeTable::ToAsn1EncodableVector, ldloc:AttributeTable(attr))))
}
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: 0x0600A229 RID: 41513 RVA: 0x0025BE2C File Offset: 0x0025A02C
[Token(Token = "0x600A229")]
[Address(RVA = "0x1C81900", Offset = "0x1C80300", VA = "0x181C81900")]
public void AddCertificates(IX509Store certStore)
{
IList certs = this._certs;
IList certificatesFromStore = CmsUtilities.GetCertificatesFromStore(certStore);
CollectionUtilities.AddRange(certs, certificatesFromStore);
}
// Token: 0x0600A22A RID: 41514 RVA: 0x0025BE50 File Offset: 0x0025A050
[Token(Token = "0x600A22A")]
[Address(RVA = "0x1C81930", Offset = "0x1C80330", VA = "0x181C81930")]
public void AddCrls(IX509Store crlStore)
{
IList crls = this._crls;
IList crlsFromStore = CmsUtilities.GetCrlsFromStore(crlStore);
CollectionUtilities.AddRange(crls, crlsFromStore);
}
// Token: 0x0600A22B RID: 41515 RVA: 0x0025BE74 File Offset: 0x0025A074
[Token(Token = "0x600A22B")]
[Address(RVA = "0x1C81590", Offset = "0x1C7FF90", VA = "0x181C81590")]
public void AddAttributeCertificates(IX509Store store)
{
int num = 0;
num += num;
num++;
IList certs = this._certs;
uint num2;
if (num < (int)num2)
{
num += num;
num++;
}
Asn1Object asn1Object;
AttributeCertificate instance = AttributeCertificate.GetInstance(asn1Object);
int num3;
DerTaggedObject derTaggedObject = new DerTaggedObject(num3 != 0, 2, instance);
num3 = 0;
if (num < 2)
{
num += num;
num++;
}
derTaggedObject += derTaggedObject;
num += 15;
num += 19;
num += typeof(IList).TypeHandle;
derTaggedObject += derTaggedObject;
num += 2;
num += 19;
if (num != 0)
{
}
if (num != -1)
{
}
if (num == 0)
{
return;
}
throw new NullReferenceException();
}
// Token: 0x0600A22C RID: 41516 RVA: 0x0025BF24 File Offset: 0x0025A124
[Token(Token = "0x600A22C")]
[Address(RVA = "0x1C81960", Offset = "0x1C80360", VA = "0x181C81960")]
public void AddSigners(SignerInformationStore signerStore)
{
int num;
do
{
num = 0;
ICollection signers = signerStore.GetSigners();
Asn1Set attributeSet;
if (signers != 0)
{
if (num < signers)
{
num += num;
num++;
}
if (num == 0)
{
num++;
num += 19;
}
if (num == 0)
{
goto IL_60;
}
IList signers2 = this._signers;
if (num < num)
{
num += num;
num++;
}
attributeSet = this.GetAttributeSet(num);
num += num;
}
if (attributeSet != 0)
{
}
if (num != -1)
{
}
}
while (num != 0);
return;
IL_60:
throw new NullReferenceException();
}
// Token: 0x0600A22D RID: 41517 RVA: 0x0025BF98 File Offset: 0x0025A198
[Token(Token = "0x600A22D")]
[Address(RVA = "0x1C81DD0", Offset = "0x1C807D0", VA = "0x181C81DD0")]
public IDictionary GetGeneratedDigests()
{
return Platform.CreateHashtable(this._digests);
}
// Token: 0x1700196C RID: 6508
// (get) Token: 0x0600A22E RID: 41518 RVA: 0x0025BFB0 File Offset: 0x0025A1B0
// (set) Token: 0x0600A22F RID: 41519 RVA: 0x0025BFC4 File Offset: 0x0025A1C4
[Token(Token = "0x1700196C")]
public bool UseDerForCerts
{
[Token(Token = "0x600A22E")]
[Address(RVA = "0x4CB2D0", Offset = "0x4C9CD0", VA = "0x1804CB2D0")]
get
{
return this._useDerForCerts;
}
[Token(Token = "0x600A22F")]
[Address(RVA = "0x4CB340", Offset = "0x4C9D40", VA = "0x1804CB340")]
set
{
this._useDerForCerts = value;
}
}
// Token: 0x1700196D RID: 6509
// (get) Token: 0x0600A230 RID: 41520 RVA: 0x0025BFD8 File Offset: 0x0025A1D8
// (set) Token: 0x0600A231 RID: 41521 RVA: 0x0025BFEC File Offset: 0x0025A1EC
[Token(Token = "0x1700196D")]
public bool UseDerForCrls
{
[Token(Token = "0x600A230")]
[Address(RVA = "0x727170", Offset = "0x725B70", VA = "0x180727170")]
get
{
return this._useDerForCrls;
}
[Token(Token = "0x600A231")]
[Address(RVA = "0x7273B0", Offset = "0x725DB0", VA = "0x1807273B0")]
set
{
this._useDerForCrls = value;
}
}
// Token: 0x0600A232 RID: 41522 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600A232")]
[Address(RVA = "0x3C9F60", Offset = "0x3C8960", VA = "0x1803C9F60", Slot = "6")]
internal virtual void AddSignerCallback(SignerInformation si)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600A233 RID: 41523 RVA: 0x0025C000 File Offset: 0x0025A200
[Token(Token = "0x600A233")]
[Address(RVA = "0x1C81E30", Offset = "0x1C80830", VA = "0x181C81E30")]
internal static SignerIdentifier GetSignerIdentifier(X509Certificate cert)
{
DateTime notAfter = cert.NotAfter;
Asn1Object asn1Object;
TbsCertificateStructure instance = TbsCertificateStructure.GetInstance(asn1Object);
DerInteger serialNumber = instance.serialNumber;
X509Name issuer = instance.issuer;
BigInteger value = serialNumber.Value;
return new SignerIdentifier(new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.IssuerAndSerialNumber(issuer, value));
}
// Token: 0x0600A234 RID: 41524 RVA: 0x0025C048 File Offset: 0x0025A248
[Token(Token = "0x600A234")]
[Address(RVA = "0x1C81F20", Offset = "0x1C80920", VA = "0x181C81F20")]
internal static SignerIdentifier GetSignerIdentifier(byte[] subjectKeyIdentifier)
{
return new SignerIdentifier(new DerOctetString(subjectKeyIdentifier));
}
// Token: 0x04006AA9 RID: 27305
[Token(Token = "0x4006AA9")]
public static readonly string Data = CmsObjectIdentifiers.Data.identifier;
// Token: 0x04006AAA RID: 27306
[Token(Token = "0x4006AAA")]
public static readonly string DigestSha1 = OiwObjectIdentifiers.IdSha1.identifier;
// Token: 0x04006AAB RID: 27307
[Token(Token = "0x4006AAB")]
public static readonly string DigestSha224 = NistObjectIdentifiers.IdSha224.identifier;
// Token: 0x04006AAC RID: 27308
[Token(Token = "0x4006AAC")]
public static readonly string DigestSha256 = NistObjectIdentifiers.IdSha256.identifier;
// Token: 0x04006AAD RID: 27309
[Token(Token = "0x4006AAD")]
public static readonly string DigestSha384 = NistObjectIdentifiers.IdSha384.identifier;
// Token: 0x04006AAE RID: 27310
[Token(Token = "0x4006AAE")]
public static readonly string DigestSha512 = NistObjectIdentifiers.IdSha512.identifier;
// Token: 0x04006AAF RID: 27311
[Token(Token = "0x4006AAF")]
public static readonly string DigestMD5 = PkcsObjectIdentifiers.MD5.identifier;
// Token: 0x04006AB0 RID: 27312
[Token(Token = "0x4006AB0")]
public static readonly string DigestGost3411 = CryptoProObjectIdentifiers.GostR3411.identifier;
// Token: 0x04006AB1 RID: 27313
[Token(Token = "0x4006AB1")]
public static readonly string DigestRipeMD128 = TeleTrusTObjectIdentifiers.RipeMD128.identifier;
// Token: 0x04006AB2 RID: 27314
[Token(Token = "0x4006AB2")]
public static readonly string DigestRipeMD160 = TeleTrusTObjectIdentifiers.RipeMD160.identifier;
// Token: 0x04006AB3 RID: 27315
[Token(Token = "0x4006AB3")]
public static readonly string DigestRipeMD256 = TeleTrusTObjectIdentifiers.RipeMD256.identifier;
// Token: 0x04006AB4 RID: 27316
[Token(Token = "0x4006AB4")]
public static readonly string EncryptionRsa = PkcsObjectIdentifiers.RsaEncryption.identifier;
// Token: 0x04006AB5 RID: 27317
[Token(Token = "0x4006AB5")]
public static readonly string EncryptionDsa = X9ObjectIdentifiers.IdDsaWithSha1.identifier;
// Token: 0x04006AB6 RID: 27318
[Token(Token = "0x4006AB6")]
public static readonly string EncryptionECDsa = X9ObjectIdentifiers.ECDsaWithSha1.identifier;
// Token: 0x04006AB7 RID: 27319
[Token(Token = "0x4006AB7")]
public static readonly string EncryptionRsaPss = PkcsObjectIdentifiers.IdRsassaPss.identifier;
// Token: 0x04006AB8 RID: 27320
[Token(Token = "0x4006AB8")]
public static readonly string EncryptionGost3410 = CryptoProObjectIdentifiers.GostR3410x94.identifier;
// Token: 0x04006AB9 RID: 27321
[Token(Token = "0x4006AB9")]
public static readonly string EncryptionECGost3410 = CryptoProObjectIdentifiers.GostR3410x2001.identifier;
// Token: 0x04006ABA RID: 27322
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006ABA")]
internal IList _certs;
// Token: 0x04006ABB RID: 27323
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006ABB")]
internal IList _crls;
// Token: 0x04006ABC RID: 27324
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006ABC")]
internal IList _signers;
// Token: 0x04006ABD RID: 27325
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006ABD")]
internal IDictionary _digests;
// Token: 0x04006ABE RID: 27326
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006ABE")]
internal bool _useDerForCerts;
// Token: 0x04006ABF RID: 27327
[global::Cpp2IlInjected.FieldOffset(Offset = "0x31")]
[Token(Token = "0x4006ABF")]
internal bool _useDerForCrls;
// Token: 0x04006AC0 RID: 27328
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006AC0")]
protected readonly SecureRandom rand;
}
}
@@ -0,0 +1,365 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
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 BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001771 RID: 6001
[Token(Token = "0x2001771")]
[StructLayout(3)]
internal class CmsSignedHelper
{
// Token: 0x0600A236 RID: 41526 RVA: 0x0025C174 File Offset: 0x0025A374
[Token(Token = "0x600A236")]
[Address(RVA = "0x1C829A0", Offset = "0x1C813A0", VA = "0x181C829A0")]
private static void AddEntries(DerObjectIdentifier oid, string digest, string encryption)
{
IDictionary dictionary = CmsSignedHelper.digestAlgs;
IDictionary dictionary2 = CmsSignedHelper.encryptionAlgs;
}
// Token: 0x0600A237 RID: 41527 RVA: 0x0025C194 File Offset: 0x0025A394
[Token(Token = "0x600A237")]
[Address(RVA = "0x1C83CC0", Offset = "0x1C826C0", VA = "0x181C83CC0")]
static CmsSignedHelper()
{
/*
An exception occurred when decompiling this method (0600A237)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedHelper::.cctor()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_4D1:
stelem:string([mscorlib]System.String, ldloc:string[](var_77_4C7), ldc.i4:int32(0), ldstr:string("SHA-512"))
stloc:ISet(var_78_4E3, ldsfld:ISet(CmsSignedHelper::noParams))
stloc:ISet(var_79_4EA, ldsfld:ISet(CmsSignedHelper::noParams))
stloc:ISet(var_80_4F1, ldsfld:ISet(CmsSignedHelper::noParams))
stloc:ISet(var_81_4F8, ldsfld:ISet(CmsSignedHelper::noParams))
stloc:ISet(var_82_4FF, ldsfld:ISet(CmsSignedHelper::noParams))
stloc:ISet(var_83_506, ldsfld:ISet(CmsSignedHelper::noParams))
stloc:IDictionary(var_84_50D, ldsfld:IDictionary(CmsSignedHelper::ecAlgorithms))
}
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: 0x0600A238 RID: 41528 RVA: 0x0025C6B0 File Offset: 0x0025A8B0
[Token(Token = "0x600A238")]
[Address(RVA = "0x1C83100", Offset = "0x1C81B00", VA = "0x181C83100")]
internal string GetDigestAlgName(string digestAlgOid)
{
IDictionary dictionary = CmsSignedHelper.digestAlgs;
return digestAlgOid;
}
// Token: 0x0600A239 RID: 41529 RVA: 0x0025C6CC File Offset: 0x0025A8CC
[Token(Token = "0x600A239")]
[Address(RVA = "0x1C833C0", Offset = "0x1C81DC0", VA = "0x181C833C0")]
internal AlgorithmIdentifier GetEncAlgorithmIdentifier(DerObjectIdentifier encOid, Asn1Encodable sigX509Parameters)
{
ISet set = CmsSignedHelper.noParams;
return new AlgorithmIdentifier(encOid, sigX509Parameters);
}
// Token: 0x0600A23A RID: 41530 RVA: 0x0025C6F4 File Offset: 0x0025A8F4
[Token(Token = "0x600A23A")]
[Address(RVA = "0x1C831B0", Offset = "0x1C81BB0", VA = "0x181C831B0")]
internal string[] GetDigestAliases(string algName)
{
IDictionary dictionary = CmsSignedHelper.digestAliases;
throw new NullReferenceException();
}
// Token: 0x0600A23B RID: 41531 RVA: 0x0025C70C File Offset: 0x0025A90C
[Token(Token = "0x600A23B")]
[Address(RVA = "0x1C83BB0", Offset = "0x1C825B0", VA = "0x181C83BB0")]
internal string GetEncryptionAlgName(string encryptionAlgOid)
{
IDictionary dictionary = CmsSignedHelper.encryptionAlgs;
return encryptionAlgOid;
}
// Token: 0x0600A23C RID: 41532 RVA: 0x0025C728 File Offset: 0x0025A928
[Token(Token = "0x600A23C")]
[Address(RVA = "0x1C832B0", Offset = "0x1C81CB0", VA = "0x181C832B0")]
internal IDigest GetDigestInstance(string algorithm)
{
int num;
string[] array;
do
{
IDigest digest = DigestUtilities.GetDigest(algorithm);
num = 0;
}
while (num >= array.Length);
return DigestUtilities.GetDigest(array[num]);
}
// Token: 0x0600A23D RID: 41533 RVA: 0x0025C75C File Offset: 0x0025A95C
[Token(Token = "0x600A23D")]
[Address(RVA = "0x1C83C60", Offset = "0x1C82660", VA = "0x181C83C60")]
internal ISigner GetSignatureInstance(string algorithm)
{
return SignerUtilities.GetSigner(algorithm);
}
// Token: 0x0600A23E RID: 41534 RVA: 0x0025C770 File Offset: 0x0025A970
[Token(Token = "0x600A23E")]
[Address(RVA = "0x1C82A80", Offset = "0x1C81480", VA = "0x181C82A80")]
internal IX509Store CreateAttributeStore(string type, Asn1Set certSet)
{
IList list;
for (;;)
{
int num = 0;
list = Platform.CreateArrayList();
if (certSet == 0)
{
break;
}
IEnumerator enumerator = certSet.GetEnumerator();
if (enumerator != 0)
{
if (enumerator == 0)
{
}
if (enumerator == 0)
{
goto IL_91;
}
Asn1Sequence asn1Sequence;
if (new X509V2AttributeCertificate(asn1Sequence.GetEncoded()) != 0)
{
}
if (num != -1)
{
}
if (num == 0)
{
break;
}
}
}
string text = "AttributeCertificate/" + type;
X509CollectionStoreParameters x509CollectionStoreParameters = new X509CollectionStoreParameters(list);
return X509StoreFactory.Create(text, x509CollectionStoreParameters);
IL_91:
throw new NullReferenceException();
}
// Token: 0x0600A23F RID: 41535 RVA: 0x0025C814 File Offset: 0x0025AA14
[Token(Token = "0x600A23F")]
[Address(RVA = "0x1C82DE0", Offset = "0x1C817E0", VA = "0x181C82DE0")]
internal IX509Store CreateCertificateStore(string type, Asn1Set certSet)
{
IList list = Platform.CreateArrayList();
if (certSet != 0)
{
this.AddCertsFromSet(list, certSet);
}
string text = "Certificate/" + type;
X509CollectionStoreParameters x509CollectionStoreParameters = new X509CollectionStoreParameters(list);
return X509StoreFactory.Create(text, x509CollectionStoreParameters);
}
// Token: 0x0600A240 RID: 41536 RVA: 0x0025C860 File Offset: 0x0025AA60
[Token(Token = "0x600A240")]
[Address(RVA = "0x1C82F00", Offset = "0x1C81900", VA = "0x181C82F00")]
internal IX509Store CreateCrlStore(string type, Asn1Set crlSet)
{
IList list = Platform.CreateArrayList();
if (crlSet != 0)
{
this.AddCrlsFromSet(list, crlSet);
}
string text = "CRL/" + type;
X509CollectionStoreParameters x509CollectionStoreParameters = new X509CollectionStoreParameters(list);
return X509StoreFactory.Create(text, x509CollectionStoreParameters);
}
// Token: 0x0600A241 RID: 41537 RVA: 0x0025C8AC File Offset: 0x0025AAAC
[Token(Token = "0x600A241")]
[Address(RVA = "0x1C824D0", Offset = "0x1C80ED0", VA = "0x181C824D0")]
private void AddCertsFromSet(IList certs, Asn1Set certSet)
{
for (;;)
{
int num = 0;
X509CertificateParser x509CertificateParser = new X509CertificateParser();
IEnumerator enumerator = certSet.GetEnumerator();
if (enumerator != 0)
{
if (enumerator == 0)
{
}
if (enumerator == 0)
{
goto IL_49;
}
byte[] array;
if (x509CertificateParser.ReadCertificate(array) != 0)
{
}
if (num != -1)
{
}
if (num == 0)
{
break;
}
}
}
return;
IL_49:
throw new NullReferenceException();
}
// Token: 0x0600A242 RID: 41538 RVA: 0x0025C908 File Offset: 0x0025AB08
[Token(Token = "0x600A242")]
[Address(RVA = "0x1C82750", Offset = "0x1C81150", VA = "0x181C82750")]
private void AddCrlsFromSet(IList crls, Asn1Set crlSet)
{
for (;;)
{
int num = 0;
X509CrlParser x509CrlParser = new X509CrlParser();
IEnumerator enumerator = crlSet.GetEnumerator();
if (enumerator != 0)
{
if (enumerator == 0)
{
}
if (enumerator == 0)
{
goto IL_43;
}
byte[] array;
if (x509CrlParser.ReadCrl(array) != 0)
{
}
if (num != -1)
{
}
if (num == 0)
{
break;
}
}
}
return;
IL_43:
throw new NullReferenceException();
}
// Token: 0x0600A243 RID: 41539 RVA: 0x0025C960 File Offset: 0x0025AB60
[Token(Token = "0x600A243")]
[Address(RVA = "0x1C83020", Offset = "0x1C81A20", VA = "0x181C83020")]
internal AlgorithmIdentifier FixAlgID(AlgorithmIdentifier algId)
{
if (algId.ObjectID != 0)
{
return algId;
}
Asn1Object asn1Object = algId.ToAsn1Object();
AlgorithmIdentifier algorithmIdentifier;
return algorithmIdentifier;
}
// Token: 0x0600A244 RID: 41540 RVA: 0x0025C988 File Offset: 0x0025AB88
[Token(Token = "0x600A244")]
[Address(RVA = "0x1C834B0", Offset = "0x1C81EB0", VA = "0x181C834B0")]
internal string GetEncOid(AsymmetricKeyParameter key, string digestOID)
{
/*
An exception occurred when decompiling this method (0600A244)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.String BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedHelper::GetEncOid(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter,System.String)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_E8:
stloc:ArgumentException(var_21_F2, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Unknown algorithm in CmsSignedGenerator.GetEncOid")))
}
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: 0x0600A245 RID: 41541 RVA: 0x0025CA88 File Offset: 0x0025AC88
[Token(Token = "0x600A245")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public CmsSignedHelper()
{
}
// Token: 0x04006AC1 RID: 27329
[Token(Token = "0x4006AC1")]
internal static readonly CmsSignedHelper Instance;
// Token: 0x04006AC2 RID: 27330
[Token(Token = "0x4006AC2")]
private static readonly string EncryptionECDsaWithSha1;
// Token: 0x04006AC3 RID: 27331
[Token(Token = "0x4006AC3")]
private static readonly string EncryptionECDsaWithSha224;
// Token: 0x04006AC4 RID: 27332
[Token(Token = "0x4006AC4")]
private static readonly string EncryptionECDsaWithSha256;
// Token: 0x04006AC5 RID: 27333
[Token(Token = "0x4006AC5")]
private static readonly string EncryptionECDsaWithSha384;
// Token: 0x04006AC6 RID: 27334
[Token(Token = "0x4006AC6")]
private static readonly string EncryptionECDsaWithSha512;
// Token: 0x04006AC7 RID: 27335
[Token(Token = "0x4006AC7")]
private static readonly IDictionary encryptionAlgs;
// Token: 0x04006AC8 RID: 27336
[Token(Token = "0x4006AC8")]
private static readonly IDictionary digestAlgs;
// Token: 0x04006AC9 RID: 27337
[Token(Token = "0x4006AC9")]
private static readonly IDictionary digestAliases;
// Token: 0x04006ACA RID: 27338
[Token(Token = "0x4006ACA")]
private static readonly ISet noParams;
// Token: 0x04006ACB RID: 27339
[Token(Token = "0x4006ACB")]
private static readonly IDictionary ecAlgorithms;
}
}
@@ -0,0 +1,37 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001772 RID: 6002
[Token(Token = "0x2001772")]
[Serializable]
[StructLayout(3)]
public class CmsStreamException : IOException
{
// Token: 0x0600A246 RID: 41542 RVA: 0x0025CA9C File Offset: 0x0025AC9C
[Token(Token = "0x600A246")]
[Address(RVA = "0x1C85220", Offset = "0x1C83C20", VA = "0x181C85220")]
public CmsStreamException()
{
}
// Token: 0x0600A247 RID: 41543 RVA: 0x0025CAB0 File Offset: 0x0025ACB0
[Token(Token = "0x600A247")]
[Address(RVA = "0x47A3A0", Offset = "0x478DA0", VA = "0x18047A3A0")]
public CmsStreamException(string name)
: base(name)
{
}
// Token: 0x0600A248 RID: 41544 RVA: 0x0025CAC4 File Offset: 0x0025ACC4
[Token(Token = "0x600A248")]
[Address(RVA = "0x47A3B0", Offset = "0x478DB0", VA = "0x18047A3B0")]
public CmsStreamException(string name, Exception e)
: base(name, e)
{
}
}
}
@@ -0,0 +1,111 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001773 RID: 6003
[Token(Token = "0x2001773")]
[StructLayout(3)]
public class CmsTypedStream
{
// Token: 0x0600A249 RID: 41545 RVA: 0x0025CADC File Offset: 0x0025ACDC
[Token(Token = "0x600A249")]
[Address(RVA = "0x1C85350", Offset = "0x1C83D50", VA = "0x181C85350")]
public CmsTypedStream(Stream inStream)
{
string identifier = PkcsObjectIdentifiers.Data.identifier;
}
// Token: 0x0600A24A RID: 41546 RVA: 0x0025CAFC File Offset: 0x0025ACFC
[Token(Token = "0x600A24A")]
[Address(RVA = "0x1C85290", Offset = "0x1C83C90", VA = "0x181C85290")]
public CmsTypedStream(string oid, Stream inStream)
{
}
// Token: 0x0600A24B RID: 41547 RVA: 0x0025CB0C File Offset: 0x0025AD0C
[Token(Token = "0x600A24B")]
[Address(RVA = "0x1C852B0", Offset = "0x1C83CB0", VA = "0x181C852B0")]
public CmsTypedStream(string oid, Stream inStream, int bufSize)
{
this._oid = oid;
CmsTypedStream.FullReaderStream fullReaderStream = new CmsTypedStream.FullReaderStream(new BufferedStream(inStream, bufSize));
this._in = fullReaderStream;
}
// Token: 0x1700196E RID: 6510
// (get) Token: 0x0600A24C RID: 41548 RVA: 0x0025CB3C File Offset: 0x0025AD3C
[Token(Token = "0x1700196E")]
public string ContentType
{
[Token(Token = "0x600A24C")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0")]
get
{
return this._oid;
}
}
// Token: 0x1700196F RID: 6511
// (get) Token: 0x0600A24D RID: 41549 RVA: 0x0025CB50 File Offset: 0x0025AD50
[Token(Token = "0x1700196F")]
public Stream ContentStream
{
[Token(Token = "0x600A24D")]
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240")]
get
{
return this._in;
}
}
// Token: 0x0600A24E RID: 41550 RVA: 0x0025CB64 File Offset: 0x0025AD64
[Token(Token = "0x600A24E")]
[Address(RVA = "0x1C85230", Offset = "0x1C83C30", VA = "0x181C85230")]
public void Drain()
{
Streams.Drain(this._in);
Platform.Dispose(this._in);
}
// Token: 0x04006ACC RID: 27340
[Token(Token = "0x4006ACC")]
private const int BufferSize = 32768;
// Token: 0x04006ACD RID: 27341
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006ACD")]
private readonly string _oid;
// Token: 0x04006ACE RID: 27342
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006ACE")]
private readonly Stream _in;
// Token: 0x02001774 RID: 6004
[Token(Token = "0x2001774")]
private class FullReaderStream : FilterStream
{
// Token: 0x0600A24F RID: 41551 RVA: 0x0025CB88 File Offset: 0x0025AD88
[Token(Token = "0x600A24F")]
[Address(RVA = "0x1C864C0", Offset = "0x1C84EC0", VA = "0x181C864C0")]
internal FullReaderStream(Stream input)
: base(input)
{
}
// Token: 0x0600A250 RID: 41552 RVA: 0x0025CB9C File Offset: 0x0025AD9C
[Token(Token = "0x600A250")]
[Address(RVA = "0x1C864A0", Offset = "0x1C84EA0", VA = "0x181C864A0", Slot = "27")]
public override int Read(byte[] buf, int off, int len)
{
return Streams.ReadFully(this.s, buf, off, len);
}
}
}
}
@@ -0,0 +1,304 @@
using System;
using System.Collections;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001775 RID: 6005
[Token(Token = "0x2001775")]
[StructLayout(3)]
internal class CmsUtilities
{
// Token: 0x17001970 RID: 6512
// (get) Token: 0x0600A251 RID: 41553 RVA: 0x0025CBB8 File Offset: 0x0025ADB8
[Token(Token = "0x17001970")]
internal static int MaximumMemory
{
[Token(Token = "0x600A251")]
[Address(RVA = "0x1C863D0", Offset = "0x1C84DD0", VA = "0x181C863D0")]
get
{
return int.MaxValue;
}
}
// Token: 0x0600A252 RID: 41554 RVA: 0x0025CBCC File Offset: 0x0025ADCC
[Token(Token = "0x600A252")]
[Address(RVA = "0x1C861E0", Offset = "0x1C84BE0", VA = "0x181C861E0")]
internal static ContentInfo ReadContentInfo(byte[] input)
{
return CmsUtilities.ReadContentInfo(new Asn1InputStream(input));
}
// Token: 0x0600A253 RID: 41555 RVA: 0x0025CBE4 File Offset: 0x0025ADE4
[Token(Token = "0x600A253")]
[Address(RVA = "0x1C86240", Offset = "0x1C84C40", VA = "0x181C86240")]
internal static ContentInfo ReadContentInfo(Stream input)
{
return CmsUtilities.ReadContentInfo(new Asn1InputStream(input, int.MaxValue));
}
// Token: 0x0600A254 RID: 41556 RVA: 0x0025CC04 File Offset: 0x0025AE04
[Token(Token = "0x600A254")]
[Address(RVA = "0x1C862A0", Offset = "0x1C84CA0", VA = "0x181C862A0")]
private static ContentInfo ReadContentInfo(Asn1InputStream aIn)
{
return ContentInfo.GetInstance(aIn.ReadObject());
}
// Token: 0x0600A255 RID: 41557 RVA: 0x0025CC24 File Offset: 0x0025AE24
[Token(Token = "0x600A255")]
[Address(RVA = "0x1C863B0", Offset = "0x1C84DB0", VA = "0x181C863B0")]
public static byte[] StreamToByteArray(Stream inStream)
{
return Streams.ReadAll(inStream);
}
// Token: 0x0600A256 RID: 41558 RVA: 0x0025CC38 File Offset: 0x0025AE38
[Token(Token = "0x600A256")]
[Address(RVA = "0x1C863C0", Offset = "0x1C84DC0", VA = "0x181C863C0")]
public static byte[] StreamToByteArray(Stream inStream, int limit)
{
return Streams.ReadAllLimited(inStream, limit);
}
// Token: 0x0600A257 RID: 41559 RVA: 0x0025CC4C File Offset: 0x0025AE4C
[Token(Token = "0x600A257")]
[Address(RVA = "0x1C85A30", Offset = "0x1C84430", VA = "0x181C85A30")]
public static IList GetCertificatesFromStore(IX509Store certStore)
{
int num = 0;
IList list = Platform.CreateArrayList();
if (certStore != 0)
{
if (list != 0)
{
if (num < list)
{
num += num;
num++;
}
ulong num2;
num2 += (ulong)1L;
if (list == 0)
{
throw new NullReferenceException();
}
Asn1Object asn1Object;
X509CertificateStructure x509CertificateStructure = X509CertificateStructure.GetInstance(asn1Object);
if (num < list)
{
num += num;
num++;
}
x509CertificateStructure += x509CertificateStructure;
num += 2;
num += 19;
}
if (num != 0)
{
}
if (num != -1)
{
}
if (num != 0)
{
throw new NullReferenceException();
}
}
return list;
}
// Token: 0x0600A258 RID: 41560 RVA: 0x0025CCD0 File Offset: 0x0025AED0
[Token(Token = "0x600A258")]
[Address(RVA = "0x1C85D90", Offset = "0x1C84790", VA = "0x181C85D90")]
public static IList GetCrlsFromStore(IX509Store crlStore)
{
int num = 0;
IList list = Platform.CreateArrayList();
if (crlStore != 0)
{
if (list != 0)
{
if (num < list)
{
num += num;
num++;
}
ulong num2;
num2 += (ulong)1L;
if (list == 0)
{
throw new NullReferenceException();
}
Asn1Object asn1Object;
CertificateList certificateList = CertificateList.GetInstance(asn1Object);
if (num < list)
{
num += num;
num++;
}
certificateList += certificateList;
num += 2;
num += 19;
}
if (num != 0)
{
}
if (num != -1)
{
}
if (num != 0)
{
throw new NullReferenceException();
}
}
return list;
}
// Token: 0x0600A259 RID: 41561 RVA: 0x0025CD54 File Offset: 0x0025AF54
[Token(Token = "0x600A259")]
[Address(RVA = "0x1C85490", Offset = "0x1C83E90", VA = "0x181C85490")]
public static Asn1Set CreateBerSetFromList(IList berObjects)
{
int num;
Asn1EncodableVector asn1EncodableVector;
do
{
num = 0;
Asn1Encodable[] array;
if (asn1EncodableVector != 0)
{
if (num < asn1EncodableVector)
{
num += num;
num++;
}
if (num == 0)
{
num++;
num += 19;
}
if (num == 0)
{
goto IL_75;
}
array = new Asn1Encodable[1];
if (num != 0)
{
}
array[0] = num;
asn1EncodableVector.Add(array);
}
if (array != 0)
{
}
if (num != -1)
{
}
}
while (num != 0);
BerSet berSet = new BerSet(asn1EncodableVector);
throw new NullReferenceException();
IL_75:
throw new NullReferenceException();
}
// Token: 0x0600A25A RID: 41562 RVA: 0x0025CDDC File Offset: 0x0025AFDC
[Token(Token = "0x600A25A")]
[Address(RVA = "0x1C85760", Offset = "0x1C84160", VA = "0x181C85760")]
public static Asn1Set CreateDerSetFromList(IList derObjects)
{
int num;
Asn1EncodableVector asn1EncodableVector;
do
{
num = 0;
Asn1Encodable[] array;
if (asn1EncodableVector != 0)
{
if (num < asn1EncodableVector)
{
num += num;
num++;
}
if (num == 0)
{
num++;
num += 19;
}
if (num == 0)
{
goto IL_75;
}
array = new Asn1Encodable[1];
if (num != 0)
{
}
array[0] = num;
asn1EncodableVector.Add(array);
}
if (array != 0)
{
}
if (num != -1)
{
}
}
while (num != 0);
DerSet derSet = new DerSet(asn1EncodableVector);
throw new NullReferenceException();
IL_75:
throw new NullReferenceException();
}
// Token: 0x0600A25B RID: 41563 RVA: 0x0025CE64 File Offset: 0x0025B064
[Token(Token = "0x600A25B")]
[Address(RVA = "0x1C853F0", Offset = "0x1C83DF0", VA = "0x181C853F0")]
internal static Stream CreateBerOctetOutputStream(Stream s, int tagNo, bool isExplicit, int bufferSize)
{
return new BerOctetStringGenerator(s, tagNo, isExplicit).GetOctetOutputStream(bufferSize);
}
// Token: 0x0600A25C RID: 41564 RVA: 0x0025CE88 File Offset: 0x0025B088
[Token(Token = "0x600A25C")]
[Address(RVA = "0x1C861A0", Offset = "0x1C84BA0", VA = "0x181C861A0")]
internal static TbsCertificateStructure GetTbsCertificateStructure(X509Certificate cert)
{
DateTime notAfter = cert.NotAfter;
Asn1Object asn1Object;
return TbsCertificateStructure.GetInstance(asn1Object);
}
// Token: 0x0600A25D RID: 41565 RVA: 0x0025CEA8 File Offset: 0x0025B0A8
[Token(Token = "0x600A25D")]
[Address(RVA = "0x1C860F0", Offset = "0x1C84AF0", VA = "0x181C860F0")]
internal static IssuerAndSerialNumber GetIssuerAndSerialNumber(X509Certificate cert)
{
DateTime notAfter = cert.NotAfter;
Asn1Object asn1Object;
TbsCertificateStructure instance = TbsCertificateStructure.GetInstance(asn1Object);
DerInteger serialNumber = instance.serialNumber;
X509Name issuer = instance.issuer;
BigInteger value = serialNumber.Value;
return new IssuerAndSerialNumber(issuer, value);
}
// Token: 0x0600A25E RID: 41566 RVA: 0x0025CEEC File Offset: 0x0025B0EC
[Token(Token = "0x600A25E")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public CmsUtilities()
{
}
}
}
@@ -0,0 +1,45 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001776 RID: 6006
[Token(Token = "0x2001776")]
[StructLayout(3)]
internal class CounterSignatureDigestCalculator : IDigestCalculator
{
// Token: 0x0600A25F RID: 41567 RVA: 0x0025CF00 File Offset: 0x0025B100
[Token(Token = "0x600A25F")]
[Address(RVA = "0x3C39C0", Offset = "0x3C23C0", VA = "0x1803C39C0")]
internal CounterSignatureDigestCalculator(string alg, byte[] data)
{
this.alg = alg;
this.data = data;
}
// Token: 0x0600A260 RID: 41568 RVA: 0x0025CF24 File Offset: 0x0025B124
[Token(Token = "0x600A260")]
[Address(RVA = "0x654090", Offset = "0x652A90", VA = "0x180654090", Slot = "4")]
public byte[] GetDigest()
{
CmsSignedHelper instance = CmsSignedHelper.Instance;
string text = this.alg;
IDigest digestInstance = instance.GetDigestInstance(text);
byte[] array = this.data;
return DigestUtilities.DoFinal(digestInstance, array);
}
// Token: 0x04006ACF RID: 27343
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006ACF")]
private readonly string alg;
// Token: 0x04006AD0 RID: 27344
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006AD0")]
private readonly byte[] data;
}
}
@@ -0,0 +1,88 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001777 RID: 6007
[Token(Token = "0x2001777")]
[StructLayout(3)]
public class DefaultAuthenticatedAttributeTableGenerator : CmsAttributeTableGenerator
{
// Token: 0x0600A261 RID: 41569 RVA: 0x0025CF5C File Offset: 0x0025B15C
[Token(Token = "0x600A261")]
[Address(RVA = "0x656380", Offset = "0x654D80", VA = "0x180656380")]
public DefaultAuthenticatedAttributeTableGenerator()
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
}
// Token: 0x0600A262 RID: 41570 RVA: 0x0025CF80 File Offset: 0x0025B180
[Token(Token = "0x600A262")]
[Address(RVA = "0x6562F0", Offset = "0x654CF0", VA = "0x1806562F0")]
public DefaultAuthenticatedAttributeTableGenerator(AttributeTable attributeTable)
{
if (attributeTable == 0)
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
return;
}
IDictionary dictionary2 = attributeTable.ToDictionary();
this.table = dictionary2;
}
// Token: 0x0600A263 RID: 41571 RVA: 0x0025CFB8 File Offset: 0x0025B1B8
[Token(Token = "0x600A263")]
[Address(RVA = "0x655F00", Offset = "0x654900", VA = "0x180655F00", Slot = "5")]
protected virtual IDictionary CreateStandardAttributeTable(IDictionary parameters)
{
IDictionary dictionary;
CmsAttributeTableParameter cmsAttributeTableParameter2;
do
{
dictionary = Platform.CreateHashtable(this.table);
if (dictionary == 0)
{
CmsAttributeTableParameter cmsAttributeTableParameter;
if (cmsAttributeTableParameter == CmsAttributeTableParameter.ContentType)
{
}
if (cmsAttributeTableParameter == CmsAttributeTableParameter.ContentType)
{
continue;
}
DerObjectIdentifier contentType = CmsAttributes.ContentType;
DerSet derSet = new DerSet(cmsAttributeTableParameter);
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute attribute = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute(contentType, derSet);
}
}
while (cmsAttributeTableParameter2 != CmsAttributeTableParameter.ContentType && cmsAttributeTableParameter2 == CmsAttributeTableParameter.ContentType);
DerObjectIdentifier messageDigest = CmsAttributes.MessageDigest;
DerOctetString derOctetString;
DerSet derSet2 = new DerSet(derOctetString);
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute attribute2 = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute(messageDigest, derSet2);
return dictionary;
}
// Token: 0x0600A264 RID: 41572 RVA: 0x0025D02C File Offset: 0x0025B22C
[Token(Token = "0x600A264")]
[Address(RVA = "0x656280", Offset = "0x654C80", VA = "0x180656280", Slot = "6")]
public virtual AttributeTable GetAttributes(IDictionary parameters)
{
AttributeTable attributes = this.GetAttributes(parameters);
AttributeTable attributeTable;
return attributeTable;
}
// Token: 0x04006AD1 RID: 27345
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006AD1")]
private readonly IDictionary table;
}
}
@@ -0,0 +1,186 @@
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.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200176F RID: 5999
[Token(Token = "0x200176F")]
[StructLayout(3)]
public class DefaultDigestAlgorithmIdentifierFinder
{
// Token: 0x0600A221 RID: 41505 RVA: 0x0025B9E8 File Offset: 0x00259BE8
[Token(Token = "0x600A221")]
[Address(RVA = "0x6563E0", Offset = "0x654DE0", VA = "0x1806563E0")]
static DefaultDigestAlgorithmIdentifierFinder()
{
IDictionary dictionary = Platform.CreateHashtable();
DefaultDigestAlgorithmIdentifierFinder.digestOids = dictionary;
DefaultDigestAlgorithmIdentifierFinder.digestNameToOids = Platform.CreateHashtable();
IDictionary dictionary2 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier md = PkcsObjectIdentifiers.MD4;
IDictionary dictionary3 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier md2 = PkcsObjectIdentifiers.MD4;
IDictionary dictionary4 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier md3 = PkcsObjectIdentifiers.MD5;
IDictionary dictionary5 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary6 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha2 = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary7 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha3 = NistObjectIdentifiers.IdSha224;
IDictionary dictionary8 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha4 = NistObjectIdentifiers.IdSha256;
IDictionary dictionary9 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha5 = NistObjectIdentifiers.IdSha384;
IDictionary dictionary10 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha6 = NistObjectIdentifiers.IdSha512;
IDictionary dictionary11 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier md4 = PkcsObjectIdentifiers.MD2;
IDictionary dictionary12 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier md5 = PkcsObjectIdentifiers.MD4;
IDictionary dictionary13 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier md6 = PkcsObjectIdentifiers.MD5;
IDictionary dictionary14 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha7 = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary15 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha8 = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary16 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha9 = NistObjectIdentifiers.IdSha224;
IDictionary dictionary17 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha10 = NistObjectIdentifiers.IdSha256;
IDictionary dictionary18 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha11 = NistObjectIdentifiers.IdSha384;
IDictionary dictionary19 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha12 = NistObjectIdentifiers.IdSha512;
IDictionary dictionary20 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha13 = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary21 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha14 = NistObjectIdentifiers.IdSha224;
IDictionary dictionary22 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha15 = NistObjectIdentifiers.IdSha256;
IDictionary dictionary23 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha16 = NistObjectIdentifiers.IdSha384;
IDictionary dictionary24 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha17 = NistObjectIdentifiers.IdSha512;
IDictionary dictionary25 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier ripeMD = TeleTrusTObjectIdentifiers.RipeMD128;
IDictionary dictionary26 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier ripeMD2 = TeleTrusTObjectIdentifiers.RipeMD160;
IDictionary dictionary27 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier ripeMD3 = TeleTrusTObjectIdentifiers.RipeMD256;
IDictionary dictionary28 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier gostR = CryptoProObjectIdentifiers.GostR3411;
IDictionary dictionary29 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier gostR2 = CryptoProObjectIdentifiers.GostR3411;
IDictionary dictionary30 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha18 = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary31 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha19 = NistObjectIdentifiers.IdSha224;
IDictionary dictionary32 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha20 = NistObjectIdentifiers.IdSha256;
IDictionary dictionary33 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha21 = NistObjectIdentifiers.IdSha384;
IDictionary dictionary34 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha22 = NistObjectIdentifiers.IdSha512;
IDictionary dictionary35 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha23 = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary36 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha24 = NistObjectIdentifiers.IdSha224;
IDictionary dictionary37 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha25 = NistObjectIdentifiers.IdSha256;
IDictionary dictionary38 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha26 = NistObjectIdentifiers.IdSha384;
IDictionary dictionary39 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha27 = NistObjectIdentifiers.IdSha512;
IDictionary dictionary40 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha3_ = NistObjectIdentifiers.IdSha3_224;
IDictionary dictionary41 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha3_2 = NistObjectIdentifiers.IdSha3_256;
IDictionary dictionary42 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha3_3 = NistObjectIdentifiers.IdSha3_384;
IDictionary dictionary43 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha3_4 = NistObjectIdentifiers.IdSha3_512;
IDictionary dictionary44 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idShake = NistObjectIdentifiers.IdShake128;
IDictionary dictionary45 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idShake2 = NistObjectIdentifiers.IdShake256;
IDictionary dictionary46 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier gostR3 = CryptoProObjectIdentifiers.GostR3411;
IDictionary dictionary47 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier md7 = PkcsObjectIdentifiers.MD2;
IDictionary dictionary48 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier md8 = PkcsObjectIdentifiers.MD4;
IDictionary dictionary49 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier md9 = PkcsObjectIdentifiers.MD5;
IDictionary dictionary50 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier ripeMD4 = TeleTrusTObjectIdentifiers.RipeMD128;
IDictionary dictionary51 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier ripeMD5 = TeleTrusTObjectIdentifiers.RipeMD160;
IDictionary dictionary52 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier ripeMD6 = TeleTrusTObjectIdentifiers.RipeMD256;
}
// Token: 0x0600A222 RID: 41506 RVA: 0x0025BCE0 File Offset: 0x00259EE0
[Token(Token = "0x600A222")]
[Address(RVA = "0x657480", Offset = "0x655E80", VA = "0x180657480")]
public AlgorithmIdentifier find(AlgorithmIdentifier sigAlgId)
{
int num;
AlgorithmIdentifier algorithmIdentifier;
for (;;)
{
Asn1Object asn1Object = sigAlgId.ToAsn1Object();
IDictionary dictionary = DefaultDigestAlgorithmIdentifierFinder.digestOids;
Asn1Object asn1Object2 = sigAlgId.ToAsn1Object();
DerNull instance = DerNull.Instance;
algorithmIdentifier = new AlgorithmIdentifier(num, instance);
if (asn1Object2 == 0)
{
break;
}
if (asn1Object2 != 0)
{
return algorithmIdentifier;
}
}
num = 0;
return algorithmIdentifier;
}
// Token: 0x0600A223 RID: 41507 RVA: 0x0025BD3C File Offset: 0x00259F3C
[Token(Token = "0x600A223")]
[Address(RVA = "0x6576C0", Offset = "0x6560C0", VA = "0x1806576C0")]
public AlgorithmIdentifier find(string digAlgName)
{
IDictionary dictionary = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
IDictionary dictionary2 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
AlgorithmIdentifier algorithmIdentifier;
return algorithmIdentifier;
}
// Token: 0x0600A224 RID: 41508 RVA: 0x0025BD60 File Offset: 0x00259F60
[Token(Token = "0x600A224")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public DefaultDigestAlgorithmIdentifierFinder()
{
}
// Token: 0x04006AA7 RID: 27303
[Token(Token = "0x4006AA7")]
private static readonly IDictionary digestOids;
// Token: 0x04006AA8 RID: 27304
[Token(Token = "0x4006AA8")]
private static readonly IDictionary digestNameToOids;
}
}
@@ -0,0 +1,99 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001778 RID: 6008
[Token(Token = "0x2001778")]
[StructLayout(3)]
public class DefaultSignedAttributeTableGenerator : CmsAttributeTableGenerator
{
// Token: 0x0600A265 RID: 41573 RVA: 0x0025D044 File Offset: 0x0025B244
[Token(Token = "0x600A265")]
[Address(RVA = "0x657DB0", Offset = "0x6567B0", VA = "0x180657DB0")]
public DefaultSignedAttributeTableGenerator()
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
}
// Token: 0x0600A266 RID: 41574 RVA: 0x0025D068 File Offset: 0x0025B268
[Token(Token = "0x600A266")]
[Address(RVA = "0x657D20", Offset = "0x656720", VA = "0x180657D20")]
public DefaultSignedAttributeTableGenerator(AttributeTable attributeTable)
{
if (attributeTable == 0)
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
return;
}
IDictionary dictionary2 = attributeTable.ToDictionary();
this.table = dictionary2;
}
// Token: 0x0600A267 RID: 41575 RVA: 0x0025D0A0 File Offset: 0x0025B2A0
[Token(Token = "0x600A267")]
[Address(RVA = "0x657E10", Offset = "0x656810", VA = "0x180657E10", Slot = "5")]
protected virtual Hashtable createStandardAttributeTable(IDictionary parameters)
{
Hashtable hashtable = new Hashtable(this.table);
this.DoCreateStandardAttributeTable(parameters, hashtable);
return hashtable;
}
// Token: 0x0600A268 RID: 41576 RVA: 0x0025D0C4 File Offset: 0x0025B2C4
[Token(Token = "0x600A268")]
[Address(RVA = "0x657800", Offset = "0x656200", VA = "0x180657800")]
private void DoCreateStandardAttributeTable(IDictionary parameters, IDictionary std)
{
CmsAttributeTableParameter cmsAttributeTableParameter3;
do
{
CmsAttributeTableParameter cmsAttributeTableParameter;
if (cmsAttributeTableParameter != CmsAttributeTableParameter.ContentType)
{
CmsAttributeTableParameter cmsAttributeTableParameter2;
if (cmsAttributeTableParameter2 == CmsAttributeTableParameter.ContentType)
{
}
if (cmsAttributeTableParameter2 == CmsAttributeTableParameter.ContentType)
{
continue;
}
DerObjectIdentifier contentType = CmsAttributes.ContentType;
DerSet derSet = new DerSet(cmsAttributeTableParameter2);
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute attribute = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute(contentType, derSet);
}
DerObjectIdentifier signingTime = CmsAttributes.SigningTime;
DerSet derSet2 = new DerSet(new Time(DateTime.UtcNow));
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute attribute2 = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute(signingTime, derSet2);
}
while (cmsAttributeTableParameter3 != CmsAttributeTableParameter.ContentType && cmsAttributeTableParameter3 == CmsAttributeTableParameter.ContentType);
DerObjectIdentifier messageDigest = CmsAttributes.MessageDigest;
DerOctetString derOctetString;
DerSet derSet3 = new DerSet(derOctetString);
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute attribute3 = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute(messageDigest, derSet3);
}
// Token: 0x0600A269 RID: 41577 RVA: 0x0025D150 File Offset: 0x0025B350
[Token(Token = "0x600A269")]
[Address(RVA = "0x657CB0", Offset = "0x6566B0", VA = "0x180657CB0", Slot = "6")]
public virtual AttributeTable GetAttributes(IDictionary parameters)
{
AttributeTable attributes = this.GetAttributes(parameters);
AttributeTable attributeTable;
return attributeTable;
}
// Token: 0x04006AD2 RID: 27346
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006AD2")]
private readonly IDictionary table;
}
}
@@ -0,0 +1,17 @@
using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001779 RID: 6009
[Token(Token = "0x2001779")]
[StructLayout(3)]
internal interface IDigestCalculator
{
// Token: 0x0600A26A RID: 41578
[Token(Token = "0x600A26A")]
[Address(Slot = "0")]
byte[] GetDigest();
}
}
@@ -0,0 +1,20 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200178C RID: 6028
[Token(Token = "0x200178C")]
[StructLayout(3)]
internal interface ISignerInfoGenerator
{
// Token: 0x0600A2C6 RID: 41670
[Token(Token = "0x600A2C6")]
[Address(Slot = "0")]
SignerInfo Generate(DerObjectIdentifier contentType, AlgorithmIdentifier digestAlgorithm, byte[] calculatedDigest);
}
}
@@ -0,0 +1,138 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200177A RID: 6010
[Token(Token = "0x200177A")]
[StructLayout(3)]
internal class KekRecipientInfoGenerator : RecipientInfoGenerator
{
// Token: 0x0600A26B RID: 41579 RVA: 0x0025D168 File Offset: 0x0025B368
[Token(Token = "0x600A26B")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
internal KekRecipientInfoGenerator()
{
}
// Token: 0x17001971 RID: 6513
// (set) Token: 0x0600A26C RID: 41580 RVA: 0x0025D17C File Offset: 0x0025B37C
[Token(Token = "0x17001971")]
internal KekIdentifier KekIdentifier
{
[Token(Token = "0x600A26C")]
[Address(RVA = "0x3C1260", Offset = "0x3BFC60", VA = "0x1803C1260")]
set
{
this.kekIdentifier = value;
}
}
// Token: 0x17001972 RID: 6514
// (set) Token: 0x0600A26D RID: 41581 RVA: 0x0025D190 File Offset: 0x0025B390
[Token(Token = "0x17001972")]
internal KeyParameter KeyEncryptionKey
{
[Token(Token = "0x600A26D")]
[Address(RVA = "0x65E310", Offset = "0x65CD10", VA = "0x18065E310")]
set
{
string text = this.keyEncryptionKeyOID;
this.keyEncryptionKey = value;
AlgorithmIdentifier algorithmIdentifier = KekRecipientInfoGenerator.DetermineKeyEncAlg(text, value);
this.keyEncryptionAlgorithm = algorithmIdentifier;
}
}
// Token: 0x17001973 RID: 6515
// (set) Token: 0x0600A26E RID: 41582 RVA: 0x0025D1BC File Offset: 0x0025B3BC
[Token(Token = "0x17001973")]
internal string KeyEncryptionKeyOID
{
[Token(Token = "0x600A26E")]
[Address(RVA = "0x3C1280", Offset = "0x3BFC80", VA = "0x1803C1280")]
set
{
this.keyEncryptionKeyOID = value;
}
}
// Token: 0x0600A26F RID: 41583 RVA: 0x0025D1D0 File Offset: 0x0025B3D0
[Token(Token = "0x600A26F")]
[Address(RVA = "0x65E0D0", Offset = "0x65CAD0", VA = "0x18065E0D0", Slot = "4")]
public RecipientInfo Generate(KeyParameter contentEncryptionKey, SecureRandom random)
{
byte[] key = contentEncryptionKey.GetKey();
CmsEnvelopedHelper helper = KekRecipientInfoGenerator.Helper;
Asn1Object asn1Object = this.keyEncryptionAlgorithm.ToAsn1Object();
ParametersWithRandom parametersWithRandom = new ParametersWithRandom(this.keyEncryptionKey, random);
int length = key.Length;
KekIdentifier kekIdentifier = this.kekIdentifier;
AlgorithmIdentifier algorithmIdentifier = this.keyEncryptionAlgorithm;
DerOctetString derOctetString;
return new RecipientInfo(new KekRecipientInfo(kekIdentifier, algorithmIdentifier, derOctetString));
}
// Token: 0x0600A270 RID: 41584 RVA: 0x0025D238 File Offset: 0x0025B438
[Token(Token = "0x600A270")]
[Address(RVA = "0x65DB60", Offset = "0x65C560", VA = "0x18065DB60")]
private static AlgorithmIdentifier DetermineKeyEncAlg(string algorithm, KeyParameter key)
{
/*
An exception occurred when decompiling this method (0600A270)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.AlgorithmIdentifier BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.KekRecipientInfoGenerator::DetermineKeyEncAlg(System.String,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.KeyParameter)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_F3:
stloc:ArgumentException(var_8_FD, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("illegal keysize in AES")))
}
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.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: 0x04006AD3 RID: 27347
[Token(Token = "0x4006AD3")]
private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance;
// Token: 0x04006AD4 RID: 27348
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006AD4")]
private KeyParameter keyEncryptionKey;
// Token: 0x04006AD5 RID: 27349
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006AD5")]
private string keyEncryptionKeyOID;
// Token: 0x04006AD6 RID: 27350
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006AD6")]
private KekIdentifier kekIdentifier;
// Token: 0x04006AD7 RID: 27351
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006AD7")]
private AlgorithmIdentifier keyEncryptionAlgorithm;
}
}
@@ -0,0 +1,51 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200177B RID: 6011
[Token(Token = "0x200177B")]
[StructLayout(3)]
public class KekRecipientInformation : RecipientInformation
{
// Token: 0x0600A272 RID: 41586 RVA: 0x0025D35C File Offset: 0x0025B55C
[Token(Token = "0x600A272")]
[Address(RVA = "0x65E5A0", Offset = "0x65CFA0", VA = "0x18065E5A0")]
internal KekRecipientInformation(KekRecipientInfo info, CmsSecureReadable secureReadable)
{
AlgorithmIdentifier keyEncryptionAlgorithm = info.keyEncryptionAlgorithm;
base..ctor(keyEncryptionAlgorithm, secureReadable);
this.info = info;
RecipientID recipientID = new RecipientID();
this.rid = recipientID;
Stream octetStream = info.kekID.keyIdentifier.GetOctetStream();
byte[] array;
recipientID.keyIdentifier = array;
}
// Token: 0x0600A273 RID: 41587 RVA: 0x0025D3AC File Offset: 0x0025B5AC
[Token(Token = "0x600A273")]
[Address(RVA = "0x65E390", Offset = "0x65CD90", VA = "0x18065E390", Slot = "4")]
public override CmsTypedStream GetContentStream(ICipherParameters key)
{
Stream octetStream = this.info.encryptedKey.GetOctetStream();
Asn1Object asn1Object = this.keyEncAlg.ToAsn1Object();
string contentAlgorithmName = base.GetContentAlgorithmName();
Stream.ReadWriteTask activeReadWriteTask = octetStream._activeReadWriteTask;
KeyParameter keyParameter;
return base.GetContentFromSessionKey(keyParameter);
}
// Token: 0x04006AD8 RID: 27352
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006AD8")]
private KekRecipientInfo info;
}
}
@@ -0,0 +1,258 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Ecc;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200177C RID: 6012
[Token(Token = "0x200177C")]
[StructLayout(3)]
internal class KeyAgreeRecipientInfoGenerator : RecipientInfoGenerator
{
// Token: 0x0600A274 RID: 41588 RVA: 0x0025D430 File Offset: 0x0025B630
[Token(Token = "0x600A274")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
internal KeyAgreeRecipientInfoGenerator()
{
}
// Token: 0x17001974 RID: 6516
// (set) Token: 0x0600A275 RID: 41589 RVA: 0x0025D444 File Offset: 0x0025B644
[Token(Token = "0x17001974")]
internal DerObjectIdentifier KeyAgreementOID
{
[Token(Token = "0x600A275")]
[Address(RVA = "0x3C39B0", Offset = "0x3C23B0", VA = "0x1803C39B0")]
set
{
this.keyAgreementOID = value;
}
}
// Token: 0x17001975 RID: 6517
// (set) Token: 0x0600A276 RID: 41590 RVA: 0x0025D458 File Offset: 0x0025B658
[Token(Token = "0x17001975")]
internal DerObjectIdentifier KeyEncryptionOID
{
[Token(Token = "0x600A276")]
[Address(RVA = "0x3C1280", Offset = "0x3BFC80", VA = "0x1803C1280")]
set
{
this.keyEncryptionOID = value;
}
}
// Token: 0x17001976 RID: 6518
// (set) Token: 0x0600A277 RID: 41591 RVA: 0x0025D46C File Offset: 0x0025B66C
[Token(Token = "0x17001976")]
internal ICollection RecipientCerts
{
[Token(Token = "0x600A277")]
[Address(RVA = "0x65F590", Offset = "0x65DF90", VA = "0x18065F590")]
set
{
IList list = Platform.CreateArrayList(value);
this.recipientCerts = list;
}
}
// Token: 0x17001977 RID: 6519
// (set) Token: 0x0600A278 RID: 41592 RVA: 0x0025D488 File Offset: 0x0025B688
[Token(Token = "0x17001977")]
internal AsymmetricCipherKeyPair SenderKeyPair
{
[Token(Token = "0x600A278")]
[Address(RVA = "0x3C1270", Offset = "0x3BFC70", VA = "0x1803C1270")]
set
{
this.senderKeyPair = value;
}
}
// Token: 0x0600A279 RID: 41593 RVA: 0x0025D49C File Offset: 0x0025B69C
[Token(Token = "0x600A279")]
[Address(RVA = "0x65E7C0", Offset = "0x65D1C0", VA = "0x18065E7C0", Slot = "4")]
public RecipientInfo Generate(KeyParameter contentEncryptionKey, SecureRandom random)
{
for (;;)
{
int num = 0;
byte[] key = contentEncryptionKey.GetKey();
AsymmetricCipherKeyPair asymmetricCipherKeyPair = this.senderKeyPair;
AsymmetricKeyParameter publicParameter = asymmetricCipherKeyPair.publicParameter;
AsymmetricKeyParameter privateParameter = asymmetricCipherKeyPair.privateParameter;
OriginatorIdentifierOrKey originatorIdentifierOrKey = new OriginatorIdentifierOrKey(KeyAgreeRecipientInfoGenerator.CreateOriginatorPublicKey(publicParameter));
string identifier = this.keyAgreementOID.identifier;
string ecmqvSha1Kdf = CmsEnvelopedGenerator.ECMqvSha1Kdf;
if (identifier.Equals(ecmqvSha1Kdf))
{
IAsymmetricCipherKeyPairGenerator keyPairGenerator = GeneratorUtilities.GetKeyPairGenerator(this.keyAgreementOID);
if (publicParameter == 0 || publicParameter == 0)
{
goto IL_260;
}
int num2 = 0;
if (num < num2)
{
num += num;
num++;
}
int num3 = 0;
if (num < num3)
{
num += num;
num++;
}
OriginatorPublicKey originatorPublicKey;
int num4;
MQVuserKeyingMaterial mqvuserKeyingMaterial = new MQVuserKeyingMaterial(originatorPublicKey, num4);
num4 = 0;
DerOctetString derOctetString = new DerOctetString(mqvuserKeyingMaterial);
if (num == 0)
{
}
if (num == 0)
{
goto IL_254;
}
if (mqvuserKeyingMaterial == 0)
{
}
if (mqvuserKeyingMaterial == 0)
{
goto IL_254;
}
if (privateParameter == 0)
{
}
if (privateParameter == 0)
{
goto IL_254;
}
}
Asn1Encodable[] array = new Asn1Encodable[2];
DerObjectIdentifier derObjectIdentifier = this.keyEncryptionOID;
if (derObjectIdentifier != 0)
{
}
array[0] = derObjectIdentifier;
DerNull instance = DerNull.Instance;
if (instance != 0)
{
}
array[1] = instance;
DerSequence derSequence = new DerSequence(array);
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(this.keyAgreementOID, derSequence);
IList list = this.recipientCerts;
Asn1EncodableVector asn1EncodableVector;
if (asn1EncodableVector != 0)
{
if (asn1EncodableVector == 0)
{
}
if (asn1EncodableVector != 0)
{
break;
}
}
else
{
ArrayTypeMismatchException ex;
if (ex != 0)
{
}
if (num != -1)
{
}
if (num == 0)
{
goto Block_9;
}
}
}
Asn1Object asn1Object;
TbsCertificateStructure instance2 = TbsCertificateStructure.GetInstance(asn1Object);
X509Name issuer = instance2.issuer;
BigInteger value = instance2.serialNumber.Value;
KeyAgreeRecipientIdentifier keyAgreeRecipientIdentifier = new KeyAgreeRecipientIdentifier(new IssuerAndSerialNumber(issuer, value));
string identifier2 = this.keyAgreementOID.identifier;
string ecmqvSha1Kdf2 = CmsEnvelopedGenerator.ECMqvSha1Kdf;
if (identifier2.Equals(ecmqvSha1Kdf2))
{
}
DerObjectIdentifier derObjectIdentifier2 = this.keyAgreementOID;
string identifier3 = this.keyEncryptionOID.identifier;
IBasicAgreement basicAgreementWithKdf = AgreementUtilities.GetBasicAgreementWithKdf(derObjectIdentifier2, identifier3);
DerObjectIdentifier derObjectIdentifier3 = this.keyEncryptionOID;
int num5 = 0;
int defaultKeySize = GeneratorUtilities.GetDefaultKeySize(derObjectIdentifier3);
num5 += defaultKeySize;
byte[] array2;
KeyParameter keyParameter = ParameterUtilities.CreateKeyParameter(this.keyEncryptionOID, array2);
CmsEnvelopedHelper helper = KeyAgreeRecipientInfoGenerator.Helper;
DerObjectIdentifier derObjectIdentifier4 = this.keyEncryptionOID;
int num6 = 0;
string identifier4 = derObjectIdentifier4.identifier;
IWrapper wrapper = helper.CreateWrapper(identifier4);
ParametersWithRandom parametersWithRandom = new ParametersWithRandom(keyParameter, num6);
Asn1Encodable[] array3 = new Asn1Encodable[1];
DerOctetString derOctetString2;
RecipientEncryptedKey recipientEncryptedKey = new RecipientEncryptedKey(keyAgreeRecipientIdentifier, derOctetString2);
throw new ArrayTypeMismatchException();
Block_9:
KeyAgreeRecipientInfo keyAgreeRecipientInfo;
return new RecipientInfo(keyAgreeRecipientInfo);
IL_254:
throw new NullReferenceException();
IL_260:
throw new NullReferenceException();
}
// Token: 0x0600A27A RID: 41594 RVA: 0x0025D724 File Offset: 0x0025B924
[Token(Token = "0x600A27A")]
[Address(RVA = "0x65E6A0", Offset = "0x65D0A0", VA = "0x18065E6A0")]
private static OriginatorPublicKey CreateOriginatorPublicKey(AsymmetricKeyParameter publicKey)
{
SubjectPublicKeyInfo subjectPublicKeyInfo = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(publicKey);
Asn1Object asn1Object = subjectPublicKeyInfo.algID.ToAsn1Object();
byte[] octets = subjectPublicKeyInfo.keyData.GetOctets();
AlgorithmIdentifier algorithmIdentifier;
return new OriginatorPublicKey(algorithmIdentifier, octets);
}
// Token: 0x04006AD9 RID: 27353
[Token(Token = "0x4006AD9")]
private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance;
// Token: 0x04006ADA RID: 27354
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006ADA")]
private DerObjectIdentifier keyAgreementOID;
// Token: 0x04006ADB RID: 27355
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006ADB")]
private DerObjectIdentifier keyEncryptionOID;
// Token: 0x04006ADC RID: 27356
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006ADC")]
private IList recipientCerts;
// Token: 0x04006ADD RID: 27357
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006ADD")]
private AsymmetricCipherKeyPair senderKeyPair;
}
}
@@ -0,0 +1,261 @@
using System;
using System.Collections;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Ecc;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200177D RID: 6013
[Token(Token = "0x200177D")]
[StructLayout(3)]
public class KeyAgreeRecipientInformation : RecipientInformation
{
// Token: 0x0600A27C RID: 41596 RVA: 0x0025D778 File Offset: 0x0025B978
[Token(Token = "0x600A27C")]
[Address(RVA = "0x660160", Offset = "0x65EB60", VA = "0x180660160")]
internal static void ReadRecipientInfo(IList infos, KeyAgreeRecipientInfo info, CmsSecureReadable secureReadable)
{
int num = 0;
IEnumerator enumerator = info.recipientEncryptedKeys.GetEnumerator();
if (enumerator != 0)
{
if (num < enumerator)
{
num += num;
num++;
}
ulong num2;
enumerator += num2;
if (enumerator == 0 || enumerator == 0)
{
throw new NullReferenceException();
}
RecipientID recipientID = new RecipientID();
RecipientEncryptedKey recipientEncryptedKey;
KeyAgreeRecipientIdentifier identifier = recipientEncryptedKey.identifier;
if (identifier.issuerSerial == 0)
{
Stream octetStream = identifier.rKeyID.subjectKeyIdentifier.GetOctetStream();
}
byte[] authorityKeyIdentifier = recipientID.authorityKeyIdentifier;
recipientID.issuer = authorityKeyIdentifier;
int basicConstraints = recipientID.basicConstraints;
BigInteger bigInteger;
recipientID.serialNumber = bigInteger;
}
KeyAgreeRecipientInformation keyAgreeRecipientInformation;
if (keyAgreeRecipientInformation != 0)
{
}
if (num != -1)
{
}
if (num == 0)
{
return;
}
throw new NullReferenceException();
}
// Token: 0x0600A27D RID: 41597 RVA: 0x0025D860 File Offset: 0x0025BA60
[Token(Token = "0x600A27D")]
[Address(RVA = "0x660680", Offset = "0x65F080", VA = "0x180660680")]
internal KeyAgreeRecipientInformation(KeyAgreeRecipientInfo info, RecipientID rid, Asn1OctetString encryptedKey, CmsSecureReadable secureReadable)
{
this.rid = rid;
this.encryptedKey = encryptedKey;
this.info = info;
}
// Token: 0x0600A27E RID: 41598 RVA: 0x0025D888 File Offset: 0x0025BA88
[Token(Token = "0x600A27E")]
[Address(RVA = "0x65FC00", Offset = "0x65E600", VA = "0x18065FC00")]
private AsymmetricKeyParameter GetSenderPublicKey(AsymmetricKeyParameter receiverPrivateKey, OriginatorIdentifierOrKey originator)
{
OriginatorPublicKey originatorPublicKey = originator.OriginatorPublicKey;
if (originatorPublicKey != 0)
{
return this.GetPublicKeyFromOriginatorPublicKey(receiverPrivateKey, originatorPublicKey);
}
OriginatorID originatorID = new OriginatorID();
IssuerAndSerialNumber issuerAndSerialNumber = originator.IssuerAndSerialNumber;
if (issuerAndSerialNumber == 0)
{
throw new NullReferenceException();
}
throw new NullReferenceException();
}
// Token: 0x0600A27F RID: 41599 RVA: 0x0025D938 File Offset: 0x0025BB38
[Token(Token = "0x600A27F")]
[Address(RVA = "0x65FB40", Offset = "0x65E540", VA = "0x18065FB40")]
private AsymmetricKeyParameter GetPublicKeyFromOriginatorPublicKey(AsymmetricKeyParameter receiverPrivateKey, OriginatorPublicKey originatorPublicKey)
{
bool hasPublicKey = PrivateKeyInfoFactory.CreatePrivateKeyInfo(receiverPrivateKey).HasPublicKey;
byte[] octets = originatorPublicKey.mPublicKey.GetOctets();
SubjectPublicKeyInfo subjectPublicKeyInfo;
return PublicKeyFactory.CreateKey(subjectPublicKeyInfo);
}
// Token: 0x0600A280 RID: 41600 RVA: 0x0025D96C File Offset: 0x0025BB6C
[Token(Token = "0x600A280")]
[Address(RVA = "0x65FAE0", Offset = "0x65E4E0", VA = "0x18065FAE0")]
private AsymmetricKeyParameter GetPublicKeyFromOriginatorID(OriginatorID origID)
{
/*
An exception occurred when decompiling this method (0600A280)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.KeyAgreeRecipientInformation::GetPublicKeyFromOriginatorID(BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.OriginatorID)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:CmsException(var_0_0A, newobj:CmsException(CmsException::.ctor, ldstr:string("No support for 'originator' as IssuerAndSerialNumber or SubjectKeyIdentifier")))
}
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: 0x0600A281 RID: 41601 RVA: 0x0025D984 File Offset: 0x0025BB84
[Token(Token = "0x600A281")]
[Address(RVA = "0x65F600", Offset = "0x65E000", VA = "0x18065F600")]
private KeyParameter CalculateAgreedWrapKey(string wrapAlg, AsymmetricKeyParameter senderPublicKey, AsymmetricKeyParameter receiverPrivateKey)
{
for (;;)
{
Asn1Object asn1Object = this.keyEncAlg.ToAsn1Object();
string ecmqvSha1Kdf = CmsEnvelopedGenerator.ECMqvSha1Kdf;
bool flag;
if (!flag)
{
break;
}
Stream octetStream = this.info.ukm.GetOctetStream();
Asn1Object asn1Object2;
OriginatorPublicKey ephemeralPublicKey = MQVuserKeyingMaterial.GetInstance(asn1Object2).ephemeralPublicKey;
AsymmetricKeyParameter publicKeyFromOriginatorPublicKey = this.GetPublicKeyFromOriginatorPublicKey(receiverPrivateKey, ephemeralPublicKey);
if (publicKeyFromOriginatorPublicKey == 0)
{
}
if (publicKeyFromOriginatorPublicKey != 0)
{
if (senderPublicKey == 0)
{
}
if (senderPublicKey != 0)
{
if (receiverPrivateKey == 0)
{
}
if (receiverPrivateKey != 0 && receiverPrivateKey != 0)
{
break;
}
}
}
}
int num = 0;
int defaultKeySize = GeneratorUtilities.GetDefaultKeySize(wrapAlg);
num += defaultKeySize;
byte[] array;
return ParameterUtilities.CreateKeyParameter(wrapAlg, array);
}
// Token: 0x0600A282 RID: 41602 RVA: 0x0025DA1C File Offset: 0x0025BC1C
[Token(Token = "0x600A282")]
[Address(RVA = "0x660550", Offset = "0x65EF50", VA = "0x180660550")]
private KeyParameter UnwrapSessionKey(string wrapAlg, KeyParameter agreedKey)
{
Stream octetStream = this.encryptedKey.GetOctetStream();
IWrapper wrapper = WrapperUtilities.GetWrapper(wrapAlg);
Stream.ReadWriteTask activeReadWriteTask = octetStream._activeReadWriteTask;
string contentAlgorithmName = base.GetContentAlgorithmName();
KeyParameter keyParameter;
return keyParameter;
}
// Token: 0x0600A283 RID: 41603 RVA: 0x0025DA54 File Offset: 0x0025BC54
[Token(Token = "0x600A283")]
[Address(RVA = "0x65FD60", Offset = "0x65E760", VA = "0x18065FD60")]
internal KeyParameter GetSessionKey(AsymmetricKeyParameter receiverPrivateKey)
{
Asn1SequenceParser parser = Asn1Sequence.GetInstance(this.keyEncAlg.ObjectID).Parser;
DerObjectIdentifier derObjectIdentifier;
string identifier = derObjectIdentifier.identifier;
OriginatorIdentifierOrKey originator = this.info.originator;
OriginatorPublicKey originatorPublicKey = originator.OriginatorPublicKey;
if (originatorPublicKey != 0)
{
AsymmetricKeyParameter publicKeyFromOriginatorPublicKey = this.GetPublicKeyFromOriginatorPublicKey(receiverPrivateKey, originatorPublicKey);
KeyParameter keyParameter = this.CalculateAgreedWrapKey(identifier, publicKeyFromOriginatorPublicKey, receiverPrivateKey);
Stream octetStream = this.encryptedKey.GetOctetStream();
IWrapper wrapper = WrapperUtilities.GetWrapper(identifier);
Stream.ReadWriteTask activeReadWriteTask = octetStream._activeReadWriteTask;
string contentAlgorithmName = base.GetContentAlgorithmName();
KeyParameter keyParameter2;
return keyParameter2;
}
OriginatorID originatorID = new OriginatorID();
IssuerAndSerialNumber issuerAndSerialNumber = originator.IssuerAndSerialNumber;
if (issuerAndSerialNumber == 0)
{
throw new NullReferenceException();
}
throw new NullReferenceException();
}
// Token: 0x0600A284 RID: 41604 RVA: 0x0025DBC0 File Offset: 0x0025BDC0
[Token(Token = "0x600A284")]
[Address(RVA = "0x65F980", Offset = "0x65E380", VA = "0x18065F980", Slot = "4")]
public override CmsTypedStream GetContentStream(ICipherParameters key)
{
/*
An exception occurred when decompiling this method (0600A284)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsTypedStream BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.KeyAgreeRecipientInformation::GetContentStream(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_18:
stloc:ArgumentException(var_3_27, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("KeyAgreement requires asymmetric key"), ldstr:string("key")))
stloc:ArgumentException(var_4_37, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Expected private key"), ldstr:string("key")))
}
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: 0x04006ADE RID: 27358
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006ADE")]
private KeyAgreeRecipientInfo info;
// Token: 0x04006ADF RID: 27359
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006ADF")]
private Asn1OctetString encryptedKey;
}
}
@@ -0,0 +1,120 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200177E RID: 6014
[Token(Token = "0x200177E")]
[StructLayout(3)]
internal class KeyTransRecipientInfoGenerator : RecipientInfoGenerator
{
// Token: 0x0600A285 RID: 41605 RVA: 0x0025DC08 File Offset: 0x0025BE08
[Token(Token = "0x600A285")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
internal KeyTransRecipientInfoGenerator()
{
}
// Token: 0x17001978 RID: 6520
// (set) Token: 0x0600A286 RID: 41606 RVA: 0x0025DC1C File Offset: 0x0025BE1C
[Token(Token = "0x17001978")]
internal X509Certificate RecipientCert
{
[Token(Token = "0x600A286")]
[Address(RVA = "0x6609B0", Offset = "0x65F3B0", VA = "0x1806609B0")]
set
{
TbsCertificateStructure tbsCertificateStructure = CmsUtilities.GetTbsCertificateStructure(value);
this.recipientTbsCert = tbsCertificateStructure;
ICollection collection;
this.recipientPublicKey = collection;
SubjectPublicKeyInfo subjectPublicKeyInfo = this.recipientTbsCert.subjectPublicKeyInfo;
this.info = subjectPublicKeyInfo;
}
}
// Token: 0x17001979 RID: 6521
// (set) Token: 0x0600A287 RID: 41607 RVA: 0x0025DC58 File Offset: 0x0025BE58
[Token(Token = "0x17001979")]
internal AsymmetricKeyParameter RecipientPublicKey
{
[Token(Token = "0x600A287")]
[Address(RVA = "0x660A10", Offset = "0x65F410", VA = "0x180660A10")]
set
{
this.recipientPublicKey = value;
SubjectPublicKeyInfo subjectPublicKeyInfo = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(this.recipientPublicKey);
this.info = subjectPublicKeyInfo;
}
}
// Token: 0x1700197A RID: 6522
// (set) Token: 0x0600A288 RID: 41608 RVA: 0x0025DC8C File Offset: 0x0025BE8C
[Token(Token = "0x1700197A")]
internal Asn1OctetString SubjectKeyIdentifier
{
[Token(Token = "0x600A288")]
[Address(RVA = "0x3C1260", Offset = "0x3BFC60", VA = "0x1803C1260")]
set
{
this.subjectKeyIdentifier = value;
}
}
// Token: 0x0600A289 RID: 41609 RVA: 0x0025DCA0 File Offset: 0x0025BEA0
[Token(Token = "0x600A289")]
[Address(RVA = "0x6606E0", Offset = "0x65F0E0", VA = "0x1806606E0", Slot = "4")]
public RecipientInfo Generate(KeyParameter contentEncryptionKey, SecureRandom random)
{
byte[] key = contentEncryptionKey.GetKey();
AlgorithmIdentifier algID = this.info.algID;
CmsEnvelopedHelper helper = KeyTransRecipientInfoGenerator.Helper;
Asn1Object asn1Object = algID.ToAsn1Object();
ParametersWithRandom parametersWithRandom = new ParametersWithRandom(this.recipientPublicKey, random);
int length = key.Length;
TbsCertificateStructure tbsCertificateStructure = this.recipientTbsCert;
if (tbsCertificateStructure == 0)
{
RecipientIdentifier recipientIdentifier = new RecipientIdentifier(this.subjectKeyIdentifier);
}
X509Name issuer = tbsCertificateStructure.issuer;
BigInteger value = tbsCertificateStructure.serialNumber.Value;
DerOctetString derOctetString;
return new RecipientInfo(new KeyTransRecipientInfo(new RecipientIdentifier(new IssuerAndSerialNumber(issuer, value)), algID, derOctetString));
}
// Token: 0x04006AE0 RID: 27360
[Token(Token = "0x4006AE0")]
private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance;
// Token: 0x04006AE1 RID: 27361
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006AE1")]
private TbsCertificateStructure recipientTbsCert;
// Token: 0x04006AE2 RID: 27362
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006AE2")]
private AsymmetricKeyParameter recipientPublicKey;
// Token: 0x04006AE3 RID: 27363
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006AE3")]
private Asn1OctetString subjectKeyIdentifier;
// Token: 0x04006AE4 RID: 27364
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006AE4")]
private SubjectPublicKeyInfo info;
}
}
@@ -0,0 +1,85 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200177F RID: 6015
[Token(Token = "0x200177F")]
[StructLayout(3)]
public class KeyTransRecipientInformation : RecipientInformation
{
// Token: 0x0600A28B RID: 41611 RVA: 0x0025DD50 File Offset: 0x0025BF50
[Token(Token = "0x600A28B")]
[Address(RVA = "0x660E70", Offset = "0x65F870", VA = "0x180660E70")]
internal KeyTransRecipientInformation(KeyTransRecipientInfo info, CmsSecureReadable secureReadable)
{
AlgorithmIdentifier keyEncryptionAlgorithm = info.keyEncryptionAlgorithm;
base..ctor(keyEncryptionAlgorithm, secureReadable);
this.info = info;
RecipientID recipientID = new RecipientID();
this.rid = recipientID;
RecipientIdentifier rid = info.rid;
if (!rid.IsTagged)
{
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.IssuerAndSerialNumber instance = BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.IssuerAndSerialNumber.GetInstance(rid.ID);
RecipientID rid2 = this.rid;
X509Name name = instance.name;
rid2.issuer = name;
RecipientID rid3 = this.rid;
BigInteger value = instance.serialNumber.Value;
rid3.serialNumber = value;
}
Asn1OctetString instance2 = Asn1OctetString.GetInstance(rid.ID);
RecipientID rid4 = this.rid;
Stream octetStream = instance2.GetOctetStream();
}
// Token: 0x0600A28C RID: 41612 RVA: 0x0025DE28 File Offset: 0x0025C028
[Token(Token = "0x600A28C")]
[Address(RVA = "0x660AE0", Offset = "0x65F4E0", VA = "0x180660AE0")]
private string GetExchangeEncryptionAlgorithmName(DerObjectIdentifier oid)
{
DerObjectIdentifier rsaEncryption = PkcsObjectIdentifiers.RsaEncryption;
return oid.identifier;
}
// Token: 0x0600A28D RID: 41613 RVA: 0x0025DE50 File Offset: 0x0025C050
[Token(Token = "0x600A28D")]
[Address(RVA = "0x660B80", Offset = "0x65F580", VA = "0x180660B80")]
internal KeyParameter UnwrapKey(ICipherParameters key)
{
Stream octetStream = this.info.encryptedKey.GetOctetStream();
Asn1Object asn1Object = this.keyEncAlg.ToAsn1Object();
DerObjectIdentifier rsaEncryption = PkcsObjectIdentifiers.RsaEncryption;
IWrapper wrapper = WrapperUtilities.GetWrapper("RSA//PKCS1Padding");
string contentAlgorithmName = base.GetContentAlgorithmName();
Stream.ReadWriteTask activeReadWriteTask = octetStream._activeReadWriteTask;
KeyParameter keyParameter;
return keyParameter;
}
// Token: 0x0600A28E RID: 41614 RVA: 0x0025DEA4 File Offset: 0x0025C0A4
[Token(Token = "0x600A28E")]
[Address(RVA = "0x660AB0", Offset = "0x65F4B0", VA = "0x180660AB0", Slot = "4")]
public override CmsTypedStream GetContentStream(ICipherParameters key)
{
KeyParameter keyParameter = this.UnwrapKey(key);
return base.GetContentFromSessionKey(keyParameter);
}
// Token: 0x04006AE5 RID: 27365
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006AE5")]
private KeyTransRecipientInfo info;
}
}
@@ -0,0 +1,62 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001780 RID: 6016
[Token(Token = "0x2001780")]
[StructLayout(3)]
public class OriginatorID : X509CertStoreSelector
{
// Token: 0x0600A28F RID: 41615 RVA: 0x0025DEC0 File Offset: 0x0025C0C0
[Token(Token = "0x600A28F")]
[Address(RVA = "0x661130", Offset = "0x65FB30", VA = "0x180661130", Slot = "2")]
public override int GetHashCode()
{
/*
An exception occurred when decompiling this method (0600A28F)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.OriginatorID::GetHashCode()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_1:
callvirt:void(object::Finalize, ldloc:X509Name[exp:object](var_2_23))
}
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: 0x0600A290 RID: 41616 RVA: 0x0025DEFC File Offset: 0x0025C0FC
[Token(Token = "0x600A290")]
[Address(RVA = "0x661010", Offset = "0x65FA10", VA = "0x180661010", Slot = "0")]
public override bool Equals(object obj)
{
byte[] array;
if (obj != this && obj != 0 && obj != 0 && Arrays.AreEqual(base.SubjectKeyIdentifier, array) && object.Equals(this.serialNumber, array))
{
X509Name issuer = this.issuer;
bool flag;
return flag;
}
}
// Token: 0x0600A291 RID: 41617 RVA: 0x0025DF40 File Offset: 0x0025C140
[Token(Token = "0x600A291")]
[Address(RVA = "0x6611E0", Offset = "0x65FBE0", VA = "0x1806611E0")]
public OriginatorID()
{
}
}
}
@@ -0,0 +1,79 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
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;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001781 RID: 6017
[Token(Token = "0x2001781")]
[StructLayout(3)]
public class OriginatorInfoGenerator
{
// Token: 0x0600A292 RID: 41618 RVA: 0x0025DF54 File Offset: 0x0025C154
[Token(Token = "0x600A292")]
[Address(RVA = "0x661280", Offset = "0x65FC80", VA = "0x180661280")]
public OriginatorInfoGenerator(X509Certificate origCert)
{
IList list = Platform.CreateArrayList(1);
this.origCerts = list;
this.origCrls = (ulong)0L;
throw new NullReferenceException();
}
// Token: 0x0600A293 RID: 41619 RVA: 0x0025DF84 File Offset: 0x0025C184
[Token(Token = "0x600A293")]
[Address(RVA = "0x6613B0", Offset = "0x65FDB0", VA = "0x1806613B0")]
public OriginatorInfoGenerator(IX509Store origCerts)
{
IList certificatesFromStore = CmsUtilities.GetCertificatesFromStore(origCerts);
this.origCerts = certificatesFromStore;
this.origCrls = (ulong)0L;
}
// Token: 0x0600A294 RID: 41620 RVA: 0x0025DFB0 File Offset: 0x0025C1B0
[Token(Token = "0x600A294")]
[Address(RVA = "0x661340", Offset = "0x65FD40", VA = "0x180661340")]
public OriginatorInfoGenerator(IX509Store origCerts, IX509Store origCrls)
{
IList certificatesFromStore = CmsUtilities.GetCertificatesFromStore(origCerts);
this.origCerts = certificatesFromStore;
if (origCrls == 0)
{
this.origCrls = origCrls;
return;
}
IList crlsFromStore = CmsUtilities.GetCrlsFromStore(origCrls);
this.origCrls = crlsFromStore;
}
// Token: 0x0600A295 RID: 41621 RVA: 0x0025DFEC File Offset: 0x0025C1EC
[Token(Token = "0x600A295")]
[Address(RVA = "0x6611F0", Offset = "0x65FBF0", VA = "0x1806611F0", Slot = "4")]
public virtual OriginatorInfo Generate()
{
Asn1Set asn1Set = CmsUtilities.CreateDerSetFromList(this.origCerts);
IList list = this.origCrls;
if (list == 0)
{
}
Asn1Set asn1Set2 = CmsUtilities.CreateDerSetFromList(list);
return new OriginatorInfo(asn1Set, asn1Set2);
}
// Token: 0x04006AE6 RID: 27366
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006AE6")]
private readonly IList origCerts;
// Token: 0x04006AE7 RID: 27367
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006AE7")]
private readonly IList origCrls;
}
}
@@ -0,0 +1,140 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001782 RID: 6018
[Token(Token = "0x2001782")]
[StructLayout(3)]
public class OriginatorInformation
{
// Token: 0x0600A296 RID: 41622 RVA: 0x0025E020 File Offset: 0x0025C220
[Token(Token = "0x600A296")]
[Address(RVA = "0x3C3A30", Offset = "0x3C2430", VA = "0x1803C3A30")]
internal OriginatorInformation(OriginatorInfo originatorInfo)
{
this.originatorInfo = originatorInfo;
}
// Token: 0x0600A297 RID: 41623 RVA: 0x0025E03C File Offset: 0x0025C23C
[Token(Token = "0x600A297")]
[Address(RVA = "0x6613F0", Offset = "0x65FDF0", VA = "0x1806613F0", Slot = "4")]
public virtual IX509Store GetCertificates()
{
for (;;)
{
int num = 0;
Asn1Set certs = this.originatorInfo.certs;
if (certs == 0)
{
break;
}
IEnumerator enumerator = certs.GetEnumerator();
if (enumerator != 0)
{
if (num < enumerator)
{
num += num;
num++;
}
ulong num2;
enumerator += num2;
if (enumerator == 0 || enumerator == 0)
{
goto IL_86;
}
X509CertificateStructure x509CertificateStructure;
if (new X509Certificate(x509CertificateStructure) != 0)
{
}
if (num != -1)
{
}
if (num == 0)
{
goto Block_5;
}
}
}
X509CollectionStoreParameters x509CollectionStoreParameters = new X509CollectionStoreParameters(Platform.CreateArrayList());
return X509StoreFactory.Create("Certificate/Collection", x509CollectionStoreParameters);
Block_5:
IList list;
X509CollectionStoreParameters x509CollectionStoreParameters2 = new X509CollectionStoreParameters(list);
throw new NullReferenceException();
IL_86:
throw new NullReferenceException();
}
// Token: 0x0600A298 RID: 41624 RVA: 0x0025E0DC File Offset: 0x0025C2DC
[Token(Token = "0x600A298")]
[Address(RVA = "0x6617A0", Offset = "0x6601A0", VA = "0x1806617A0", Slot = "5")]
public virtual IX509Store GetCrls()
{
for (;;)
{
int num = 0;
Asn1Set certs = this.originatorInfo.certs;
if (certs == 0)
{
break;
}
IEnumerator enumerator = certs.GetEnumerator();
if (enumerator != 0)
{
if (num < enumerator)
{
num += num;
num++;
}
ulong num2;
enumerator += num2;
if (enumerator == 0 || enumerator == 0)
{
goto IL_86;
}
CertificateList certificateList;
if (new X509Crl(certificateList) != 0)
{
}
if (num != -1)
{
}
if (num == 0)
{
goto Block_5;
}
}
}
X509CollectionStoreParameters x509CollectionStoreParameters = new X509CollectionStoreParameters(Platform.CreateArrayList());
return X509StoreFactory.Create("CRL/Collection", x509CollectionStoreParameters);
Block_5:
IList list;
X509CollectionStoreParameters x509CollectionStoreParameters2 = new X509CollectionStoreParameters(list);
throw new NullReferenceException();
IL_86:
throw new NullReferenceException();
}
// Token: 0x0600A299 RID: 41625 RVA: 0x0025E17C File Offset: 0x0025C37C
[Token(Token = "0x600A299")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0", Slot = "6")]
public virtual OriginatorInfo ToAsn1Structure()
{
return this.originatorInfo;
}
// Token: 0x04006AE8 RID: 27368
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006AE8")]
private readonly OriginatorInfo originatorInfo;
}
}
@@ -0,0 +1,117 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001785 RID: 6021
[Token(Token = "0x2001785")]
[StructLayout(3)]
internal class PasswordRecipientInfoGenerator : RecipientInfoGenerator
{
// Token: 0x0600A2A4 RID: 41636 RVA: 0x0025E308 File Offset: 0x0025C508
[Token(Token = "0x600A2A4")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
internal PasswordRecipientInfoGenerator()
{
}
// Token: 0x1700197B RID: 6523
// (set) Token: 0x0600A2A5 RID: 41637 RVA: 0x0025E31C File Offset: 0x0025C51C
[Token(Token = "0x1700197B")]
internal AlgorithmIdentifier KeyDerivationAlgorithm
{
[Token(Token = "0x600A2A5")]
[Address(RVA = "0x3C39B0", Offset = "0x3C23B0", VA = "0x1803C39B0")]
set
{
this.keyDerivationAlgorithm = value;
}
}
// Token: 0x1700197C RID: 6524
// (set) Token: 0x0600A2A6 RID: 41638 RVA: 0x0025E330 File Offset: 0x0025C530
[Token(Token = "0x1700197C")]
internal KeyParameter KeyEncryptionKey
{
[Token(Token = "0x600A2A6")]
[Address(RVA = "0x3C1280", Offset = "0x3BFC80", VA = "0x1803C1280")]
set
{
this.keyEncryptionKey = value;
}
}
// Token: 0x1700197D RID: 6525
// (set) Token: 0x0600A2A7 RID: 41639 RVA: 0x0025E344 File Offset: 0x0025C544
[Token(Token = "0x1700197D")]
internal string KeyEncryptionKeyOID
{
[Token(Token = "0x600A2A7")]
[Address(RVA = "0x3C1260", Offset = "0x3BFC60", VA = "0x1803C1260")]
set
{
this.keyEncryptionKeyOID = value;
}
}
// Token: 0x0600A2A8 RID: 41640 RVA: 0x0025E358 File Offset: 0x0025C558
[Token(Token = "0x600A2A8")]
[Address(RVA = "0x661B50", Offset = "0x660550", VA = "0x180661B50", Slot = "4")]
public RecipientInfo Generate(KeyParameter contentEncryptionKey, SecureRandom random)
{
byte[] key = contentEncryptionKey.GetKey();
CmsEnvelopedHelper helper = PasswordRecipientInfoGenerator.Helper;
string text = this.keyEncryptionKeyOID;
string rfc3211WrapperName = helper.GetRfc3211WrapperName(text);
IWrapper wrapper = PasswordRecipientInfoGenerator.Helper.CreateWrapper(rfc3211WrapperName);
bool flag = Platform.StartsWith(rfc3211WrapperName, "DESEDE");
byte[] array = new byte[8];
double num = random.NextDouble();
ParametersWithRandom parametersWithRandom = new ParametersWithRandom(new ParametersWithIV(this.keyEncryptionKey, array), random);
int length = key.Length;
Asn1Encodable[] array2 = new Asn1Encodable[2];
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(this.keyEncryptionKeyOID);
if (derObjectIdentifier != 0)
{
}
array2[0] = derObjectIdentifier;
DerOctetString derOctetString = new DerOctetString(array);
if (derOctetString != 0)
{
}
array2[1] = derOctetString;
DerSequence derSequence = new DerSequence(array2);
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(PkcsObjectIdentifiers.IdAlgPwriKek, derSequence);
DerOctetString derOctetString2;
return new RecipientInfo(new PasswordRecipientInfo(this.keyDerivationAlgorithm, algorithmIdentifier, derOctetString2));
}
// Token: 0x04006AE9 RID: 27369
[Token(Token = "0x4006AE9")]
private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance;
// Token: 0x04006AEA RID: 27370
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006AEA")]
private AlgorithmIdentifier keyDerivationAlgorithm;
// Token: 0x04006AEB RID: 27371
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006AEB")]
private KeyParameter keyEncryptionKey;
// Token: 0x04006AEC RID: 27372
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006AEC")]
private string keyEncryptionKeyOID;
}
}
@@ -0,0 +1,76 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001786 RID: 6022
[Token(Token = "0x2001786")]
[StructLayout(3)]
public class PasswordRecipientInformation : RecipientInformation
{
// Token: 0x0600A2AA RID: 41642 RVA: 0x0025E450 File Offset: 0x0025C650
[Token(Token = "0x600A2AA")]
[Address(RVA = "0x6623C0", Offset = "0x660DC0", VA = "0x1806623C0")]
internal PasswordRecipientInformation(PasswordRecipientInfo info, CmsSecureReadable secureReadable)
{
AlgorithmIdentifier keyEncryptionAlgorithm = info.keyEncryptionAlgorithm;
base..ctor(keyEncryptionAlgorithm, secureReadable);
this.info = info;
RecipientID recipientID = new RecipientID();
this.rid = recipientID;
}
// Token: 0x1700197E RID: 6526
// (get) Token: 0x0600A2AB RID: 41643 RVA: 0x0025E488 File Offset: 0x0025C688
[Token(Token = "0x1700197E")]
public virtual AlgorithmIdentifier KeyDerivationAlgorithm
{
[Token(Token = "0x600A2AB")]
[Address(RVA = "0x610F90", Offset = "0x60F990", VA = "0x180610F90", Slot = "5")]
get
{
return this.info.keyDerivationAlgorithm;
}
}
// Token: 0x0600A2AC RID: 41644 RVA: 0x0025E4A8 File Offset: 0x0025C6A8
[Token(Token = "0x600A2AC")]
[Address(RVA = "0x661F90", Offset = "0x660990", VA = "0x180661F90", Slot = "4")]
public override CmsTypedStream GetContentStream(ICipherParameters key)
{
DerObjectIdentifier objectID = AlgorithmIdentifier.GetInstance(this.info.keyEncryptionAlgorithm).ObjectID;
Stream octetStream = this.info.encryptedKey.GetOctetStream();
if (objectID == 0)
{
throw new NullReferenceException();
}
DerObjectIdentifier derObjectIdentifier;
string identifier = derObjectIdentifier.identifier;
CmsEnvelopedHelper instance = CmsEnvelopedHelper.Instance;
IWrapper wrapper = WrapperUtilities.GetWrapper(instance.GetRfc3211WrapperName(identifier));
Asn1OctetString asn1OctetString;
Stream octetStream2 = asn1OctetString.GetOctetStream();
if (key != 0 && key != 0)
{
string contentAlgorithmName = base.GetContentAlgorithmName();
AlgorithmIdentifier keyEncAlg = this.keyEncAlg;
KeyParameter keyParameter;
return base.GetContentFromSessionKey(keyParameter);
}
throw new NullReferenceException();
}
// Token: 0x04006AED RID: 27373
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006AED")]
private readonly PasswordRecipientInfo info;
}
}
@@ -0,0 +1,72 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001783 RID: 6019
[Token(Token = "0x2001783")]
[StructLayout(3)]
public class Pkcs5Scheme2PbeKey : CmsPbeKey
{
// Token: 0x0600A29A RID: 41626 RVA: 0x0025E190 File Offset: 0x0025C390
[Token(Token = "0x600A29A")]
[Address(RVA = "0x6625A0", Offset = "0x660FA0", VA = "0x1806625A0")]
[Obsolete]
public Pkcs5Scheme2PbeKey(string password, byte[] salt, int iterationCount)
{
char[] array = password.ToCharArray();
base..ctor(array, salt, iterationCount);
}
// Token: 0x0600A29B RID: 41627 RVA: 0x0025E1B4 File Offset: 0x0025C3B4
[Token(Token = "0x600A29B")]
[Address(RVA = "0x662620", Offset = "0x661020", VA = "0x180662620")]
[Obsolete]
public Pkcs5Scheme2PbeKey(string password, AlgorithmIdentifier keyDerivationAlgorithm)
{
char[] array = password.ToCharArray();
base..ctor(array, keyDerivationAlgorithm);
}
// Token: 0x0600A29C RID: 41628 RVA: 0x0025E1D8 File Offset: 0x0025C3D8
[Token(Token = "0x600A29C")]
[Address(RVA = "0x662600", Offset = "0x661000", VA = "0x180662600")]
public Pkcs5Scheme2PbeKey(char[] password, byte[] salt, int iterationCount)
: base(password, salt, iterationCount)
{
}
// Token: 0x0600A29D RID: 41629 RVA: 0x0025E1F0 File Offset: 0x0025C3F0
[Token(Token = "0x600A29D")]
[Address(RVA = "0x662610", Offset = "0x661010", VA = "0x180662610")]
public Pkcs5Scheme2PbeKey(char[] password, AlgorithmIdentifier keyDerivationAlgorithm)
: base(password, keyDerivationAlgorithm)
{
}
// Token: 0x0600A29E RID: 41630 RVA: 0x0025E208 File Offset: 0x0025C408
[Token(Token = "0x600A29E")]
[Address(RVA = "0x662450", Offset = "0x660E50", VA = "0x180662450", Slot = "4")]
internal override KeyParameter GetEncoded(string algorithmOid)
{
ICipherParameters cipherParameters;
do
{
Pkcs5S2ParametersGenerator pkcs5S2ParametersGenerator = new Pkcs5S2ParametersGenerator();
byte[] array = PbeParametersGenerator.Pkcs5PasswordToBytes(this.password);
string text = pkcs5S2ParametersGenerator.ToString();
int keySize = CmsEnvelopedHelper.Instance.GetKeySize(algorithmOid);
if (cipherParameters == 0)
{
}
}
while (cipherParameters == 0);
throw new NullReferenceException();
}
}
}
@@ -0,0 +1,72 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001784 RID: 6020
[Token(Token = "0x2001784")]
[StructLayout(3)]
public class Pkcs5Scheme2Utf8PbeKey : CmsPbeKey
{
// Token: 0x0600A29F RID: 41631 RVA: 0x0025E24C File Offset: 0x0025C44C
[Token(Token = "0x600A29F")]
[Address(RVA = "0x6625A0", Offset = "0x660FA0", VA = "0x1806625A0")]
[Obsolete]
public Pkcs5Scheme2Utf8PbeKey(string password, byte[] salt, int iterationCount)
{
char[] array = password.ToCharArray();
base..ctor(array, salt, iterationCount);
}
// Token: 0x0600A2A0 RID: 41632 RVA: 0x0025E270 File Offset: 0x0025C470
[Token(Token = "0x600A2A0")]
[Address(RVA = "0x662620", Offset = "0x661020", VA = "0x180662620")]
[Obsolete]
public Pkcs5Scheme2Utf8PbeKey(string password, AlgorithmIdentifier keyDerivationAlgorithm)
{
char[] array = password.ToCharArray();
base..ctor(array, keyDerivationAlgorithm);
}
// Token: 0x0600A2A1 RID: 41633 RVA: 0x0025E294 File Offset: 0x0025C494
[Token(Token = "0x600A2A1")]
[Address(RVA = "0x662600", Offset = "0x661000", VA = "0x180662600")]
public Pkcs5Scheme2Utf8PbeKey(char[] password, byte[] salt, int iterationCount)
: base(password, salt, iterationCount)
{
}
// Token: 0x0600A2A2 RID: 41634 RVA: 0x0025E2AC File Offset: 0x0025C4AC
[Token(Token = "0x600A2A2")]
[Address(RVA = "0x662610", Offset = "0x661010", VA = "0x180662610")]
public Pkcs5Scheme2Utf8PbeKey(char[] password, AlgorithmIdentifier keyDerivationAlgorithm)
: base(password, keyDerivationAlgorithm)
{
}
// Token: 0x0600A2A3 RID: 41635 RVA: 0x0025E2C4 File Offset: 0x0025C4C4
[Token(Token = "0x600A2A3")]
[Address(RVA = "0x662670", Offset = "0x661070", VA = "0x180662670", Slot = "4")]
internal override KeyParameter GetEncoded(string algorithmOid)
{
ICipherParameters cipherParameters;
do
{
Pkcs5S2ParametersGenerator pkcs5S2ParametersGenerator = new Pkcs5S2ParametersGenerator();
byte[] array = PbeParametersGenerator.Pkcs5PasswordToUtf8Bytes(this.password);
string text = pkcs5S2ParametersGenerator.ToString();
int keySize = CmsEnvelopedHelper.Instance.GetKeySize(algorithmOid);
if (cipherParameters == 0)
{
}
}
while (cipherParameters == 0);
throw new NullReferenceException();
}
}
}
@@ -0,0 +1,93 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001787 RID: 6023
[Token(Token = "0x2001787")]
[StructLayout(3)]
public class RecipientID : X509CertStoreSelector
{
// Token: 0x1700197F RID: 6527
// (get) Token: 0x0600A2AD RID: 41645 RVA: 0x0025E58C File Offset: 0x0025C78C
// (set) Token: 0x0600A2AE RID: 41646 RVA: 0x0025E5A4 File Offset: 0x0025C7A4
[Token(Token = "0x1700197F")]
public byte[] KeyIdentifier
{
[Token(Token = "0x600A2AD")]
[Address(RVA = "0x662A00", Offset = "0x661400", VA = "0x180662A00")]
get
{
return Arrays.Clone(this.keyIdentifier);
}
[Token(Token = "0x600A2AE")]
[Address(RVA = "0x662A60", Offset = "0x661460", VA = "0x180662A60")]
set
{
byte[] array = Arrays.Clone(value);
this.keyIdentifier = array;
}
}
// Token: 0x0600A2AF RID: 41647 RVA: 0x0025E5C0 File Offset: 0x0025C7C0
[Token(Token = "0x600A2AF")]
[Address(RVA = "0x662930", Offset = "0x661330", VA = "0x180662930", Slot = "2")]
public override int GetHashCode()
{
int hashCode = Arrays.GetHashCode(this.keyIdentifier);
int hashCode2 = Arrays.GetHashCode(base.SubjectKeyIdentifier);
BigInteger serialNumber = this.serialNumber;
if (serialNumber != 0)
{
serialNumber.Finalize();
}
X509Name issuer = this.issuer;
if (issuer != 0)
{
issuer.Finalize();
return hashCode2;
}
return hashCode2;
}
// Token: 0x0600A2B0 RID: 41648 RVA: 0x0025E60C File Offset: 0x0025C80C
[Token(Token = "0x600A2B0")]
[Address(RVA = "0x6627C0", Offset = "0x6611C0", VA = "0x1806627C0", Slot = "0")]
public override bool Equals(object obj)
{
if (obj != this)
{
if (obj != 0 && obj != 0)
{
byte[] array = this.keyIdentifier;
bool flag;
byte[] array2;
if (flag && Arrays.AreEqual(base.SubjectKeyIdentifier, array2) && object.Equals(this.serialNumber, array2))
{
X509Name issuer = this.issuer;
bool flag2;
return flag2;
}
}
}
return true;
}
// Token: 0x0600A2B1 RID: 41649 RVA: 0x0025E660 File Offset: 0x0025C860
[Token(Token = "0x600A2B1")]
[Address(RVA = "0x6611E0", Offset = "0x65FBE0", VA = "0x1806611E0")]
public RecipientID()
{
}
// Token: 0x04006AEE RID: 27374
[global::Cpp2IlInjected.FieldOffset(Offset = "0x88")]
[Token(Token = "0x4006AEE")]
private byte[] keyIdentifier;
}
}
@@ -0,0 +1,20 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001788 RID: 6024
[Token(Token = "0x2001788")]
[StructLayout(3)]
internal interface RecipientInfoGenerator
{
// Token: 0x0600A2B2 RID: 41650
[Token(Token = "0x600A2B2")]
[Address(Slot = "0")]
RecipientInfo Generate(KeyParameter contentEncryptionKey, SecureRandom random);
}
}
@@ -0,0 +1,164 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001789 RID: 6025
[Token(Token = "0x2001789")]
[StructLayout(3)]
public abstract class RecipientInformation
{
// Token: 0x0600A2B3 RID: 41651 RVA: 0x0025E674 File Offset: 0x0025C874
[Token(Token = "0x600A2B3")]
[Address(RVA = "0x6634D0", Offset = "0x661ED0", VA = "0x1806634D0")]
internal RecipientInformation(AlgorithmIdentifier keyEncAlg, CmsSecureReadable secureReadable)
{
RecipientID recipientID = new RecipientID();
this.rid = recipientID;
base..ctor();
this.keyEncAlg = keyEncAlg;
this.secureReadable = secureReadable;
}
// Token: 0x0600A2B4 RID: 41652 RVA: 0x0025E6A4 File Offset: 0x0025C8A4
[Token(Token = "0x600A2B4")]
[Address(RVA = "0x663060", Offset = "0x661A60", VA = "0x180663060")]
internal string GetContentAlgorithmName()
{
CmsSecureReadable cmsSecureReadable = this.secureReadable;
int num = 0;
num += num;
num++;
throw new NullReferenceException();
}
// Token: 0x17001980 RID: 6528
// (get) Token: 0x0600A2B5 RID: 41653 RVA: 0x0025E6CC File Offset: 0x0025C8CC
[Token(Token = "0x17001980")]
public RecipientID RecipientID
{
[Token(Token = "0x600A2B5")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0")]
get
{
return this.rid;
}
}
// Token: 0x17001981 RID: 6529
// (get) Token: 0x0600A2B6 RID: 41654 RVA: 0x0025E6E0 File Offset: 0x0025C8E0
[Token(Token = "0x17001981")]
public AlgorithmIdentifier KeyEncryptionAlgorithmID
{
[Token(Token = "0x600A2B6")]
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240")]
get
{
return this.keyEncAlg;
}
}
// Token: 0x17001982 RID: 6530
// (get) Token: 0x0600A2B7 RID: 41655 RVA: 0x0025E6F4 File Offset: 0x0025C8F4
[Token(Token = "0x17001982")]
public string KeyEncryptionAlgOid
{
[Token(Token = "0x600A2B7")]
[Address(RVA = "0x663550", Offset = "0x661F50", VA = "0x180663550")]
get
{
Asn1Object asn1Object = this.keyEncAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001983 RID: 6531
// (get) Token: 0x0600A2B8 RID: 41656 RVA: 0x0025E714 File Offset: 0x0025C914
[Token(Token = "0x17001983")]
public Asn1Object KeyEncryptionAlgParams
{
[Token(Token = "0x600A2B8")]
[Address(RVA = "0x663590", Offset = "0x661F90", VA = "0x180663590")]
get
{
DerObjectIdentifier objectID = this.keyEncAlg.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600A2B9 RID: 41657 RVA: 0x0025E740 File Offset: 0x0025C940
[Token(Token = "0x600A2B9")]
[Address(RVA = "0x663130", Offset = "0x661B30", VA = "0x180663130")]
internal CmsTypedStream GetContentFromSessionKey(KeyParameter sKey)
{
CmsSecureReadable cmsSecureReadable = this.secureReadable;
int num = 0;
num += num;
num++;
if (num < sKey)
{
num += num;
num++;
}
return new CmsTypedStream(num);
}
// Token: 0x0600A2BA RID: 41658 RVA: 0x0025E798 File Offset: 0x0025C998
[Token(Token = "0x600A2BA")]
[Address(RVA = "0x6632F0", Offset = "0x661CF0", VA = "0x1806632F0")]
public byte[] GetContent(ICipherParameters key)
{
string text = this.ToString();
byte[] array;
return array;
}
// Token: 0x0600A2BB RID: 41659 RVA: 0x0025E7C8 File Offset: 0x0025C9C8
[Token(Token = "0x600A2BB")]
[Address(RVA = "0x6633C0", Offset = "0x661DC0", VA = "0x1806633C0")]
public byte[] GetMac()
{
if (this.resultMac == (ulong)0L)
{
CmsSecureReadable cmsSecureReadable = this.secureReadable;
byte[] array;
this.resultMac = array;
}
return Arrays.Clone(this.resultMac);
}
// Token: 0x0600A2BC RID: 41660
[Token(Token = "0x600A2BC")]
[Address(Slot = "4")]
public abstract CmsTypedStream GetContentStream(ICipherParameters key);
// Token: 0x04006AEF RID: 27375
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006AEF")]
internal RecipientID rid;
// Token: 0x04006AF0 RID: 27376
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006AF0")]
internal AlgorithmIdentifier keyEncAlg;
// Token: 0x04006AF1 RID: 27377
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006AF1")]
internal CmsSecureReadable secureReadable;
// Token: 0x04006AF2 RID: 27378
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006AF2")]
private byte[] resultMac;
}
}
@@ -0,0 +1,151 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200178A RID: 6026
[Token(Token = "0x200178A")]
[StructLayout(3)]
public class RecipientInformationStore
{
// Token: 0x0600A2BD RID: 41661 RVA: 0x0025E800 File Offset: 0x0025CA00
[Token(Token = "0x600A2BD")]
[Address(RVA = "0x662D10", Offset = "0x661710", VA = "0x180662D10")]
public RecipientInformationStore(ICollection recipientInfos)
{
int num2;
do
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
base..ctor();
IList list;
if (dictionary != 0)
{
int num = 0;
if (dictionary == 0)
{
goto IL_74;
}
IDictionary dictionary2 = this.table;
if (num != 0 && num == 0)
{
goto IL_62;
}
IDictionary dictionary3 = this.table;
list = Platform.CreateArrayList(1);
num2 = 0;
}
if (list != 0)
{
}
if (num2 != -1)
{
}
}
while (num2 != 0);
IList list2;
this.all = list2;
return;
IL_62:
throw new NullReferenceException();
IL_74:
throw new NullReferenceException();
}
// Token: 0x17001984 RID: 6532
[Token(Token = "0x17001984")]
public RecipientInformation this[RecipientID selector]
{
[Token(Token = "0x600A2BE")]
[Address(RVA = "0x662AD0", Offset = "0x6614D0", VA = "0x180662AD0")]
get
{
IDictionary dictionary;
do
{
dictionary = this.table;
}
while (dictionary == 0);
throw new NullReferenceException();
}
}
// Token: 0x0600A2BF RID: 41663 RVA: 0x0025E8B0 File Offset: 0x0025CAB0
[Token(Token = "0x600A2BF")]
[Address(RVA = "0x662AD0", Offset = "0x6614D0", VA = "0x180662AD0")]
public RecipientInformation GetFirstRecipient(RecipientID selector)
{
IDictionary dictionary;
do
{
dictionary = this.table;
}
while (dictionary == 0);
throw new NullReferenceException();
}
// Token: 0x17001985 RID: 6533
// (get) Token: 0x0600A2C0 RID: 41664 RVA: 0x0025E8D4 File Offset: 0x0025CAD4
[Token(Token = "0x17001985")]
public int Count
{
[Token(Token = "0x600A2C0")]
[Address(RVA = "0x663010", Offset = "0x661A10", VA = "0x180663010")]
get
{
IList list = this.all;
throw new NullReferenceException();
}
}
// Token: 0x0600A2C1 RID: 41665 RVA: 0x0025E8F0 File Offset: 0x0025CAF0
[Token(Token = "0x600A2C1")]
[Address(RVA = "0x662CB0", Offset = "0x6616B0", VA = "0x180662CB0")]
public ICollection GetRecipients()
{
/*
An exception occurred when decompiling this method (0600A2C1)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Collections.ICollection BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.RecipientInformationStore::GetRecipients()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:IList(var_0_0B, call:IList(Platform::CreateArrayList, ldfld:IList[exp:ICollection](RecipientInformationStore::all, ldloc:RecipientInformationStore(this))))
}
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: 0x0600A2C2 RID: 41666 RVA: 0x0025E908 File Offset: 0x0025CB08
[Token(Token = "0x600A2C2")]
[Address(RVA = "0x662BC0", Offset = "0x6615C0", VA = "0x180662BC0")]
public ICollection GetRecipients(RecipientID selector)
{
IDictionary dictionary = this.table;
IList list = Platform.CreateArrayList();
throw new NullReferenceException();
}
// Token: 0x04006AF3 RID: 27379
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006AF3")]
private readonly IList all;
// Token: 0x04006AF4 RID: 27380
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006AF4")]
private readonly IDictionary table;
}
}
@@ -0,0 +1,62 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200178B RID: 6027
[Token(Token = "0x200178B")]
[StructLayout(3)]
public class SignerID : X509CertStoreSelector
{
// Token: 0x0600A2C3 RID: 41667 RVA: 0x0025E92C File Offset: 0x0025CB2C
[Token(Token = "0x600A2C3")]
[Address(RVA = "0x6652B0", Offset = "0x663CB0", VA = "0x1806652B0", Slot = "2")]
public override int GetHashCode()
{
/*
An exception occurred when decompiling this method (0600A2C3)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerID::GetHashCode()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_1:
callvirt:void(object::Finalize, ldloc:X509Name[exp:object](var_2_23))
}
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: 0x0600A2C4 RID: 41668 RVA: 0x0025E968 File Offset: 0x0025CB68
[Token(Token = "0x600A2C4")]
[Address(RVA = "0x665190", Offset = "0x663B90", VA = "0x180665190", Slot = "0")]
public override bool Equals(object obj)
{
byte[] array;
if (obj != this && obj != 0 && obj != 0 && Arrays.AreEqual(base.SubjectKeyIdentifier, array) && object.Equals(this.serialNumber, array))
{
X509Name issuer = this.issuer;
bool flag;
return flag;
}
}
// Token: 0x0600A2C5 RID: 41669 RVA: 0x0025E9AC File Offset: 0x0025CBAC
[Token(Token = "0x600A2C5")]
[Address(RVA = "0x6611E0", Offset = "0x65FBE0", VA = "0x1806611E0")]
public SignerID()
{
}
}
}
@@ -0,0 +1,92 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200178D RID: 6029
[Token(Token = "0x200178D")]
[StructLayout(3)]
public class SignerInfoGenerator
{
// Token: 0x0600A2C7 RID: 41671 RVA: 0x0025E9C0 File Offset: 0x0025CBC0
[Token(Token = "0x600A2C7")]
[Address(RVA = "0x6657C0", Offset = "0x6641C0", VA = "0x1806657C0")]
internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory signerFactory)
{
}
// Token: 0x0600A2C8 RID: 41672 RVA: 0x0025E9D0 File Offset: 0x0025CBD0
[Token(Token = "0x600A2C8")]
[Address(RVA = "0x665680", Offset = "0x664080", VA = "0x180665680")]
internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory signerFactory, bool isDirectSignature)
{
this.sigId = sigId;
this.contentSigner = signerFactory;
this.isDirectSignature = isDirectSignature;
if (!isDirectSignature)
{
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
IDictionary dictionary = Platform.CreateHashtable();
defaultSignedAttributeTableGenerator.table = dictionary;
}
int num = 0;
this.signedGen = num;
this.unsignedGen = (ulong)0L;
}
// Token: 0x0600A2C9 RID: 41673 RVA: 0x0025EA24 File Offset: 0x0025CC24
[Token(Token = "0x600A2C9")]
[Address(RVA = "0x665760", Offset = "0x664160", VA = "0x180665760")]
internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory contentSigner, CmsAttributeTableGenerator signedGen, CmsAttributeTableGenerator unsignedGen)
{
this.sigId = sigId;
this.signedGen = signedGen;
this.unsignedGen = 0;
this.contentSigner = contentSigner;
}
// Token: 0x0600A2CA RID: 41674 RVA: 0x0025EA54 File Offset: 0x0025CC54
[Token(Token = "0x600A2CA")]
[Address(RVA = "0x3C39B0", Offset = "0x3C23B0", VA = "0x1803C39B0")]
internal void setAssociatedCertificate(X509Certificate certificate)
{
this.certificate = certificate;
}
// Token: 0x04006AF5 RID: 27381
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006AF5")]
internal X509Certificate certificate;
// Token: 0x04006AF6 RID: 27382
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006AF6")]
internal ISignatureFactory contentSigner;
// Token: 0x04006AF7 RID: 27383
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006AF7")]
internal SignerIdentifier sigId;
// Token: 0x04006AF8 RID: 27384
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006AF8")]
internal CmsAttributeTableGenerator signedGen;
// Token: 0x04006AF9 RID: 27385
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006AF9")]
internal CmsAttributeTableGenerator unsignedGen;
// Token: 0x04006AFA RID: 27386
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006AFA")]
private bool isDirectSignature;
}
}
@@ -0,0 +1,120 @@
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;
}
}
@@ -0,0 +1,740 @@
using System;
using System.Collections;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x0200178F RID: 6031
[Token(Token = "0x200178F")]
[StructLayout(3)]
public class SignerInformation
{
// Token: 0x0600A2D2 RID: 41682 RVA: 0x0025EBD4 File Offset: 0x0025CDD4
[Token(Token = "0x600A2D2")]
[Address(RVA = "0x668840", Offset = "0x667240", VA = "0x180668840")]
internal SignerInformation(SignerInfo info, DerObjectIdentifier contentType, CmsProcessable content, IDigestCalculator digestCalculator)
{
this.info = info;
SignerID signerID = new SignerID();
this.sid = signerID;
this.contentType = contentType;
bool flag = contentType == 0;
this.isCounterSignature = flag;
SignerIdentifier signerIdentifier = info.sid;
if (!signerIdentifier.IsTagged)
{
IssuerAndSerialNumber instance = IssuerAndSerialNumber.GetInstance(signerIdentifier.ID);
SignerID signerID2 = this.sid;
X509Name name = instance.name;
signerID2.issuer = name;
SignerID signerID3 = this.sid;
BigInteger value = instance.serialNumber.Value;
signerID3.serialNumber = value;
}
Asn1OctetString instance2 = Asn1OctetString.GetInstance(signerIdentifier.ID);
SignerID signerID4 = this.sid;
byte[] encoded = instance2.GetEncoded();
signerID4.SubjectKeyIdentifier = encoded;
AlgorithmIdentifier digAlgorithm = info.digAlgorithm;
this.digestAlgorithm = digAlgorithm;
Asn1Set authenticatedAttributes = info.authenticatedAttributes;
this.signedAttributeSet = authenticatedAttributes;
Asn1Set unauthenticatedAttributes = info.unauthenticatedAttributes;
this.unsignedAttributeSet = unauthenticatedAttributes;
AlgorithmIdentifier digEncryptionAlgorithm = info.digEncryptionAlgorithm;
this.encryptionAlgorithm = digEncryptionAlgorithm;
Stream octetStream = info.encryptedDigest.GetOctetStream();
this.signature = octetStream;
this.content = content;
this.digestCalculator = octetStream;
}
// Token: 0x0600A2D3 RID: 41683 RVA: 0x0025ED30 File Offset: 0x0025CF30
[Token(Token = "0x600A2D3")]
[Address(RVA = "0x668780", Offset = "0x667180", VA = "0x180668780")]
protected SignerInformation(SignerInformation baseInfo)
{
SignerInfo signerInfo = baseInfo.info;
this.info = signerInfo;
DerObjectIdentifier derObjectIdentifier = baseInfo.contentType;
this.contentType = derObjectIdentifier;
bool flag = baseInfo.isCounterSignature;
this.isCounterSignature = flag;
SignerID signerID = baseInfo.sid;
this.sid = signerID;
AlgorithmIdentifier digAlgorithm = signerInfo.digAlgorithm;
this.digestAlgorithm = digAlgorithm;
Asn1Set authenticatedAttributes = signerInfo.authenticatedAttributes;
this.signedAttributeSet = authenticatedAttributes;
Asn1Set unauthenticatedAttributes = signerInfo.unauthenticatedAttributes;
this.unsignedAttributeSet = unauthenticatedAttributes;
AlgorithmIdentifier digEncryptionAlgorithm = signerInfo.digEncryptionAlgorithm;
this.encryptionAlgorithm = digEncryptionAlgorithm;
Stream octetStream = signerInfo.encryptedDigest.GetOctetStream();
this.signature = octetStream;
CmsProcessable cmsProcessable = baseInfo.content;
this.content = cmsProcessable;
byte[] array = baseInfo.resultDigest;
this.resultDigest = array;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = baseInfo.signedAttributeTable;
this.signedAttributeTable = attributeTable;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable2 = baseInfo.unsignedAttributeTable;
this.unsignedAttributeTable = attributeTable2;
}
// Token: 0x17001986 RID: 6534
// (get) Token: 0x0600A2D4 RID: 41684 RVA: 0x0025EE18 File Offset: 0x0025D018
[Token(Token = "0x17001986")]
public bool IsCounterSignature
{
[Token(Token = "0x600A2D4")]
[Address(RVA = "0x668B70", Offset = "0x667570", VA = "0x180668B70")]
get
{
return this.isCounterSignature;
}
}
// Token: 0x17001987 RID: 6535
// (get) Token: 0x0600A2D5 RID: 41685 RVA: 0x0025EE2C File Offset: 0x0025D02C
[Token(Token = "0x17001987")]
public DerObjectIdentifier ContentType
{
[Token(Token = "0x600A2D5")]
[Address(RVA = "0x462740", Offset = "0x461140", VA = "0x180462740")]
get
{
return this.contentType;
}
}
// Token: 0x17001988 RID: 6536
// (get) Token: 0x0600A2D6 RID: 41686 RVA: 0x0025EE40 File Offset: 0x0025D040
[Token(Token = "0x17001988")]
public SignerID SignerID
{
[Token(Token = "0x600A2D6")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0")]
get
{
return this.sid;
}
}
// Token: 0x17001989 RID: 6537
// (get) Token: 0x0600A2D7 RID: 41687 RVA: 0x0025EE54 File Offset: 0x0025D054
[Token(Token = "0x17001989")]
public int Version
{
[Token(Token = "0x600A2D7")]
[Address(RVA = "0x668C80", Offset = "0x667680", VA = "0x180668C80")]
get
{
return this.info.version.Value.IntValue;
}
}
// Token: 0x1700198A RID: 6538
// (get) Token: 0x0600A2D8 RID: 41688 RVA: 0x0025EE7C File Offset: 0x0025D07C
[Token(Token = "0x1700198A")]
public AlgorithmIdentifier DigestAlgorithmID
{
[Token(Token = "0x600A2D8")]
[Address(RVA = "0x3C1220", Offset = "0x3BFC20", VA = "0x1803C1220")]
get
{
return this.digestAlgorithm;
}
}
// Token: 0x1700198B RID: 6539
// (get) Token: 0x0600A2D9 RID: 41689 RVA: 0x0025EE90 File Offset: 0x0025D090
[Token(Token = "0x1700198B")]
public string DigestAlgOid
{
[Token(Token = "0x600A2D9")]
[Address(RVA = "0x668A50", Offset = "0x667450", VA = "0x180668A50")]
get
{
Asn1Object asn1Object = this.digestAlgorithm.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x1700198C RID: 6540
// (get) Token: 0x0600A2DA RID: 41690 RVA: 0x0025EEB0 File Offset: 0x0025D0B0
[Token(Token = "0x1700198C")]
public Asn1Object DigestAlgParams
{
[Token(Token = "0x600A2DA")]
[Address(RVA = "0x668A90", Offset = "0x667490", VA = "0x180668A90")]
get
{
DerObjectIdentifier objectID = this.digestAlgorithm.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600A2DB RID: 41691 RVA: 0x0025EEDC File Offset: 0x0025D0DC
[Token(Token = "0x600A2DB")]
[Address(RVA = "0x667400", Offset = "0x665E00", VA = "0x180667400")]
public byte[] GetContentDigest()
{
/*
An exception occurred when decompiling this method (0600A2DB)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::GetContentDigest()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_09:
stloc:InvalidOperationException(var_0_13, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("method can only be called after verify.")))
}
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: 0x1700198D RID: 6541
// (get) Token: 0x0600A2DC RID: 41692 RVA: 0x0025EEFC File Offset: 0x0025D0FC
[Token(Token = "0x1700198D")]
public AlgorithmIdentifier EncryptionAlgorithmID
{
[Token(Token = "0x600A2DC")]
[Address(RVA = "0x3C1230", Offset = "0x3BFC30", VA = "0x1803C1230")]
get
{
return this.encryptionAlgorithm;
}
}
// Token: 0x1700198E RID: 6542
// (get) Token: 0x0600A2DD RID: 41693 RVA: 0x0025EF10 File Offset: 0x0025D110
[Token(Token = "0x1700198E")]
public string EncryptionAlgOid
{
[Token(Token = "0x600A2DD")]
[Address(RVA = "0x668AE0", Offset = "0x6674E0", VA = "0x180668AE0")]
get
{
Asn1Object asn1Object = this.encryptionAlgorithm.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x1700198F RID: 6543
// (get) Token: 0x0600A2DE RID: 41694 RVA: 0x0025EF30 File Offset: 0x0025D130
[Token(Token = "0x1700198F")]
public Asn1Object EncryptionAlgParams
{
[Token(Token = "0x600A2DE")]
[Address(RVA = "0x668B20", Offset = "0x667520", VA = "0x180668B20")]
get
{
DerObjectIdentifier objectID = this.encryptionAlgorithm.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x17001990 RID: 6544
// (get) Token: 0x0600A2DF RID: 41695 RVA: 0x0025EF5C File Offset: 0x0025D15C
[Token(Token = "0x17001990")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable SignedAttributes
{
[Token(Token = "0x600A2DF")]
[Address(RVA = "0x668B80", Offset = "0x667580", VA = "0x180668B80")]
get
{
Asn1Set asn1Set = this.signedAttributeSet;
if (asn1Set != 0 && this.signedAttributeTable == (ulong)0L)
{
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(asn1Set);
this.signedAttributeTable = attributeTable;
return attributeTable;
}
return this.signedAttributeTable;
}
}
// Token: 0x17001991 RID: 6545
// (get) Token: 0x0600A2E0 RID: 41696 RVA: 0x0025EF98 File Offset: 0x0025D198
[Token(Token = "0x17001991")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable UnsignedAttributes
{
[Token(Token = "0x600A2E0")]
[Address(RVA = "0x668C00", Offset = "0x667600", VA = "0x180668C00")]
get
{
Asn1Set asn1Set = this.unsignedAttributeSet;
if (asn1Set != 0 && this.unsignedAttributeTable == (ulong)0L)
{
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(asn1Set);
this.unsignedAttributeTable = attributeTable;
return attributeTable;
}
return this.unsignedAttributeTable;
}
}
// Token: 0x0600A2E1 RID: 41697 RVA: 0x0025EFD4 File Offset: 0x0025D1D4
[Token(Token = "0x600A2E1")]
[Address(RVA = "0x667A90", Offset = "0x666490", VA = "0x180667A90")]
public byte[] GetSignature()
{
byte[] array = this.signature;
throw new NullReferenceException();
}
// Token: 0x0600A2E2 RID: 41698 RVA: 0x0025EFF0 File Offset: 0x0025D1F0
[Token(Token = "0x600A2E2")]
[Address(RVA = "0x6674B0", Offset = "0x665EB0", VA = "0x1806674B0")]
public SignerInformationStore GetCounterSignatures()
{
IList list;
SignerInfo signerInfo;
do
{
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributes = this.UnsignedAttributes;
if (unsignedAttributes == 0)
{
goto IL_BA;
}
list = Platform.CreateArrayList();
DerObjectIdentifier counterSignature = CmsAttributes.CounterSignature;
IEnumerator enumerator = unsignedAttributes.GetAll(counterSignature).GetEnumerator();
if (enumerator != 0)
{
if (enumerator == 0 || enumerator == 0)
{
goto IL_F6;
}
CmsSignedHelper instance = CmsSignedHelper.Instance;
Asn1Object asn1Object = signerInfo.digAlgorithm.ToAsn1Object();
byte[] array = this.GetSignature();
CounterSignatureDigestCalculator counterSignatureDigestCalculator;
string text;
counterSignatureDigestCalculator.alg = text;
counterSignatureDigestCalculator.data = array;
int num;
int num2;
SignerInformation signerInformation = new SignerInformation(signerInfo, num, num2, counterSignatureDigestCalculator);
num2 = 0;
num = 0;
if ((uint)(-1) != 0U)
{
}
if ((ulong)((uint)(-1)) != (ulong)(-1L))
{
}
if (signerInfo != 0)
{
goto IL_F0;
}
}
if ((uint)(-1) != 0U)
{
}
if ((ulong)((uint)(-1)) != (ulong)(-1L))
{
}
}
while (signerInfo != 0);
SignerInformationStore signerInformationStore = new SignerInformationStore(list);
IL_BA:
return new SignerInformationStore(Platform.CreateArrayList(0));
IL_F0:
throw new NullReferenceException();
IL_F6:
throw new NullReferenceException();
}
// Token: 0x0600A2E3 RID: 41699 RVA: 0x0025F100 File Offset: 0x0025D300
[Token(Token = "0x600A2E3")]
[Address(RVA = "0x667A40", Offset = "0x666440", VA = "0x180667A40")]
public byte[] GetEncodedSignedAttributes()
{
Asn1Set asn1Set = this.signedAttributeSet;
if (asn1Set == 0)
{
}
return asn1Set.GetEncoded("DER");
}
// Token: 0x0600A2E4 RID: 41700 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600A2E4")]
[Address(RVA = "0x6664C0", Offset = "0x664EC0", VA = "0x1806664C0")]
private bool DoVerify(AsymmetricKeyParameter key)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600A2E5 RID: 41701 RVA: 0x0025F128 File Offset: 0x0025D328
[Token(Token = "0x600A2E5")]
[Address(RVA = "0x667E40", Offset = "0x666840", VA = "0x180667E40")]
private bool IsNull(Asn1Encodable o)
{
return (o != 0 && o != 0) || o == 0;
}
// Token: 0x0600A2E6 RID: 41702 RVA: 0x0025F148 File Offset: 0x0025D348
[Token(Token = "0x600A2E6")]
[Address(RVA = "0x6663C0", Offset = "0x664DC0", VA = "0x1806663C0")]
private DigestInfo DerDecode(byte[] encoding)
{
/*
An exception occurred when decompiling this method (0600A2E6)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.DigestInfo BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::DerDecode(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_36:
stloc:CmsException(var_3_40, newobj:CmsException(CmsException::.ctor, ldstr:string("malformed RSA signature")))
}
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: 0x0600A2E7 RID: 41703 RVA: 0x0025F198 File Offset: 0x0025D398
[Token(Token = "0x600A2E7")]
[Address(RVA = "0x668010", Offset = "0x666A10", VA = "0x180668010")]
private bool VerifyDigest(byte[] digest, AsymmetricKeyParameter key, byte[] signature)
{
CmsSignedHelper helper = SignerInformation.Helper;
Asn1Object asn1Object = this.encryptionAlgorithm.ToAsn1Object();
string text;
if (!text.Equals("RSA"))
{
if (!text.Equals("DSA"))
{
string text2;
CmsException ex = new CmsException(text2);
throw new NullReferenceException();
}
ISigner signer = SignerUtilities.GetSigner("NONEwithDSA");
int length = digest.Length;
}
IBufferedCipher bufferedCipher = CmsEnvelopedHelper.Instance.CreateAsymmetricCipher("RSA/ECB/PKCS1Padding");
int num = 0;
if (num < bufferedCipher)
{
num += num;
num++;
}
Asn1Object asn1Object2;
DigestInfo instance = DigestInfo.GetInstance(asn1Object2);
if (instance.GetEncoded().Length == instance)
{
Asn1Object asn1Object3 = instance.algID.ToAsn1Object();
if (this.digestAlgorithm.ToAsn1Object() != 0)
{
DerObjectIdentifier objectID = instance.algID.ObjectID;
if (objectID == 0 || objectID != 0 || objectID == 0)
{
byte[] digest2 = instance.digest;
bool flag = Arrays.ConstantTimeAreEqual(digest, digest2);
}
}
throw new NullReferenceException();
}
CmsException ex2 = new CmsException("malformed RSA signature");
throw new NullReferenceException();
}
// Token: 0x0600A2E8 RID: 41704 RVA: 0x0025F2F8 File Offset: 0x0025D4F8
[Token(Token = "0x600A2E8")]
[Address(RVA = "0x668670", Offset = "0x667070", VA = "0x180668670")]
public bool Verify(AsymmetricKeyParameter pubKey)
{
/*
An exception occurred when decompiling this method (0600A2E8)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::Verify(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_1E:
stloc:ArgumentException(var_1_2D, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Expected public key"), ldstr:string("pubKey")))
}
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: 0x0600A2E9 RID: 41705 RVA: 0x0025F334 File Offset: 0x0025D534
[Token(Token = "0x600A2E9")]
[Address(RVA = "0x6685F0", Offset = "0x666FF0", VA = "0x1806685F0")]
public bool Verify(X509Certificate cert)
{
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Time signingTime = this.GetSigningTime();
if (signingTime != 0)
{
DateTime date = signingTime.Date;
}
bool flag;
return flag;
}
// Token: 0x0600A2EA RID: 41706 RVA: 0x0025F35C File Offset: 0x0025D55C
[Token(Token = "0x600A2EA")]
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240")]
public SignerInfo ToSignerInfo()
{
return this.info;
}
// Token: 0x0600A2EB RID: 41707 RVA: 0x0025F370 File Offset: 0x0025D570
[Token(Token = "0x600A2EB")]
[Address(RVA = "0x667BF0", Offset = "0x6665F0", VA = "0x180667BF0")]
private Asn1Object GetSingleValuedSignedAttribute(DerObjectIdentifier attrOID, string printableName)
{
/*
An exception occurred when decompiling this method (0600A2EB)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Asn1Object BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::GetSingleValuedSignedAttribute(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.DerObjectIdentifier,System.String)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_4D:
stloc:CmsException(var_10_57, newobj:CmsException(CmsException::.ctor, ldloc:string(var_9)))
stloc:CmsException(var_12_60, newobj:CmsException(CmsException::.ctor, ldloc:string(var_11)))
}
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: 0x0600A2EC RID: 41708 RVA: 0x0025F3E0 File Offset: 0x0025D5E0
[Token(Token = "0x600A2EC")]
[Address(RVA = "0x667B10", Offset = "0x666510", VA = "0x180667B10")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Time GetSigningTime()
{
/*
An exception occurred when decompiling this method (0600A2EC)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Time BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::GetSigningTime()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_1E:
stloc:CmsException(var_2_28, newobj:CmsException(CmsException::.ctor, ldstr:string("signing-time attribute value not a valid 'Time' structure")))
}
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: 0x0600A2ED RID: 41709 RVA: 0x0025F418 File Offset: 0x0025D618
[Token(Token = "0x600A2ED")]
[Address(RVA = "0x667EC0", Offset = "0x6668C0", VA = "0x180667EC0")]
public static SignerInformation ReplaceUnsignedAttributes(SignerInformation signerInformation, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributes)
{
SignerInfo signerInfo = signerInformation.info;
int num = 0;
if (unsignedAttributes != 0)
{
DerSet derSet = new DerSet(unsignedAttributes.ToAsn1EncodableVector());
}
Asn1OctetString encryptedDigest = signerInfo.encryptedDigest;
AlgorithmIdentifier digAlgorithm = signerInfo.digAlgorithm;
Asn1Set authenticatedAttributes = signerInfo.authenticatedAttributes;
AlgorithmIdentifier digEncryptionAlgorithm = signerInfo.digEncryptionAlgorithm;
SignerInfo signerInfo2 = new SignerInfo(signerInfo.sid, digAlgorithm, authenticatedAttributes, digEncryptionAlgorithm, encryptedDigest, num);
DerObjectIdentifier derObjectIdentifier = signerInformation.contentType;
CmsProcessable cmsProcessable = signerInformation.content;
int num2;
SignerInformation signerInformation2 = new SignerInformation(signerInfo2, derObjectIdentifier, cmsProcessable, num2);
num2 = 0;
throw new NullReferenceException();
}
// Token: 0x0600A2EE RID: 41710 RVA: 0x0025F49C File Offset: 0x0025D69C
[Token(Token = "0x600A2EE")]
[Address(RVA = "0x665E40", Offset = "0x664840", VA = "0x180665E40")]
public static SignerInformation AddCounterSigners(SignerInformation signerInformation, SignerInformationStore counterSigners)
{
int num;
Asn1EncodableVector asn1EncodableVector2;
do
{
num = 0;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributes = signerInformation.UnsignedAttributes;
if (unsignedAttributes == 0)
{
}
Asn1EncodableVector asn1EncodableVector = unsignedAttributes.ToAsn1EncodableVector();
IList list = Platform.CreateArrayList(counterSigners.all);
Asn1Encodable[] array;
if (list != 0)
{
if (num < list)
{
num += num;
num++;
}
if (list == 0)
{
}
if (list == 0)
{
goto IL_C9;
}
array = new Asn1Encodable[1];
if (list != 0)
{
}
array[0] = list;
asn1EncodableVector2.Add(array);
}
if (array != 0)
{
}
if (num != -1)
{
}
}
while (num != 0);
Asn1Encodable[] array2 = new Asn1Encodable[1];
DerObjectIdentifier counterSignature = CmsAttributes.CounterSignature;
DerSet derSet = new DerSet(asn1EncodableVector2);
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute attribute = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute(counterSignature, derSet);
if (attribute != 0)
{
}
array2[0] = attribute;
throw new NullReferenceException();
IL_C9:
throw new NullReferenceException();
}
// Token: 0x04006AFE RID: 27390
[Token(Token = "0x4006AFE")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x04006AFF RID: 27391
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006AFF")]
private SignerID sid;
// Token: 0x04006B00 RID: 27392
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006B00")]
private SignerInfo info;
// Token: 0x04006B01 RID: 27393
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006B01")]
private AlgorithmIdentifier digestAlgorithm;
// Token: 0x04006B02 RID: 27394
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006B02")]
private AlgorithmIdentifier encryptionAlgorithm;
// Token: 0x04006B03 RID: 27395
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006B03")]
private readonly Asn1Set signedAttributeSet;
// Token: 0x04006B04 RID: 27396
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006B04")]
private readonly Asn1Set unsignedAttributeSet;
// Token: 0x04006B05 RID: 27397
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006B05")]
private CmsProcessable content;
// Token: 0x04006B06 RID: 27398
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006B06")]
private byte[] signature;
// Token: 0x04006B07 RID: 27399
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
[Token(Token = "0x4006B07")]
private DerObjectIdentifier contentType;
// Token: 0x04006B08 RID: 27400
[global::Cpp2IlInjected.FieldOffset(Offset = "0x58")]
[Token(Token = "0x4006B08")]
private IDigestCalculator digestCalculator;
// Token: 0x04006B09 RID: 27401
[global::Cpp2IlInjected.FieldOffset(Offset = "0x60")]
[Token(Token = "0x4006B09")]
private byte[] resultDigest;
// Token: 0x04006B0A RID: 27402
[global::Cpp2IlInjected.FieldOffset(Offset = "0x68")]
[Token(Token = "0x4006B0A")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttributeTable;
// Token: 0x04006B0B RID: 27403
[global::Cpp2IlInjected.FieldOffset(Offset = "0x70")]
[Token(Token = "0x4006B0B")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributeTable;
// Token: 0x04006B0C RID: 27404
[global::Cpp2IlInjected.FieldOffset(Offset = "0x78")]
[Token(Token = "0x4006B0C")]
private readonly bool isCounterSignature;
}
}
@@ -0,0 +1,147 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001790 RID: 6032
[Token(Token = "0x2001790")]
[StructLayout(3)]
public class SignerInformationStore
{
// Token: 0x0600A2F0 RID: 41712 RVA: 0x0025F590 File Offset: 0x0025D790
[Token(Token = "0x600A2F0")]
[Address(RVA = "0x665D20", Offset = "0x664720", VA = "0x180665D20")]
public SignerInformationStore(SignerInformation signerInfo)
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
base..ctor();
IList list = Platform.CreateArrayList(1);
this.all = list;
IDictionary dictionary2 = this.table;
IList list2 = this.all;
}
// Token: 0x0600A2F1 RID: 41713 RVA: 0x0025F5D8 File Offset: 0x0025D7D8
[Token(Token = "0x600A2F1")]
[Address(RVA = "0x665A20", Offset = "0x664420", VA = "0x180665A20")]
public SignerInformationStore(ICollection signerInfos)
{
int num2;
do
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
base..ctor();
IList list;
if (dictionary != 0)
{
int num = 0;
if (dictionary == 0)
{
goto IL_74;
}
IDictionary dictionary2 = this.table;
if (num != 0 && num == 0)
{
goto IL_62;
}
IDictionary dictionary3 = this.table;
list = Platform.CreateArrayList(1);
num2 = 0;
}
if (list != 0)
{
}
if (num2 != -1)
{
}
}
while (num2 != 0);
IList list2;
this.all = list2;
return;
IL_62:
throw new NullReferenceException();
IL_74:
throw new NullReferenceException();
}
// Token: 0x0600A2F2 RID: 41714 RVA: 0x0025F664 File Offset: 0x0025D864
[Token(Token = "0x600A2F2")]
[Address(RVA = "0x6657E0", Offset = "0x6641E0", VA = "0x1806657E0")]
public SignerInformation GetFirstSigner(SignerID selector)
{
IDictionary dictionary;
do
{
dictionary = this.table;
}
while (dictionary == 0);
throw new NullReferenceException();
}
// Token: 0x17001992 RID: 6546
// (get) Token: 0x0600A2F3 RID: 41715 RVA: 0x0025F688 File Offset: 0x0025D888
[Token(Token = "0x17001992")]
public int Count
{
[Token(Token = "0x600A2F3")]
[Address(RVA = "0x665DF0", Offset = "0x6647F0", VA = "0x180665DF0")]
get
{
IList list = this.all;
throw new NullReferenceException();
}
}
// Token: 0x0600A2F4 RID: 41716 RVA: 0x0025F6A4 File Offset: 0x0025D8A4
[Token(Token = "0x600A2F4")]
[Address(RVA = "0x6658D0", Offset = "0x6642D0", VA = "0x1806658D0")]
public ICollection GetSigners()
{
/*
An exception occurred when decompiling this method (0600A2F4)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Collections.ICollection BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformationStore::GetSigners()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:IList(var_0_0B, call:IList(Platform::CreateArrayList, ldfld:IList[exp:ICollection](SignerInformationStore::all, ldloc:SignerInformationStore(this))))
}
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: 0x0600A2F5 RID: 41717 RVA: 0x0025F6BC File Offset: 0x0025D8BC
[Token(Token = "0x600A2F5")]
[Address(RVA = "0x665930", Offset = "0x664330", VA = "0x180665930")]
public ICollection GetSigners(SignerID selector)
{
IDictionary dictionary = this.table;
IList list = Platform.CreateArrayList();
throw new NullReferenceException();
}
// Token: 0x04006B0D RID: 27405
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006B0D")]
private readonly IList all;
// Token: 0x04006B0E RID: 27406
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006B0E")]
private readonly IDictionary table;
}
}
@@ -0,0 +1,35 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001791 RID: 6033
[Token(Token = "0x2001791")]
[StructLayout(3)]
public class SimpleAttributeTableGenerator : CmsAttributeTableGenerator
{
// Token: 0x0600A2F6 RID: 41718 RVA: 0x0025F6E0 File Offset: 0x0025D8E0
[Token(Token = "0x600A2F6")]
[Address(RVA = "0x3C3A30", Offset = "0x3C2430", VA = "0x1803C3A30")]
public SimpleAttributeTableGenerator(AttributeTable attributes)
{
this.attributes = attributes;
}
// Token: 0x0600A2F7 RID: 41719 RVA: 0x0025F6FC File Offset: 0x0025D8FC
[Token(Token = "0x600A2F7")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0", Slot = "5")]
public virtual AttributeTable GetAttributes(IDictionary parameters)
{
return this.attributes;
}
// Token: 0x04006B0F RID: 27407
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006B0F")]
private readonly AttributeTable attributes;
}
}