This commit is contained in:
niko
2026-04-11 22:19:20 +02:00
parent 45b857ff11
commit 8fc35183db
17034 changed files with 2863552 additions and 0 deletions
@@ -0,0 +1,32 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D20 RID: 7456
[Token(Token = "0x2001D20")]
internal class BaseDigestCalculator : IDigestCalculator
{
// Token: 0x0600BCDF RID: 48351 RVA: 0x002AF84C File Offset: 0x002ADA4C
[Token(Token = "0x600BCDF")]
[Address(RVA = "0x3FFB80", Offset = "0x3FE980", VA = "0x1803FFB80")]
internal BaseDigestCalculator(byte[] digest)
{
this.digest = digest;
}
// Token: 0x0600BCE0 RID: 48352 RVA: 0x002AF868 File Offset: 0x002ADA68
[Token(Token = "0x600BCE0")]
[Address(RVA = "0x165CA80", Offset = "0x165B880", VA = "0x18165CA80", Slot = "4")]
public byte[] GetDigest()
{
return Arrays.Clone(this.digest);
}
// Token: 0x04007843 RID: 30787
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007843")]
private readonly byte[] digest;
}
}
@@ -0,0 +1,34 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D21 RID: 7457
[Token(Token = "0x2001D21")]
[Serializable]
public class CmsAttributeTableGenerationException : CmsException
{
// Token: 0x0600BCE1 RID: 48353 RVA: 0x002AF880 File Offset: 0x002ADA80
[Token(Token = "0x600BCE1")]
[Address(RVA = "0x165EC90", Offset = "0x165DA90", VA = "0x18165EC90")]
public CmsAttributeTableGenerationException()
{
}
// Token: 0x0600BCE2 RID: 48354 RVA: 0x002AF894 File Offset: 0x002ADA94
[Token(Token = "0x600BCE2")]
[Address(RVA = "0x165ED70", Offset = "0x165DB70", VA = "0x18165ED70")]
public CmsAttributeTableGenerationException(string name)
: base(name)
{
}
// Token: 0x0600BCE3 RID: 48355 RVA: 0x002AF8A8 File Offset: 0x002ADAA8
[Token(Token = "0x600BCE3")]
[Address(RVA = "0x165ECF0", Offset = "0x165DAF0", VA = "0x18165ECF0")]
public CmsAttributeTableGenerationException(string name, Exception e)
: base(name, e)
{
}
}
}
@@ -0,0 +1,17 @@
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D23 RID: 7459
[Token(Token = "0x2001D23")]
public interface CmsAttributeTableGenerator
{
// Token: 0x0600BCE4 RID: 48356
[Token(Token = "0x600BCE4")]
[Address(Slot = "0")]
AttributeTable GetAttributes(IDictionary parameters);
}
}
@@ -0,0 +1,23 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D22 RID: 7458
[Token(Token = "0x2001D22")]
public enum CmsAttributeTableParameter
{
// Token: 0x04007845 RID: 30789
[Token(Token = "0x4007845")]
ContentType,
// Token: 0x04007846 RID: 30790
[Token(Token = "0x4007846")]
Digest,
// Token: 0x04007847 RID: 30791
[Token(Token = "0x4007847")]
Signature,
// Token: 0x04007848 RID: 30792
[Token(Token = "0x4007848")]
DigestAlgorithmIdentifier
}
}
@@ -0,0 +1,160 @@
using System;
using System.IO;
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: 0x02001D24 RID: 7460
[Token(Token = "0x2001D24")]
internal class CmsAuthEnvelopedData
{
// Token: 0x0600BCE5 RID: 48357 RVA: 0x002AF8C0 File Offset: 0x002ADAC0
[Token(Token = "0x600BCE5")]
[Address(RVA = "0x165EDE0", Offset = "0x165DBE0", VA = "0x18165EDE0")]
public CmsAuthEnvelopedData(byte[] authEnvData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(authEnvData);
}
// Token: 0x0600BCE6 RID: 48358 RVA: 0x002AF8D4 File Offset: 0x002ADAD4
[Token(Token = "0x600BCE6")]
[Address(RVA = "0x165EE10", Offset = "0x165DC10", VA = "0x18165EE10")]
public CmsAuthEnvelopedData(Stream authEnvData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(authEnvData);
}
// Token: 0x0600BCE7 RID: 48359 RVA: 0x002AF8E8 File Offset: 0x002ADAE8
[Token(Token = "0x600BCE7")]
[Address(RVA = "0x165EE40", Offset = "0x165DC40", VA = "0x18165EE40")]
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: 0x04007849 RID: 30793
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007849")]
internal RecipientInformationStore recipientInfoStore;
// Token: 0x0400784A RID: 30794
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400784A")]
internal ContentInfo contentInfo;
// Token: 0x0400784B RID: 30795
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400784B")]
private OriginatorInfo originator;
// Token: 0x0400784C RID: 30796
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400784C")]
private AlgorithmIdentifier authEncAlg;
// Token: 0x0400784D RID: 30797
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400784D")]
private Asn1Set authAttrs;
// Token: 0x0400784E RID: 30798
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x400784E")]
private byte[] mac;
// Token: 0x0400784F RID: 30799
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x400784F")]
private Asn1Set unauthAttrs;
// Token: 0x02001D25 RID: 7461
[Token(Token = "0x2001D25")]
private class AuthEnvelopedSecureReadable : CmsSecureReadable
{
// Token: 0x0600BCE8 RID: 48360 RVA: 0x002AF990 File Offset: 0x002ADB90
[Token(Token = "0x600BCE8")]
[Address(RVA = "0x3FFB80", Offset = "0x3FE980", VA = "0x1803FFB80")]
internal AuthEnvelopedSecureReadable(CmsAuthEnvelopedData parent)
{
this.parent = parent;
}
// Token: 0x17001D45 RID: 7493
// (get) Token: 0x0600BCE9 RID: 48361 RVA: 0x002AF9AC File Offset: 0x002ADBAC
[Token(Token = "0x17001D45")]
public AlgorithmIdentifier Algorithm
{
[Token(Token = "0x600BCE9")]
[Address(RVA = "0x407190", Offset = "0x405F90", VA = "0x180407190", Slot = "4")]
get
{
return this.parent.authEncAlg;
}
}
// Token: 0x17001D46 RID: 7494
// (get) Token: 0x0600BCEA RID: 48362 RVA: 0x002AF9CC File Offset: 0x002ADBCC
[Token(Token = "0x17001D46")]
public object CryptoObject
{
[Token(Token = "0x600BCEA")]
[Address(RVA = "0x43E630", Offset = "0x43D430", VA = "0x18043E630", Slot = "5")]
get
{
}
}
// Token: 0x0600BCEB RID: 48363 RVA: 0x002AF9DC File Offset: 0x002ADBDC
[Token(Token = "0x600BCEB")]
[Address(RVA = "0x165CA20", Offset = "0x165B820", VA = "0x18165CA20", Slot = "6")]
public CmsReadable GetReadable(KeyParameter key)
{
/*
An exception occurred when decompiling this method (0600BCEB)
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 1660
*/;
}
// Token: 0x04007850 RID: 30800
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007850")]
private readonly CmsAuthEnvelopedData parent;
}
}
}
@@ -0,0 +1,42 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D26 RID: 7462
[Token(Token = "0x2001D26")]
internal class CmsAuthEnvelopedGenerator
{
// Token: 0x0600BCEC RID: 48364 RVA: 0x002AF9F4 File Offset: 0x002ADBF4
[Token(Token = "0x600BCEC")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public CmsAuthEnvelopedGenerator()
{
}
// Token: 0x04007851 RID: 30801
[Token(Token = "0x4007851")]
public static readonly string Aes128Ccm = NistObjectIdentifiers.IdAes128Ccm.identifier;
// Token: 0x04007852 RID: 30802
[Token(Token = "0x4007852")]
public static readonly string Aes192Ccm = NistObjectIdentifiers.IdAes192Ccm.identifier;
// Token: 0x04007853 RID: 30803
[Token(Token = "0x4007853")]
public static readonly string Aes256Ccm = NistObjectIdentifiers.IdAes256Ccm.identifier;
// Token: 0x04007854 RID: 30804
[Token(Token = "0x4007854")]
public static readonly string Aes128Gcm = NistObjectIdentifiers.IdAes128Gcm.identifier;
// Token: 0x04007855 RID: 30805
[Token(Token = "0x4007855")]
public static readonly string Aes192Gcm = NistObjectIdentifiers.IdAes192Gcm.identifier;
// Token: 0x04007856 RID: 30806
[Token(Token = "0x4007856")]
public static readonly string Aes256Gcm = NistObjectIdentifiers.IdAes256Gcm.identifier;
}
}
@@ -0,0 +1,176 @@
using System;
using System.IO;
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: 0x02001D27 RID: 7463
[Token(Token = "0x2001D27")]
public class CmsAuthenticatedData
{
// Token: 0x0600BCEE RID: 48366 RVA: 0x002AFA78 File Offset: 0x002ADC78
[Token(Token = "0x600BCEE")]
[Address(RVA = "0x1661160", Offset = "0x165FF60", VA = "0x181661160")]
public CmsAuthenticatedData(byte[] authData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(authData);
}
// Token: 0x0600BCEF RID: 48367 RVA: 0x002AFA8C File Offset: 0x002ADC8C
[Token(Token = "0x600BCEF")]
[Address(RVA = "0x1661300", Offset = "0x1660100", VA = "0x181661300")]
public CmsAuthenticatedData(Stream authData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(authData);
}
// Token: 0x0600BCF0 RID: 48368 RVA: 0x002AFAA0 File Offset: 0x002ADCA0
[Token(Token = "0x600BCF0")]
[Address(RVA = "0x1661190", Offset = "0x165FF90", VA = "0x181661190")]
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: 0x0600BCF1 RID: 48369 RVA: 0x002AFB60 File Offset: 0x002ADD60
[Token(Token = "0x600BCF1")]
[Address(RVA = "0x1661090", Offset = "0x165FE90", VA = "0x181661090")]
public byte[] GetMac()
{
return Arrays.Clone(this.mac);
}
// Token: 0x17001D47 RID: 7495
// (get) Token: 0x0600BCF2 RID: 48370 RVA: 0x002AFB78 File Offset: 0x002ADD78
[Token(Token = "0x17001D47")]
public AlgorithmIdentifier MacAlgorithmID
{
[Token(Token = "0x600BCF2")]
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
get
{
return this.macAlg;
}
}
// Token: 0x17001D48 RID: 7496
// (get) Token: 0x0600BCF3 RID: 48371 RVA: 0x002AFB8C File Offset: 0x002ADD8C
[Token(Token = "0x17001D48")]
public string MacAlgOid
{
[Token(Token = "0x600BCF3")]
[Address(RVA = "0x1661330", Offset = "0x1660130", VA = "0x181661330")]
get
{
Asn1Object asn1Object = this.macAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x0600BCF4 RID: 48372 RVA: 0x002AFBAC File Offset: 0x002ADDAC
[Token(Token = "0x600BCF4")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
public RecipientInformationStore GetRecipientInfos()
{
return this.recipientInfoStore;
}
// Token: 0x17001D49 RID: 7497
// (get) Token: 0x0600BCF5 RID: 48373 RVA: 0x002AFBC0 File Offset: 0x002ADDC0
[Token(Token = "0x17001D49")]
public ContentInfo ContentInfo
{
[Token(Token = "0x600BCF5")]
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
get
{
return this.contentInfo;
}
}
// Token: 0x0600BCF6 RID: 48374 RVA: 0x002AFBD4 File Offset: 0x002ADDD4
[Token(Token = "0x600BCF6")]
[Address(RVA = "0x1661000", Offset = "0x165FE00", VA = "0x181661000")]
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: 0x0600BCF7 RID: 48375 RVA: 0x002AFBF4 File Offset: 0x002ADDF4
[Token(Token = "0x600BCF7")]
[Address(RVA = "0x16610F0", Offset = "0x165FEF0", VA = "0x1816610F0")]
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: 0x0600BCF8 RID: 48376 RVA: 0x002AFC14 File Offset: 0x002ADE14
[Token(Token = "0x600BCF8")]
[Address(RVA = "0x1661070", Offset = "0x165FE70", VA = "0x181661070")]
public byte[] GetEncoded()
{
return this.contentInfo.GetEncoded();
}
// Token: 0x04007857 RID: 30807
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007857")]
internal RecipientInformationStore recipientInfoStore;
// Token: 0x04007858 RID: 30808
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007858")]
internal ContentInfo contentInfo;
// Token: 0x04007859 RID: 30809
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007859")]
private AlgorithmIdentifier macAlg;
// Token: 0x0400785A RID: 30810
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400785A")]
private Asn1Set authAttrs;
// Token: 0x0400785B RID: 30811
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400785B")]
private Asn1Set unauthAttrs;
// Token: 0x0400785C RID: 30812
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x400785C")]
private byte[] mac;
}
}
@@ -0,0 +1,95 @@
using System;
using System.Collections;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.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.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D28 RID: 7464
[Token(Token = "0x2001D28")]
public class CmsAuthenticatedDataGenerator : CmsAuthenticatedGenerator
{
// Token: 0x0600BCF9 RID: 48377 RVA: 0x002AFC34 File Offset: 0x002ADE34
[Token(Token = "0x600BCF9")]
[Address(RVA = "0x165F8B0", Offset = "0x165E6B0", VA = "0x18165F8B0")]
public CmsAuthenticatedDataGenerator()
{
}
// Token: 0x0600BCFA RID: 48378 RVA: 0x002AFC48 File Offset: 0x002ADE48
[Token(Token = "0x600BCFA")]
[Address(RVA = "0x165F910", Offset = "0x165E710", VA = "0x18165F910")]
public CmsAuthenticatedDataGenerator(SecureRandom rand)
: base(rand)
{
}
// Token: 0x0600BCFB RID: 48379 RVA: 0x002AFC5C File Offset: 0x002ADE5C
[Token(Token = "0x600BCFB")]
[Address(RVA = "0x165F210", Offset = "0x165E010", VA = "0x18165F210")]
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);
TeeOutputStream teeOutputStream = 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 == 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: 0x0600BCFC RID: 48380 RVA: 0x002AFD74 File Offset: 0x002ADF74
[Token(Token = "0x600BCFC")]
[Address(RVA = "0x165F0E0", Offset = "0x165DEE0", VA = "0x18165F0E0")]
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,262 @@
using System;
using System.IO;
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: 0x02001D29 RID: 7465
[Token(Token = "0x2001D29")]
public class CmsAuthenticatedDataParser : CmsContentInfoParser
{
// Token: 0x0600BCFD RID: 48381 RVA: 0x002AFDB4 File Offset: 0x002ADFB4
[Token(Token = "0x600BCFD")]
[Address(RVA = "0x1660390", Offset = "0x165F190", VA = "0x181660390")]
public CmsAuthenticatedDataParser(byte[] envelopedData)
{
int num;
MemoryStream memoryStream = new MemoryStream(envelopedData, num != 0);
num = 0;
}
// Token: 0x0600BCFE RID: 48382 RVA: 0x002AFDCC File Offset: 0x002ADFCC
[Token(Token = "0x600BCFE")]
[Address(RVA = "0x1660150", Offset = "0x165EF50", VA = "0x181660150")]
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: 0x17001D4A RID: 7498
// (get) Token: 0x0600BCFF RID: 48383 RVA: 0x002AFE7C File Offset: 0x002AE07C
[Token(Token = "0x17001D4A")]
public AlgorithmIdentifier MacAlgorithmID
{
[Token(Token = "0x600BCFF")]
[Address(RVA = "0x3FA180", Offset = "0x3F8F80", VA = "0x1803FA180")]
get
{
return this.macAlg;
}
}
// Token: 0x17001D4B RID: 7499
// (get) Token: 0x0600BD00 RID: 48384 RVA: 0x002AFE90 File Offset: 0x002AE090
[Token(Token = "0x17001D4B")]
public string MacAlgOid
{
[Token(Token = "0x600BD00")]
[Address(RVA = "0x1660400", Offset = "0x165F200", VA = "0x181660400")]
get
{
Asn1Object asn1Object = this.macAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001D4C RID: 7500
// (get) Token: 0x0600BD01 RID: 48385 RVA: 0x002AFEB0 File Offset: 0x002AE0B0
[Token(Token = "0x17001D4C")]
public Asn1Object MacAlgParams
{
[Token(Token = "0x600BD01")]
[Address(RVA = "0x1660440", Offset = "0x165F240", VA = "0x181660440")]
get
{
DerObjectIdentifier objectID = this.macAlg.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600BD02 RID: 48386 RVA: 0x002AFEDC File Offset: 0x002AE0DC
[Token(Token = "0x600BD02")]
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
public RecipientInformationStore GetRecipientInfos()
{
return this._recipientInfoStore;
}
// Token: 0x0600BD03 RID: 48387 RVA: 0x002AFEF0 File Offset: 0x002AE0F0
[Token(Token = "0x600BD03")]
[Address(RVA = "0x165FDE0", Offset = "0x165EBE0", VA = "0x18165FDE0")]
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: 0x0600BD04 RID: 48388 RVA: 0x002AFF34 File Offset: 0x002AE134
[Token(Token = "0x600BD04")]
[Address(RVA = "0x165FB20", Offset = "0x165E920", VA = "0x18165FB20")]
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: 0x0600BD05 RID: 48389 RVA: 0x002AFFE4 File Offset: 0x002AE1E4
[Token(Token = "0x600BD05")]
[Address(RVA = "0x165FE90", Offset = "0x165EC90", VA = "0x18165FE90")]
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: 0x0400785D RID: 30813
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400785D")]
internal RecipientInformationStore _recipientInfoStore;
// Token: 0x0400785E RID: 30814
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400785E")]
internal AuthenticatedDataParser authData;
// Token: 0x0400785F RID: 30815
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400785F")]
private AlgorithmIdentifier macAlg;
// Token: 0x04007860 RID: 30816
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007860")]
private byte[] mac;
// Token: 0x04007861 RID: 30817
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007861")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable authAttrs;
// Token: 0x04007862 RID: 30818
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007862")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unauthAttrs;
// Token: 0x04007863 RID: 30819
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x4007863")]
private bool authAttrNotRead;
// Token: 0x04007864 RID: 30820
[FieldOffset(Offset = "0x51")]
[Token(Token = "0x4007864")]
private bool unauthAttrNotRead;
}
}
@@ -0,0 +1,254 @@
using System;
using System.Collections;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.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: 0x02001D2A RID: 7466
[Token(Token = "0x2001D2A")]
public class CmsAuthenticatedDataStreamGenerator : CmsAuthenticatedGenerator
{
// Token: 0x0600BD06 RID: 48390 RVA: 0x002B0094 File Offset: 0x002AE294
[Token(Token = "0x600BD06")]
[Address(RVA = "0x165F8B0", Offset = "0x165E6B0", VA = "0x18165F8B0")]
public CmsAuthenticatedDataStreamGenerator()
{
}
// Token: 0x0600BD07 RID: 48391 RVA: 0x002B00A8 File Offset: 0x002AE2A8
[Token(Token = "0x600BD07")]
[Address(RVA = "0x165F910", Offset = "0x165E710", VA = "0x18165F910")]
public CmsAuthenticatedDataStreamGenerator(SecureRandom rand)
: base(rand)
{
}
// Token: 0x0600BD08 RID: 48392 RVA: 0x002B00BC File Offset: 0x002AE2BC
[Token(Token = "0x600BD08")]
[Address(RVA = "0x42EFF0", Offset = "0x42DDF0", VA = "0x18042EFF0")]
public void SetBufferSize(int bufferSize)
{
this._bufferSize = bufferSize;
}
// Token: 0x0600BD09 RID: 48393 RVA: 0x002B00D0 File Offset: 0x002AE2D0
[Token(Token = "0x600BD09")]
[Address(RVA = "0x431D50", Offset = "0x430B50", VA = "0x180431D50")]
public void SetBerEncodeRecipients(bool berEncodeRecipientSet)
{
this._berEncodeRecipientSet = berEncodeRecipientSet;
}
// Token: 0x0600BD0A RID: 48394 RVA: 0x002B00E4 File Offset: 0x002AE2E4
[Token(Token = "0x600BD0A")]
[Address(RVA = "0x1660490", Offset = "0x165F290", VA = "0x181660490")]
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;
ArrayTypeMismatchException ex;
if (ex != 0)
{
}
if (num == 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: 0x0600BD0B RID: 48395 RVA: 0x002B0198 File Offset: 0x002AE398
[Token(Token = "0x600BD0B")]
[Address(RVA = "0x1660820", Offset = "0x165F620", VA = "0x181660820")]
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();
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 == 0)
{
Stream rawOutputStream = derSetGenerator.GetRawOutputStream();
string text4 = berSequenceGenerator2.ToString();
BerSequenceGenerator berSequenceGenerator3;
string text5 = berSequenceGenerator3.ToString();
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: 0x0600BD0C RID: 48396 RVA: 0x002B0298 File Offset: 0x002AE498
[Token(Token = "0x600BD0C")]
[Address(RVA = "0x1660F10", Offset = "0x165FD10", VA = "0x181660F10")]
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: 0x0600BD0D RID: 48397 RVA: 0x002B02D8 File Offset: 0x002AE4D8
[Token(Token = "0x600BD0D")]
[Address(RVA = "0x1660E20", Offset = "0x165FC20", VA = "0x181660E20")]
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: 0x04007865 RID: 30821
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007865")]
private int _bufferSize;
// Token: 0x04007866 RID: 30822
[FieldOffset(Offset = "0x2C")]
[Token(Token = "0x4007866")]
private bool _berEncodeRecipientSet;
// Token: 0x02001D2B RID: 7467
[Token(Token = "0x2001D2B")]
private class CmsAuthenticatedDataOutputStream : BaseOutputStream
{
// Token: 0x0600BD0E RID: 48398 RVA: 0x002B0310 File Offset: 0x002AE510
[Token(Token = "0x600BD0E")]
[Address(RVA = "0x165FAC0", Offset = "0x165E8C0", VA = "0x18165FAC0")]
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: 0x0600BD0F RID: 48399 RVA: 0x002B0348 File Offset: 0x002AE548
[Token(Token = "0x600BD0F")]
[Address(RVA = "0x165FA60", Offset = "0x165E860", VA = "0x18165FA60", Slot = "30")]
public override void WriteByte(byte b)
{
bool canRead = this.macStream.CanRead;
}
// Token: 0x0600BD10 RID: 48400 RVA: 0x002B0368 File Offset: 0x002AE568
[Token(Token = "0x600BD10")]
[Address(RVA = "0x165FA90", Offset = "0x165E890", VA = "0x18165FA90", Slot = "29")]
public override void Write(byte[] bytes, int off, int len)
{
bool canRead = this.macStream.CanRead;
}
// Token: 0x0600BD11 RID: 48401 RVA: 0x002B0388 File Offset: 0x002AE588
[Token(Token = "0x600BD11")]
[Address(RVA = "0x165F920", Offset = "0x165E720", VA = "0x18165F920", 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: 0x04007867 RID: 30823
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007867")]
private readonly Stream macStream;
// Token: 0x04007868 RID: 30824
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007868")]
private readonly IMac mac;
// Token: 0x04007869 RID: 30825
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007869")]
private readonly BerSequenceGenerator cGen;
// Token: 0x0400786A RID: 30826
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x400786A")]
private readonly BerSequenceGenerator authGen;
// Token: 0x0400786B RID: 30827
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x400786B")]
private readonly BerSequenceGenerator eiGen;
}
}
}
@@ -0,0 +1,31 @@
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D2C RID: 7468
[Token(Token = "0x2001D2C")]
public class CmsAuthenticatedGenerator : CmsEnvelopedGenerator
{
// Token: 0x0600BD12 RID: 48402 RVA: 0x002B03F4 File Offset: 0x002AE5F4
[Token(Token = "0x600BD12")]
[Address(RVA = "0x165F8B0", Offset = "0x165E6B0", VA = "0x18165F8B0")]
public CmsAuthenticatedGenerator()
{
}
// Token: 0x0600BD13 RID: 48403 RVA: 0x002B0408 File Offset: 0x002AE608
[Token(Token = "0x600BD13")]
[Address(RVA = "0x1661370", Offset = "0x1660170", VA = "0x181661370")]
public CmsAuthenticatedGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this.recipientInfoGenerators = list;
base..ctor();
this.rand = rand;
}
}
}
@@ -0,0 +1,109 @@
using System;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D2D RID: 7469
[Token(Token = "0x2001D2D")]
public class CmsCompressedData
{
// Token: 0x0600BD14 RID: 48404 RVA: 0x002B0434 File Offset: 0x002AE634
[Token(Token = "0x600BD14")]
[Address(RVA = "0x1662270", Offset = "0x1661070", VA = "0x181662270")]
public CmsCompressedData(byte[] compressedData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(compressedData);
base..ctor();
this.contentInfo = contentInfo;
}
// Token: 0x0600BD15 RID: 48405 RVA: 0x002B0458 File Offset: 0x002AE658
[Token(Token = "0x600BD15")]
[Address(RVA = "0x16622B0", Offset = "0x16610B0", VA = "0x1816622B0")]
public CmsCompressedData(Stream compressedDataStream)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(compressedDataStream);
base..ctor();
this.contentInfo = contentInfo;
}
// Token: 0x0600BD16 RID: 48406 RVA: 0x002B047C File Offset: 0x002AE67C
[Token(Token = "0x600BD16")]
[Address(RVA = "0x3FFB80", Offset = "0x3FE980", VA = "0x1803FFB80")]
public CmsCompressedData(ContentInfo contentInfo)
{
this.contentInfo = contentInfo;
}
// Token: 0x0600BD17 RID: 48407 RVA: 0x002B0498 File Offset: 0x002AE698
[Token(Token = "0x600BD17")]
[Address(RVA = "0x1661EA0", Offset = "0x1660CA0", VA = "0x181661EA0")]
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 = CmsUtilities.StreamToByteArray(zinputStream);
Platform.Dispose(zinputStream);
if (num == 0)
{
break;
}
}
}
return array;
}
// Token: 0x0600BD18 RID: 48408 RVA: 0x002B0504 File Offset: 0x002AE704
[Token(Token = "0x600BD18")]
[Address(RVA = "0x16620A0", Offset = "0x1660EA0", VA = "0x1816620A0")]
public byte[] GetContent(int limit)
{
Asn1Encodable content;
do
{
content = CompressedData.GetInstance(this.contentInfo.content).encapContentInfo.content;
}
while (content == 0 || content == 0);
MemoryStream memoryStream;
return CmsUtilities.StreamToByteArray(new ZInputStream(memoryStream), limit);
}
// Token: 0x17001D4D RID: 7501
// (get) Token: 0x0600BD19 RID: 48409 RVA: 0x002B054C File Offset: 0x002AE74C
[Token(Token = "0x17001D4D")]
public ContentInfo ContentInfo
{
[Token(Token = "0x600BD19")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
get
{
return this.contentInfo;
}
}
// Token: 0x0600BD1A RID: 48410 RVA: 0x002B0560 File Offset: 0x002AE760
[Token(Token = "0x600BD1A")]
[Address(RVA = "0x16362F0", Offset = "0x16350F0", VA = "0x1816362F0")]
public byte[] GetEncoded()
{
return this.contentInfo.GetEncoded();
}
// Token: 0x0400786C RID: 30828
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400786C")]
internal ContentInfo contentInfo;
}
}
@@ -0,0 +1,43 @@
using System;
using System.IO;
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.Zlib;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D2E RID: 7470
[Token(Token = "0x2001D2E")]
public class CmsCompressedDataGenerator
{
// Token: 0x0600BD1B RID: 48411 RVA: 0x002B0580 File Offset: 0x002AE780
[Token(Token = "0x600BD1B")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public CmsCompressedDataGenerator()
{
}
// Token: 0x0600BD1C RID: 48412 RVA: 0x002B0594 File Offset: 0x002AE794
[Token(Token = "0x600BD1C")]
[Address(RVA = "0x16616A0", Offset = "0x16604A0", VA = "0x1816616A0")]
public CmsCompressedData Generate(CmsProcessable content, string compressionOid)
{
ZOutputStream zoutputStream = 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: 0x0400786D RID: 30829
[Token(Token = "0x400786D")]
public const string ZLib = "1.2.840.113549.1.9.16.3.8";
}
}
@@ -0,0 +1,56 @@
using System;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D2F RID: 7471
[Token(Token = "0x2001D2F")]
public class CmsCompressedDataParser : CmsContentInfoParser
{
// Token: 0x0600BD1D RID: 48413 RVA: 0x002B05F8 File Offset: 0x002AE7F8
[Token(Token = "0x600BD1D")]
[Address(RVA = "0x1661AF0", Offset = "0x16608F0", VA = "0x181661AF0")]
public CmsCompressedDataParser(byte[] compressedData)
{
int num;
MemoryStream memoryStream = new MemoryStream(compressedData, num != 0);
num = 0;
base..ctor(memoryStream);
}
// Token: 0x0600BD1E RID: 48414 RVA: 0x002B0618 File Offset: 0x002AE818
[Token(Token = "0x600BD1E")]
[Address(RVA = "0x1661B60", Offset = "0x1660960", VA = "0x181661B60")]
public CmsCompressedDataParser(Stream compressedData)
: base(compressedData)
{
}
// Token: 0x0600BD1F RID: 48415 RVA: 0x002B062C File Offset: 0x002AE82C
[Token(Token = "0x600BD1F")]
[Address(RVA = "0x1661900", Offset = "0x1660700", VA = "0x181661900")]
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 || content != 0)
{
int hashCode = encapContentInfo.contentType.GetHashCode();
CmsTypedStream cmsTypedStream;
return cmsTypedStream;
}
throw new NullReferenceException();
}
}
}
@@ -0,0 +1,141 @@
using System;
using System.IO;
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: 0x02001D30 RID: 7472
[Token(Token = "0x2001D30")]
public class CmsCompressedDataStreamGenerator
{
// Token: 0x0600BD20 RID: 48416 RVA: 0x002B0690 File Offset: 0x002AE890
[Token(Token = "0x600BD20")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public CmsCompressedDataStreamGenerator()
{
}
// Token: 0x0600BD21 RID: 48417 RVA: 0x002B06A4 File Offset: 0x002AE8A4
[Token(Token = "0x600BD21")]
[Address(RVA = "0x536480", Offset = "0x535280", VA = "0x180536480")]
public void SetBufferSize(int bufferSize)
{
this._bufferSize = bufferSize;
}
// Token: 0x0600BD22 RID: 48418 RVA: 0x002B06B8 File Offset: 0x002AE8B8
[Token(Token = "0x600BD22")]
[Address(RVA = "0x1661B70", Offset = "0x1660970", VA = "0x181661B70")]
public Stream Open(Stream outStream, string compressionOID)
{
string identifier = CmsObjectIdentifiers.Data.identifier;
return this.Open(outStream, identifier, compressionOID);
}
// Token: 0x0600BD23 RID: 48419 RVA: 0x002B06E0 File Offset: 0x002AE8E0
[Token(Token = "0x600BD23")]
[Address(RVA = "0x1661C10", Offset = "0x1660A10", VA = "0x181661C10")]
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: 0x0400786E RID: 30830
[Token(Token = "0x400786E")]
public const string ZLib = "1.2.840.113549.1.9.16.3.8";
// Token: 0x0400786F RID: 30831
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400786F")]
private int _bufferSize;
// Token: 0x02001D31 RID: 7473
[Token(Token = "0x2001D31")]
private class CmsCompressedOutputStream : BaseOutputStream
{
// Token: 0x0600BD24 RID: 48420 RVA: 0x002B076C File Offset: 0x002AE96C
[Token(Token = "0x600BD24")]
[Address(RVA = "0x16623B0", Offset = "0x16611B0", VA = "0x1816623B0")]
internal CmsCompressedOutputStream(ZOutputStream outStream, BerSequenceGenerator sGen, BerSequenceGenerator cGen, BerSequenceGenerator eiGen)
{
this._out = outStream;
this._cGen = cGen;
this._eiGen = 0;
this._sGen = sGen;
}
// Token: 0x0600BD25 RID: 48421 RVA: 0x002B079C File Offset: 0x002AE99C
[Token(Token = "0x600BD25")]
[Address(RVA = "0x165FA60", Offset = "0x165E860", VA = "0x18165FA60", Slot = "30")]
public override void WriteByte(byte b)
{
((IDisposable)this._out).Dispose();
}
// Token: 0x0600BD26 RID: 48422 RVA: 0x002B07BC File Offset: 0x002AE9BC
[Token(Token = "0x600BD26")]
[Address(RVA = "0x165FA90", Offset = "0x165E890", VA = "0x18165FA90", Slot = "29")]
public override void Write(byte[] bytes, int off, int len)
{
int num = this._out.Read(bytes, off, len);
}
// Token: 0x0600BD27 RID: 48423 RVA: 0x002B07E0 File Offset: 0x002AE9E0
[Token(Token = "0x600BD27")]
[Address(RVA = "0x16622F0", Offset = "0x16610F0", VA = "0x1816622F0", 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: 0x04007870 RID: 30832
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007870")]
private ZOutputStream _out;
// Token: 0x04007871 RID: 30833
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007871")]
private BerSequenceGenerator _sGen;
// Token: 0x04007872 RID: 30834
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007872")]
private BerSequenceGenerator _cGen;
// Token: 0x04007873 RID: 30835
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007873")]
private BerSequenceGenerator _eiGen;
}
}
}
@@ -0,0 +1,55 @@
using System;
using System.IO;
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: 0x02001D32 RID: 7474
[Token(Token = "0x2001D32")]
public class CmsContentInfoParser
{
// Token: 0x0600BD28 RID: 48424 RVA: 0x002B0828 File Offset: 0x002AEA28
[Token(Token = "0x600BD28")]
[Address(RVA = "0x1662470", Offset = "0x1661270", VA = "0x181662470")]
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: 0x0600BD29 RID: 48425 RVA: 0x002B0874 File Offset: 0x002AEA74
[Token(Token = "0x600BD29")]
[Address(RVA = "0x1662410", Offset = "0x1661210", VA = "0x181662410")]
public void Close()
{
Platform.Dispose(this.data);
}
// Token: 0x04007874 RID: 30836
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007874")]
protected ContentInfoParser contentInfo;
// Token: 0x04007875 RID: 30837
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007875")]
protected Stream data;
}
}
@@ -0,0 +1,142 @@
using System;
using System.IO;
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: 0x02001D33 RID: 7475
[Token(Token = "0x2001D33")]
public class CmsEnvelopedData
{
// Token: 0x0600BD2A RID: 48426 RVA: 0x002B088C File Offset: 0x002AEA8C
[Token(Token = "0x600BD2A")]
[Address(RVA = "0x1664730", Offset = "0x1663530", VA = "0x181664730")]
public CmsEnvelopedData(byte[] envelopedData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(envelopedData);
}
// Token: 0x0600BD2B RID: 48427 RVA: 0x002B08A0 File Offset: 0x002AEAA0
[Token(Token = "0x600BD2B")]
[Address(RVA = "0x16645C0", Offset = "0x16633C0", VA = "0x1816645C0")]
public CmsEnvelopedData(Stream envelopedData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(envelopedData);
}
// Token: 0x0600BD2C RID: 48428 RVA: 0x002B08B4 File Offset: 0x002AEAB4
[Token(Token = "0x600BD2C")]
[Address(RVA = "0x16645F0", Offset = "0x16633F0", VA = "0x1816645F0")]
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: 0x17001D4E RID: 7502
// (get) Token: 0x0600BD2D RID: 48429 RVA: 0x002B0950 File Offset: 0x002AEB50
[Token(Token = "0x17001D4E")]
public AlgorithmIdentifier EncryptionAlgorithmID
{
[Token(Token = "0x600BD2D")]
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
get
{
return this.encAlg;
}
}
// Token: 0x17001D4F RID: 7503
// (get) Token: 0x0600BD2E RID: 48430 RVA: 0x002B0964 File Offset: 0x002AEB64
[Token(Token = "0x17001D4F")]
public string EncryptionAlgOid
{
[Token(Token = "0x600BD2E")]
[Address(RVA = "0x1661330", Offset = "0x1660130", VA = "0x181661330")]
get
{
Asn1Object asn1Object = this.encAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x0600BD2F RID: 48431 RVA: 0x002B0984 File Offset: 0x002AEB84
[Token(Token = "0x600BD2F")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
public RecipientInformationStore GetRecipientInfos()
{
return this.recipientInfoStore;
}
// Token: 0x17001D50 RID: 7504
// (get) Token: 0x0600BD30 RID: 48432 RVA: 0x002B0998 File Offset: 0x002AEB98
[Token(Token = "0x17001D50")]
public ContentInfo ContentInfo
{
[Token(Token = "0x600BD30")]
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
get
{
return this.contentInfo;
}
}
// Token: 0x0600BD31 RID: 48433 RVA: 0x002B09AC File Offset: 0x002AEBAC
[Token(Token = "0x600BD31")]
[Address(RVA = "0x1664550", Offset = "0x1663350", VA = "0x181664550")]
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: 0x0600BD32 RID: 48434 RVA: 0x002B09CC File Offset: 0x002AEBCC
[Token(Token = "0x600BD32")]
[Address(RVA = "0x1661070", Offset = "0x165FE70", VA = "0x181661070")]
public byte[] GetEncoded()
{
return this.contentInfo.GetEncoded();
}
// Token: 0x04007876 RID: 30838
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007876")]
internal RecipientInformationStore recipientInfoStore;
// Token: 0x04007877 RID: 30839
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007877")]
internal ContentInfo contentInfo;
// Token: 0x04007878 RID: 30840
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007878")]
private AlgorithmIdentifier encAlg;
// Token: 0x04007879 RID: 30841
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007879")]
private Asn1Set unprotectedAttributes;
}
}
@@ -0,0 +1,116 @@
using System;
using System.Collections;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.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: 0x02001D34 RID: 7476
[Token(Token = "0x2001D34")]
public class CmsEnvelopedDataGenerator : CmsEnvelopedGenerator
{
// Token: 0x0600BD33 RID: 48435 RVA: 0x002B09EC File Offset: 0x002AEBEC
[Token(Token = "0x600BD33")]
[Address(RVA = "0x1662F80", Offset = "0x1661D80", VA = "0x181662F80")]
public CmsEnvelopedDataGenerator()
{
}
// Token: 0x0600BD34 RID: 48436 RVA: 0x002B0A00 File Offset: 0x002AEC00
[Token(Token = "0x600BD34")]
[Address(RVA = "0x1662FE0", Offset = "0x1661DE0", VA = "0x181662FE0")]
public CmsEnvelopedDataGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this.recipientInfoGenerators = list;
base..ctor();
this.rand = rand;
}
// Token: 0x0600BD35 RID: 48437 RVA: 0x002B0A2C File Offset: 0x002AEC2C
[Token(Token = "0x600BD35")]
[Address(RVA = "0x1662870", Offset = "0x1661670", VA = "0x181662870")]
private CmsEnvelopedData Generate(CmsProcessable content, string encryptionOid, CipherKeyGenerator keyGen)
{
Asn1EncodableVector asn1EncodableVector;
for (;;)
{
int num = 0;
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 num2;
CipherStream cipherStream = new CipherStream(new MemoryStream(), num2, cipher);
num2 = 0;
IList recipientInfoGenerators = this.recipientInfoGenerators;
if (asn1EncodableVector != 0)
{
break;
}
ArrayTypeMismatchException ex;
if (ex != 0)
{
}
if (num == 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: 0x0600BD36 RID: 48438 RVA: 0x002B0B5C File Offset: 0x002AED5C
[Token(Token = "0x600BD36")]
[Address(RVA = "0x1662610", Offset = "0x1661410", VA = "0x181662610")]
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: 0x0600BD37 RID: 48439 RVA: 0x002B0B9C File Offset: 0x002AED9C
[Token(Token = "0x600BD37")]
[Address(RVA = "0x1662740", Offset = "0x1661540", VA = "0x181662740")]
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,186 @@
using System;
using System.IO;
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: 0x02001D35 RID: 7477
[Token(Token = "0x2001D35")]
public class CmsEnvelopedDataParser : CmsContentInfoParser
{
// Token: 0x0600BD38 RID: 48440 RVA: 0x002B0BD4 File Offset: 0x002AEDD4
[Token(Token = "0x600BD38")]
[Address(RVA = "0x1663570", Offset = "0x1662370", VA = "0x181663570")]
public CmsEnvelopedDataParser(byte[] envelopedData)
{
int num;
MemoryStream memoryStream = new MemoryStream(envelopedData, num != 0);
num = 0;
}
// Token: 0x0600BD39 RID: 48441 RVA: 0x002B0BEC File Offset: 0x002AEDEC
[Token(Token = "0x600BD39")]
[Address(RVA = "0x16635E0", Offset = "0x16623E0", VA = "0x1816635E0")]
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: 0x17001D51 RID: 7505
// (get) Token: 0x0600BD3A RID: 48442 RVA: 0x002B0C98 File Offset: 0x002AEE98
[Token(Token = "0x17001D51")]
public AlgorithmIdentifier EncryptionAlgorithmID
{
[Token(Token = "0x600BD3A")]
[Address(RVA = "0x3FA180", Offset = "0x3F8F80", VA = "0x1803FA180")]
get
{
return this._encAlg;
}
}
// Token: 0x17001D52 RID: 7506
// (get) Token: 0x0600BD3B RID: 48443 RVA: 0x002B0CAC File Offset: 0x002AEEAC
[Token(Token = "0x17001D52")]
public string EncryptionAlgOid
{
[Token(Token = "0x600BD3B")]
[Address(RVA = "0x1660400", Offset = "0x165F200", VA = "0x181660400")]
get
{
Asn1Object asn1Object = this._encAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001D53 RID: 7507
// (get) Token: 0x0600BD3C RID: 48444 RVA: 0x002B0CCC File Offset: 0x002AEECC
[Token(Token = "0x17001D53")]
public Asn1Object EncryptionAlgParams
{
[Token(Token = "0x600BD3C")]
[Address(RVA = "0x1660440", Offset = "0x165F240", VA = "0x181660440")]
get
{
DerObjectIdentifier objectID = this._encAlg.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600BD3D RID: 48445 RVA: 0x002B0CF8 File Offset: 0x002AEEF8
[Token(Token = "0x600BD3D")]
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
public RecipientInformationStore GetRecipientInfos()
{
return this.recipientInfoStore;
}
// Token: 0x0600BD3E RID: 48446 RVA: 0x002B0D0C File Offset: 0x002AEF0C
[Token(Token = "0x600BD3E")]
[Address(RVA = "0x16632B0", Offset = "0x16620B0", VA = "0x1816632B0")]
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: 0x0400787A RID: 30842
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400787A")]
internal RecipientInformationStore recipientInfoStore;
// Token: 0x0400787B RID: 30843
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400787B")]
internal EnvelopedDataParser envelopedData;
// Token: 0x0400787C RID: 30844
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400787C")]
private AlgorithmIdentifier _encAlg;
// Token: 0x0400787D RID: 30845
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x400787D")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable _unprotectedAttributes;
// Token: 0x0400787E RID: 30846
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x400787E")]
private bool _attrNotRead;
}
}
@@ -0,0 +1,300 @@
using System;
using System.Collections;
using System.IO;
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: 0x02001D36 RID: 7478
[Token(Token = "0x2001D36")]
public class CmsEnvelopedDataStreamGenerator : CmsEnvelopedGenerator
{
// Token: 0x0600BD3F RID: 48447 RVA: 0x002B0DBC File Offset: 0x002AEFBC
[Token(Token = "0x600BD3F")]
[Address(RVA = "0x16643D0", Offset = "0x16631D0", VA = "0x1816643D0")]
public CmsEnvelopedDataStreamGenerator()
{
}
// Token: 0x0600BD40 RID: 48448 RVA: 0x002B0DD0 File Offset: 0x002AEFD0
[Token(Token = "0x600BD40")]
[Address(RVA = "0x1664430", Offset = "0x1663230", VA = "0x181664430")]
public CmsEnvelopedDataStreamGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this.recipientInfoGenerators = list;
base..ctor();
this.rand = rand;
}
// Token: 0x0600BD41 RID: 48449 RVA: 0x002B0DFC File Offset: 0x002AEFFC
[Token(Token = "0x600BD41")]
[Address(RVA = "0x52C070", Offset = "0x52AE70", VA = "0x18052C070")]
public void SetBufferSize(int bufferSize)
{
this._bufferSize = bufferSize;
}
// Token: 0x0600BD42 RID: 48450 RVA: 0x002B0E10 File Offset: 0x002AF010
[Token(Token = "0x600BD42")]
[Address(RVA = "0x4508B0", Offset = "0x44F6B0", VA = "0x1804508B0")]
public void SetBerEncodeRecipients(bool berEncodeRecipientSet)
{
this._berEncodeRecipientSet = berEncodeRecipientSet;
}
// Token: 0x17001D54 RID: 7508
// (get) Token: 0x0600BD43 RID: 48451 RVA: 0x002B0E24 File Offset: 0x002AF024
[Token(Token = "0x17001D54")]
private DerInteger Version
{
[Token(Token = "0x600BD43")]
[Address(RVA = "0x16644E0", Offset = "0x16632E0", VA = "0x1816644E0")]
get
{
if (this._originatorInfo != (ulong)0L || this._unprotectedAttributes == (ulong)0L)
{
}
return new DerInteger(2);
}
}
// Token: 0x0600BD44 RID: 48452 RVA: 0x002B0E50 File Offset: 0x002AF050
[Token(Token = "0x600BD44")]
[Address(RVA = "0x1664040", Offset = "0x1662E40", VA = "0x181664040")]
private Stream Open(Stream outStream, string encryptionOid, CipherKeyGenerator keyGen)
{
Asn1EncodableVector asn1EncodableVector;
for (;;)
{
int num = 0;
byte[] array = keyGen.GenerateKey();
KeyParameter keyParameter = ParameterUtilities.CreateKeyParameter(encryptionOid, array);
string text = this.ToString();
IList recipientInfoGenerators = this.recipientInfoGenerators;
if (asn1EncodableVector != 0)
{
break;
}
ArrayTypeMismatchException ex;
if (ex != 0)
{
}
if (num == 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: 0x0600BD45 RID: 48453 RVA: 0x002B0F04 File Offset: 0x002AF104
[Token(Token = "0x600BD45")]
[Address(RVA = "0x1663810", Offset = "0x1662610", VA = "0x181663810")]
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 == 0)
{
Stream rawOutputStream = derSetGenerator.GetRawOutputStream();
BerSequenceGenerator berSequenceGenerator3;
string text4 = berSequenceGenerator3.ToString();
string text5 = berSequenceGenerator3.ToString();
int num2 = 0;
SecureRandom rand = this.rand;
ParametersWithRandom parametersWithRandom = new ParametersWithRandom(num2, rand);
Stream stream;
int num3;
IBufferedCipher bufferedCipher;
CipherStream cipherStream = new CipherStream(stream, num3, bufferedCipher);
num3 = 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.", num3);
throw new NullReferenceException();
}
throw new NullReferenceException();
}
// Token: 0x0600BD46 RID: 48454 RVA: 0x002B104C File Offset: 0x002AF24C
[Token(Token = "0x600BD46")]
[Address(RVA = "0x1663E60", Offset = "0x1662C60", VA = "0x181663E60")]
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: 0x0600BD47 RID: 48455 RVA: 0x002B108C File Offset: 0x002AF28C
[Token(Token = "0x600BD47")]
[Address(RVA = "0x1663F50", Offset = "0x1662D50", VA = "0x181663F50")]
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: 0x0400787F RID: 30847
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400787F")]
private object _originatorInfo;
// Token: 0x04007880 RID: 30848
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007880")]
private object _unprotectedAttributes;
// Token: 0x04007881 RID: 30849
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007881")]
private int _bufferSize;
// Token: 0x04007882 RID: 30850
[FieldOffset(Offset = "0x3C")]
[Token(Token = "0x4007882")]
private bool _berEncodeRecipientSet;
// Token: 0x02001D37 RID: 7479
[Token(Token = "0x2001D37")]
private class CmsEnvelopedDataOutputStream : BaseOutputStream
{
// Token: 0x0600BD48 RID: 48456 RVA: 0x002B10C4 File Offset: 0x002AF2C4
[Token(Token = "0x600BD48")]
[Address(RVA = "0x165FAC0", Offset = "0x165E8C0", VA = "0x18165FAC0")]
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: 0x0600BD49 RID: 48457 RVA: 0x002B10FC File Offset: 0x002AF2FC
[Token(Token = "0x600BD49")]
[Address(RVA = "0x1663250", Offset = "0x1662050", VA = "0x181663250", Slot = "30")]
public override void WriteByte(byte b)
{
((IDisposable)this._out).Dispose();
}
// Token: 0x0600BD4A RID: 48458 RVA: 0x002B111C File Offset: 0x002AF31C
[Token(Token = "0x600BD4A")]
[Address(RVA = "0x1663280", Offset = "0x1662080", VA = "0x181663280", Slot = "29")]
public override void Write(byte[] bytes, int off, int len)
{
int num = this._out.Read(bytes, off, len);
}
// Token: 0x0600BD4B RID: 48459 RVA: 0x002B1140 File Offset: 0x002AF340
[Token(Token = "0x600BD4B")]
[Address(RVA = "0x1663090", Offset = "0x1661E90", VA = "0x181663090", 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: 0x04007883 RID: 30851
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007883")]
private readonly CmsEnvelopedGenerator _outer;
// Token: 0x04007884 RID: 30852
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007884")]
private readonly CipherStream _out;
// Token: 0x04007885 RID: 30853
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007885")]
private readonly BerSequenceGenerator _cGen;
// Token: 0x04007886 RID: 30854
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007886")]
private readonly BerSequenceGenerator _envGen;
// Token: 0x04007887 RID: 30855
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x4007887")]
private readonly BerSequenceGenerator _eiGen;
}
}
}
@@ -0,0 +1,366 @@
using System;
using System.Collections;
using System.Runtime.CompilerServices;
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: 0x02001D38 RID: 7480
[Token(Token = "0x2001D38")]
public class CmsEnvelopedGenerator
{
// Token: 0x0600BD4C RID: 48460 RVA: 0x002B11C8 File Offset: 0x002AF3C8
[Token(Token = "0x600BD4C")]
[Address(RVA = "0x1665800", Offset = "0x1664600", VA = "0x181665800")]
public CmsEnvelopedGenerator()
{
SecureRandom secureRandom = new SecureRandom();
IList list = Platform.CreateArrayList();
this.recipientInfoGenerators = list;
base..ctor();
this.rand = secureRandom;
}
// Token: 0x0600BD4D RID: 48461 RVA: 0x002B11F8 File Offset: 0x002AF3F8
[Token(Token = "0x600BD4D")]
[Address(RVA = "0x1665790", Offset = "0x1664590", VA = "0x181665790")]
public CmsEnvelopedGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this.recipientInfoGenerators = list;
base..ctor();
this.rand = rand;
}
// Token: 0x17001D55 RID: 7509
// (get) Token: 0x0600BD4E RID: 48462 RVA: 0x002B1224 File Offset: 0x002AF424
// (set) Token: 0x0600BD4F RID: 48463 RVA: 0x002B1238 File Offset: 0x002AF438
[Token(Token = "0x17001D55")]
public CmsAttributeTableGenerator UnprotectedAttributeGenerator
{
[Token(Token = "0x600BD4E")]
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
get
{
return this.unprotectedAttributeGenerator;
}
[Token(Token = "0x600BD4F")]
[Address(RVA = "0x460F90", Offset = "0x45FD90", VA = "0x180460F90")]
set
{
this.unprotectedAttributeGenerator = value;
}
}
// Token: 0x0600BD50 RID: 48464 RVA: 0x002B124C File Offset: 0x002AF44C
[Token(Token = "0x600BD50")]
[Address(RVA = "0x1664DB0", Offset = "0x1663BB0", VA = "0x181664DB0")]
public void AddKeyTransRecipient(X509Certificate cert)
{
new KeyTransRecipientInfoGenerator().RecipientCert = cert;
IList list = this.recipientInfoGenerators;
throw new NullReferenceException();
}
// Token: 0x0600BD51 RID: 48465 RVA: 0x002B1270 File Offset: 0x002AF470
[Token(Token = "0x600BD51")]
[Address(RVA = "0x1664CF0", Offset = "0x1663AF0", VA = "0x181664CF0")]
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: 0x0600BD52 RID: 48466 RVA: 0x002B12A4 File Offset: 0x002AF4A4
[Token(Token = "0x600BD52")]
[Address(RVA = "0x1664760", Offset = "0x1663560", VA = "0x181664760")]
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: 0x0600BD53 RID: 48467 RVA: 0x002B12EC File Offset: 0x002AF4EC
[Token(Token = "0x600BD53")]
[Address(RVA = "0x1664860", Offset = "0x1663660", VA = "0x181664860")]
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: 0x0600BD54 RID: 48468 RVA: 0x002B1320 File Offset: 0x002AF520
[Token(Token = "0x600BD54")]
[Address(RVA = "0x1664E40", Offset = "0x1663C40", VA = "0x181664E40")]
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: 0x0600BD55 RID: 48469 RVA: 0x002B1388 File Offset: 0x002AF588
[Token(Token = "0x600BD55")]
[Address(RVA = "0x1664920", Offset = "0x1663720", VA = "0x181664920")]
public void AddKeyAgreementRecipient(string agreementAlgorithm, AsymmetricKeyParameter senderPrivateKey, AsymmetricKeyParameter senderPublicKey, X509Certificate recipientCert, string cekWrapAlgorithm)
{
/*
An exception occurred when decompiling this method (0600BD55)
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 1660
*/;
}
// Token: 0x0600BD56 RID: 48470 RVA: 0x002B1400 File Offset: 0x002AF600
[Token(Token = "0x600BD56")]
[Address(RVA = "0x1664B40", Offset = "0x1663940", VA = "0x181664B40")]
public void AddKeyAgreementRecipients(string agreementAlgorithm, AsymmetricKeyParameter senderPrivateKey, AsymmetricKeyParameter senderPublicKey, ICollection recipientCerts, string cekWrapAlgorithm)
{
/*
An exception occurred when decompiling this method (0600BD56)
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 1660
*/;
}
// Token: 0x0600BD57 RID: 48471 RVA: 0x002B1468 File Offset: 0x002AF668
[Token(Token = "0x600BD57")]
[Address(RVA = "0x16651A0", Offset = "0x1663FA0", VA = "0x1816651A0", 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: 0x0600BD58 RID: 48472 RVA: 0x002B1498 File Offset: 0x002AF698
[Token(Token = "0x600BD58")]
[Address(RVA = "0x1664FD0", Offset = "0x1663DD0", VA = "0x181664FD0", 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: 0x0600BD59 RID: 48473 RVA: 0x002B1518 File Offset: 0x002AF718
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600BD59")]
[Address(RVA = "0x16652C0", Offset = "0x16640C0", VA = "0x1816652C0")]
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: 0x04007888 RID: 30856
[Token(Token = "0x4007888")]
internal static readonly short[] rc2Table;
// Token: 0x04007889 RID: 30857
[Token(Token = "0x4007889")]
public static readonly string DesEde3Cbc;
// Token: 0x0400788A RID: 30858
[Token(Token = "0x400788A")]
public static readonly string RC2Cbc;
// Token: 0x0400788B RID: 30859
[Token(Token = "0x400788B")]
public const string IdeaCbc = "1.3.6.1.4.1.188.7.1.1.2";
// Token: 0x0400788C RID: 30860
[Token(Token = "0x400788C")]
public const string Cast5Cbc = "1.2.840.113533.7.66.10";
// Token: 0x0400788D RID: 30861
[Token(Token = "0x400788D")]
public static readonly string Aes128Cbc;
// Token: 0x0400788E RID: 30862
[Token(Token = "0x400788E")]
public static readonly string Aes192Cbc;
// Token: 0x0400788F RID: 30863
[Token(Token = "0x400788F")]
public static readonly string Aes256Cbc;
// Token: 0x04007890 RID: 30864
[Token(Token = "0x4007890")]
public static readonly string Camellia128Cbc;
// Token: 0x04007891 RID: 30865
[Token(Token = "0x4007891")]
public static readonly string Camellia192Cbc;
// Token: 0x04007892 RID: 30866
[Token(Token = "0x4007892")]
public static readonly string Camellia256Cbc;
// Token: 0x04007893 RID: 30867
[Token(Token = "0x4007893")]
public static readonly string SeedCbc;
// Token: 0x04007894 RID: 30868
[Token(Token = "0x4007894")]
public static readonly string DesEde3Wrap;
// Token: 0x04007895 RID: 30869
[Token(Token = "0x4007895")]
public static readonly string Aes128Wrap;
// Token: 0x04007896 RID: 30870
[Token(Token = "0x4007896")]
public static readonly string Aes192Wrap;
// Token: 0x04007897 RID: 30871
[Token(Token = "0x4007897")]
public static readonly string Aes256Wrap;
// Token: 0x04007898 RID: 30872
[Token(Token = "0x4007898")]
public static readonly string Camellia128Wrap;
// Token: 0x04007899 RID: 30873
[Token(Token = "0x4007899")]
public static readonly string Camellia192Wrap;
// Token: 0x0400789A RID: 30874
[Token(Token = "0x400789A")]
public static readonly string Camellia256Wrap;
// Token: 0x0400789B RID: 30875
[Token(Token = "0x400789B")]
public static readonly string SeedWrap;
// Token: 0x0400789C RID: 30876
[Token(Token = "0x400789C")]
public static readonly string ECDHSha1Kdf;
// Token: 0x0400789D RID: 30877
[Token(Token = "0x400789D")]
public static readonly string ECMqvSha1Kdf;
// Token: 0x0400789E RID: 30878
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400789E")]
internal readonly IList recipientInfoGenerators;
// Token: 0x0400789F RID: 30879
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400789F")]
internal readonly SecureRandom rand;
// Token: 0x040078A0 RID: 30880
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40078A0")]
internal CmsAttributeTableGenerator unprotectedAttributeGenerator;
}
}
@@ -0,0 +1,368 @@
using System;
using System.Collections;
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: 0x02001D39 RID: 7481
[Token(Token = "0x2001D39")]
internal class CmsEnvelopedHelper
{
// Token: 0x0600BD5A RID: 48474 RVA: 0x002B1664 File Offset: 0x002AF864
[Token(Token = "0x600BD5A")]
[Address(RVA = "0x16661D0", Offset = "0x1664FD0", VA = "0x1816661D0")]
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: 0x0600BD5B RID: 48475 RVA: 0x002B16D4 File Offset: 0x002AF8D4
[Token(Token = "0x600BD5B")]
[Address(RVA = "0x1665B70", Offset = "0x1664970", VA = "0x181665B70")]
private string GetAsymmetricEncryptionAlgName(string encryptionAlgOid)
{
bool flag = PkcsObjectIdentifiers.RsaEncryption.identifier.Equals(encryptionAlgOid);
return encryptionAlgOid;
}
// Token: 0x0600BD5C RID: 48476 RVA: 0x002B16FC File Offset: 0x002AF8FC
[Token(Token = "0x600BD5C")]
[Address(RVA = "0x16659C0", Offset = "0x16647C0", VA = "0x1816659C0")]
internal IBufferedCipher CreateAsymmetricCipher(string encryptionOid)
{
string asymmetricEncryptionAlgName = this.GetAsymmetricEncryptionAlgName(encryptionOid);
if (!asymmetricEncryptionAlgName.Equals(encryptionOid))
{
return CipherUtilities.GetCipher(asymmetricEncryptionAlgName);
}
return CipherUtilities.GetCipher(encryptionOid);
}
// Token: 0x0600BD5D RID: 48477 RVA: 0x002B1730 File Offset: 0x002AF930
[Token(Token = "0x600BD5D")]
[Address(RVA = "0x1665AB0", Offset = "0x16648B0", VA = "0x181665AB0")]
internal IWrapper CreateWrapper(string encryptionOid)
{
IWrapper wrapper = WrapperUtilities.GetWrapper(encryptionOid);
string text;
return WrapperUtilities.GetWrapper(text);
}
// Token: 0x0600BD5E RID: 48478 RVA: 0x002B174C File Offset: 0x002AF94C
[Token(Token = "0x600BD5E")]
[Address(RVA = "0x1665D50", Offset = "0x1664B50", VA = "0x181665D50")]
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: 0x0600BD5F RID: 48479 RVA: 0x002B1784 File Offset: 0x002AF984
[Token(Token = "0x600BD5F")]
[Address(RVA = "0x1665C00", Offset = "0x1664A00", VA = "0x181665C00")]
internal int GetKeySize(string oid)
{
IDictionary keySizes = CmsEnvelopedHelper.KeySizes;
IDictionary keySizes2 = CmsEnvelopedHelper.KeySizes;
CmsEnvelopedHelper instance = CmsEnvelopedHelper.Instance;
throw new NullReferenceException();
}
// Token: 0x0600BD60 RID: 48480 RVA: 0x002B17C4 File Offset: 0x002AF9C4
[Token(Token = "0x600BD60")]
[Address(RVA = "0x16658A0", Offset = "0x16646A0", VA = "0x1816658A0")]
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: 0x0600BD61 RID: 48481 RVA: 0x002B1800 File Offset: 0x002AFA00
[Token(Token = "0x600BD61")]
[Address(RVA = "0x1665E90", Offset = "0x1664C90", VA = "0x181665E90")]
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: 0x0600BD62 RID: 48482 RVA: 0x002B184C File Offset: 0x002AFA4C
[Token(Token = "0x600BD62")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public CmsEnvelopedHelper()
{
}
// Token: 0x040078A1 RID: 30881
[Token(Token = "0x40078A1")]
internal static readonly CmsEnvelopedHelper Instance = new CmsEnvelopedHelper();
// Token: 0x040078A2 RID: 30882
[Token(Token = "0x40078A2")]
private static readonly IDictionary KeySizes;
// Token: 0x040078A3 RID: 30883
[Token(Token = "0x40078A3")]
private static readonly IDictionary BaseCipherNames;
// Token: 0x02001D3A RID: 7482
[Token(Token = "0x2001D3A")]
internal class CmsAuthenticatedSecureReadable : CmsSecureReadable
{
// Token: 0x0600BD63 RID: 48483 RVA: 0x002B1860 File Offset: 0x002AFA60
[Token(Token = "0x600BD63")]
[Address(RVA = "0x1661660", Offset = "0x1660460", VA = "0x181661660")]
internal CmsAuthenticatedSecureReadable(AlgorithmIdentifier algorithm, CmsReadable readable)
{
this.algorithm = algorithm;
this.readable = readable;
}
// Token: 0x17001D56 RID: 7510
// (get) Token: 0x0600BD64 RID: 48484 RVA: 0x002B1884 File Offset: 0x002AFA84
[Token(Token = "0x17001D56")]
public AlgorithmIdentifier Algorithm
{
[Token(Token = "0x600BD64")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20", Slot = "4")]
get
{
return this.algorithm;
}
}
// Token: 0x17001D57 RID: 7511
// (get) Token: 0x0600BD65 RID: 48485 RVA: 0x002B1898 File Offset: 0x002AFA98
[Token(Token = "0x17001D57")]
public object CryptoObject
{
[Token(Token = "0x600BD65")]
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40", Slot = "5")]
get
{
/*
An exception occurred when decompiling this method (0600BD65)
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 1660
*/;
}
}
// Token: 0x0600BD66 RID: 48486 RVA: 0x002B18AC File Offset: 0x002AFAAC
[Token(Token = "0x600BD66")]
[Address(RVA = "0x1661420", Offset = "0x1660220", VA = "0x181661420", 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: 0x040078A4 RID: 30884
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40078A4")]
private AlgorithmIdentifier algorithm;
// Token: 0x040078A5 RID: 30885
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40078A5")]
private IMac mac;
// Token: 0x040078A6 RID: 30886
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40078A6")]
private CmsReadable readable;
}
// Token: 0x02001D3B RID: 7483
[Token(Token = "0x2001D3B")]
internal class CmsEnvelopedSecureReadable : CmsSecureReadable
{
// Token: 0x0600BD67 RID: 48487 RVA: 0x002B18FC File Offset: 0x002AFAFC
[Token(Token = "0x600BD67")]
[Address(RVA = "0x1661660", Offset = "0x1660460", VA = "0x181661660")]
internal CmsEnvelopedSecureReadable(AlgorithmIdentifier algorithm, CmsReadable readable)
{
this.algorithm = algorithm;
this.readable = readable;
}
// Token: 0x17001D58 RID: 7512
// (get) Token: 0x0600BD68 RID: 48488 RVA: 0x002B1920 File Offset: 0x002AFB20
[Token(Token = "0x17001D58")]
public AlgorithmIdentifier Algorithm
{
[Token(Token = "0x600BD68")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20", Slot = "4")]
get
{
return this.algorithm;
}
}
// Token: 0x17001D59 RID: 7513
// (get) Token: 0x0600BD69 RID: 48489 RVA: 0x002B1934 File Offset: 0x002AFB34
[Token(Token = "0x17001D59")]
public object CryptoObject
{
[Token(Token = "0x600BD69")]
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40", Slot = "5")]
get
{
/*
An exception occurred when decompiling this method (0600BD69)
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 1660
*/;
}
}
// Token: 0x0600BD6A RID: 48490 RVA: 0x002B1948 File Offset: 0x002AFB48
[Token(Token = "0x600BD6A")]
[Address(RVA = "0x1666550", Offset = "0x1665350", VA = "0x181666550", 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: 0x040078A7 RID: 30887
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40078A7")]
private AlgorithmIdentifier algorithm;
// Token: 0x040078A8 RID: 30888
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40078A8")]
private IBufferedCipher cipher;
// Token: 0x040078A9 RID: 30889
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40078A9")]
private CmsReadable readable;
}
}
}
@@ -0,0 +1,34 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D3C RID: 7484
[Token(Token = "0x2001D3C")]
[Serializable]
public class CmsException : Exception
{
// Token: 0x0600BD6B RID: 48491 RVA: 0x002B1A18 File Offset: 0x002AFC18
[Token(Token = "0x600BD6B")]
[Address(RVA = "0x165EC90", Offset = "0x165DA90", VA = "0x18165EC90")]
public CmsException()
{
}
// Token: 0x0600BD6C RID: 48492 RVA: 0x002B1A2C File Offset: 0x002AFC2C
[Token(Token = "0x600BD6C")]
[Address(RVA = "0x165ED70", Offset = "0x165DB70", VA = "0x18165ED70")]
public CmsException(string msg)
: base(msg)
{
}
// Token: 0x0600BD6D RID: 48493 RVA: 0x002B1A40 File Offset: 0x002AFC40
[Token(Token = "0x600BD6D")]
[Address(RVA = "0x165ECF0", Offset = "0x165DAF0", VA = "0x18165ECF0")]
public CmsException(string msg, Exception e)
: base(msg, e)
{
}
}
}
@@ -0,0 +1,196 @@
using System;
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: 0x02001D3D RID: 7485
[Token(Token = "0x2001D3D")]
public abstract class CmsPbeKey : ICipherParameters
{
// Token: 0x0600BD6E RID: 48494 RVA: 0x002B1A58 File Offset: 0x002AFC58
[Token(Token = "0x600BD6E")]
[Address(RVA = "0x1666C80", Offset = "0x1665A80", VA = "0x181666C80")]
[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: 0x0600BD6F RID: 48495 RVA: 0x002B1A9C File Offset: 0x002AFC9C
[Token(Token = "0x600BD6F")]
[Address(RVA = "0x1666C30", Offset = "0x1665A30", VA = "0x181666C30")]
[Obsolete]
public CmsPbeKey(string password, AlgorithmIdentifier keyDerivationAlgorithm)
{
char[] array = password.ToCharArray();
}
// Token: 0x0600BD70 RID: 48496 RVA: 0x002B1AB8 File Offset: 0x002AFCB8
[Token(Token = "0x600BD70")]
[Address(RVA = "0x1666D70", Offset = "0x1665B70", VA = "0x181666D70")]
public CmsPbeKey(char[] password, byte[] salt, int iterationCount)
{
byte[] array = Arrays.Clone(salt);
this.iterationCount = iterationCount;
this.salt = array;
}
// Token: 0x0600BD71 RID: 48497 RVA: 0x002B1AE8 File Offset: 0x002AFCE8
[Token(Token = "0x600BD71")]
[Address(RVA = "0x1666A30", Offset = "0x1665830", VA = "0x181666A30")]
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: 0x0600BD72 RID: 48498 RVA: 0x002B1B4C File Offset: 0x002AFD4C
[Token(Token = "0x600BD72")]
[Address(RVA = "0x1666940", Offset = "0x1665740", VA = "0x181666940", 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();
}
while (num != 0);
}
// Token: 0x17001D5A RID: 7514
// (get) Token: 0x0600BD73 RID: 48499 RVA: 0x002B1B84 File Offset: 0x002AFD84
[Token(Token = "0x17001D5A")]
[Obsolete]
public string Password
{
[Token(Token = "0x600BD73")]
[Address(RVA = "0x1666EB0", Offset = "0x1665CB0", VA = "0x181666EB0")]
get
{
char[] array = this.password;
string text;
return text;
}
}
// Token: 0x17001D5B RID: 7515
// (get) Token: 0x0600BD74 RID: 48500 RVA: 0x002B1B9C File Offset: 0x002AFD9C
[Token(Token = "0x17001D5B")]
public byte[] Salt
{
[Token(Token = "0x600BD74")]
[Address(RVA = "0x16669D0", Offset = "0x16657D0", VA = "0x1816669D0")]
get
{
return Arrays.Clone(this.salt);
}
}
// Token: 0x0600BD75 RID: 48501 RVA: 0x002B1BB4 File Offset: 0x002AFDB4
[Token(Token = "0x600BD75")]
[Address(RVA = "0x16669D0", Offset = "0x16657D0", VA = "0x1816669D0")]
[Obsolete]
public byte[] GetSalt()
{
return Arrays.Clone(this.salt);
}
// Token: 0x17001D5C RID: 7516
// (get) Token: 0x0600BD76 RID: 48502 RVA: 0x002B1BCC File Offset: 0x002AFDCC
[Token(Token = "0x17001D5C")]
public int IterationCount
{
[Token(Token = "0x600BD76")]
[Address(RVA = "0x3F7310", Offset = "0x3F6110", VA = "0x1803F7310")]
get
{
return this.iterationCount;
}
}
// Token: 0x17001D5D RID: 7517
// (get) Token: 0x0600BD77 RID: 48503 RVA: 0x002B1BE0 File Offset: 0x002AFDE0
[Token(Token = "0x17001D5D")]
public string Algorithm
{
[Token(Token = "0x600BD77")]
[Address(RVA = "0x1666E50", Offset = "0x1665C50", VA = "0x181666E50")]
get
{
return "PKCS5S2";
}
}
// Token: 0x17001D5E RID: 7518
// (get) Token: 0x0600BD78 RID: 48504 RVA: 0x002B1BF4 File Offset: 0x002AFDF4
[Token(Token = "0x17001D5E")]
public string Format
{
[Token(Token = "0x600BD78")]
[Address(RVA = "0x1666E80", Offset = "0x1665C80", VA = "0x181666E80")]
get
{
return "RAW";
}
}
// Token: 0x0600BD79 RID: 48505 RVA: 0x002B1C08 File Offset: 0x002AFE08
[Token(Token = "0x600BD79")]
[Address(RVA = "0x43E630", Offset = "0x43D430", VA = "0x18043E630")]
public byte[] GetEncoded()
{
}
// Token: 0x0600BD7A RID: 48506
[Token(Token = "0x600BD7A")]
[Address(Slot = "4")]
internal abstract KeyParameter GetEncoded(string algorithmOid);
// Token: 0x040078AA RID: 30890
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40078AA")]
internal readonly char[] password;
// Token: 0x040078AB RID: 30891
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40078AB")]
internal readonly byte[] salt;
// Token: 0x040078AC RID: 30892
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40078AC")]
internal readonly int iterationCount;
}
}
@@ -0,0 +1,22 @@
using System;
using System.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D3E RID: 7486
[Token(Token = "0x2001D3E")]
public interface CmsProcessable
{
// Token: 0x0600BD7B RID: 48507
[Token(Token = "0x600BD7B")]
[Address(Slot = "0")]
void Write(Stream outStream);
// Token: 0x0600BD7C RID: 48508
[Token(Token = "0x600BD7C")]
[Address(Slot = "1")]
[Obsolete]
object GetContent();
}
}
@@ -0,0 +1,70 @@
using System;
using System.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D3F RID: 7487
[Token(Token = "0x2001D3F")]
public class CmsProcessableByteArray : CmsProcessable, CmsReadable
{
// Token: 0x0600BD7D RID: 48509 RVA: 0x002B1C18 File Offset: 0x002AFE18
[Token(Token = "0x600BD7D")]
[Address(RVA = "0x3FFB80", Offset = "0x3FE980", VA = "0x1803FFB80")]
public CmsProcessableByteArray(byte[] bytes)
{
this.bytes = bytes;
}
// Token: 0x0600BD7E RID: 48510 RVA: 0x002B1C34 File Offset: 0x002AFE34
[Token(Token = "0x600BD7E")]
[Address(RVA = "0x1666EE0", Offset = "0x1665CE0", VA = "0x181666EE0", Slot = "7")]
public virtual Stream GetInputStream()
{
/*
An exception occurred when decompiling this method (0600BD7E)
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 1660
*/;
}
// Token: 0x0600BD7F RID: 48511 RVA: 0x002B1C50 File Offset: 0x002AFE50
[Token(Token = "0x600BD7F")]
[Address(RVA = "0x1666F40", Offset = "0x1665D40", VA = "0x181666F40", Slot = "8")]
public virtual void Write(Stream zOut)
{
byte[] array = this.bytes;
int num = zOut.ReadByte();
}
// Token: 0x0600BD80 RID: 48512 RVA: 0x002B1C74 File Offset: 0x002AFE74
[Token(Token = "0x600BD80")]
[Address(RVA = "0x1666EC0", Offset = "0x1665CC0", VA = "0x181666EC0", Slot = "9")]
[Obsolete]
public virtual object GetContent()
{
byte[] array = this.bytes;
throw new NullReferenceException();
}
// Token: 0x040078AD RID: 30893
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40078AD")]
private readonly byte[] bytes;
}
}
@@ -0,0 +1,92 @@
using System;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D40 RID: 7488
[Token(Token = "0x2001D40")]
public class CmsProcessableFile : CmsProcessable, CmsReadable
{
// Token: 0x0600BD81 RID: 48513 RVA: 0x002B1C90 File Offset: 0x002AFE90
[Token(Token = "0x600BD81")]
[Address(RVA = "0x16670B0", Offset = "0x1665EB0", VA = "0x1816670B0")]
public CmsProcessableFile(FileInfo file)
{
this._file = file;
this._bufSize = (int)((ulong)32768L);
}
// Token: 0x0600BD82 RID: 48514 RVA: 0x002B1CB8 File Offset: 0x002AFEB8
[Token(Token = "0x600BD82")]
[Address(RVA = "0x4F34F0", Offset = "0x4F22F0", VA = "0x1804F34F0")]
public CmsProcessableFile(FileInfo file, int bufSize)
{
this._file = file;
this._bufSize = bufSize;
}
// Token: 0x0600BD83 RID: 48515 RVA: 0x002B1CDC File Offset: 0x002AFEDC
[Token(Token = "0x600BD83")]
[Address(RVA = "0x1666F80", Offset = "0x1665D80", VA = "0x181666F80", Slot = "7")]
public virtual Stream GetInputStream()
{
FileInfo file = this._file;
int bufSize = this._bufSize;
throw new NullReferenceException();
}
// Token: 0x0600BD84 RID: 48516 RVA: 0x002B1CFC File Offset: 0x002AFEFC
[Token(Token = "0x600BD84")]
[Address(RVA = "0x1667020", Offset = "0x1665E20", VA = "0x181667020", Slot = "8")]
public virtual void Write(Stream zOut)
{
Stream inputStream = this.GetInputStream();
Streams.PipeAll(inputStream, zOut);
Platform.Dispose(inputStream);
}
// Token: 0x0600BD85 RID: 48517 RVA: 0x002B1D20 File Offset: 0x002AFF20
[Token(Token = "0x600BD85")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20", Slot = "9")]
[Obsolete]
public virtual object GetContent()
{
/*
An exception occurred when decompiling this method (0600BD85)
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 1660
*/;
}
// Token: 0x040078AE RID: 30894
[Token(Token = "0x40078AE")]
private const int DefaultBufSize = 32768;
// Token: 0x040078AF RID: 30895
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40078AF")]
private readonly FileInfo _file;
// Token: 0x040078B0 RID: 30896
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40078B0")]
private readonly int _bufSize;
}
}
@@ -0,0 +1,85 @@
using System;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D41 RID: 7489
[Token(Token = "0x2001D41")]
public class CmsProcessableInputStream : CmsProcessable, CmsReadable
{
// Token: 0x0600BD86 RID: 48518 RVA: 0x002B1D34 File Offset: 0x002AFF34
[Token(Token = "0x600BD86")]
[Address(RVA = "0x3FFB80", Offset = "0x3FE980", VA = "0x1803FFB80")]
public CmsProcessableInputStream(Stream input)
{
this.input = input;
}
// Token: 0x0600BD87 RID: 48519 RVA: 0x002B1D50 File Offset: 0x002AFF50
[Token(Token = "0x600BD87")]
[Address(RVA = "0x16671C0", Offset = "0x1665FC0", VA = "0x1816671C0", Slot = "7")]
public virtual Stream GetInputStream()
{
object content = this.GetContent();
return this.input;
}
// Token: 0x0600BD88 RID: 48520 RVA: 0x002B1D6C File Offset: 0x002AFF6C
[Token(Token = "0x600BD88")]
[Address(RVA = "0x16671F0", Offset = "0x1665FF0", VA = "0x1816671F0", Slot = "8")]
public virtual void Write(Stream output)
{
object content = this.GetContent();
Streams.PipeAll(this.input, output);
Platform.Dispose(this.input);
}
// Token: 0x0600BD89 RID: 48521 RVA: 0x002B1D98 File Offset: 0x002AFF98
[Token(Token = "0x600BD89")]
[Address(RVA = "0x461C60", Offset = "0x460A60", VA = "0x180461C60", Slot = "9")]
[Obsolete]
public virtual object GetContent()
{
return ((CmsProcessable)this).GetContent();
}
// Token: 0x0600BD8A RID: 48522 RVA: 0x002B1DAC File Offset: 0x002AFFAC
[Token(Token = "0x600BD8A")]
[Address(RVA = "0x16670E0", Offset = "0x1665EE0", VA = "0x1816670E0", Slot = "10")]
protected virtual void CheckSingleUsage()
{
/*
An exception occurred when decompiling this method (0600BD8A)
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_1D:
stloc:InvalidOperationException(var_1_27, 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 1660
*/;
}
// Token: 0x040078B1 RID: 30897
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40078B1")]
private readonly Stream input;
// Token: 0x040078B2 RID: 30898
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40078B2")]
private bool used;
}
}
@@ -0,0 +1,16 @@
using System;
using System.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D42 RID: 7490
[Token(Token = "0x2001D42")]
public interface CmsReadable
{
// Token: 0x0600BD8B RID: 48523
[Token(Token = "0x600BD8B")]
[Address(Slot = "0")]
Stream GetInputStream();
}
}
@@ -0,0 +1,37 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D43 RID: 7491
[Token(Token = "0x2001D43")]
internal interface CmsSecureReadable
{
// Token: 0x17001D5F RID: 7519
// (get) Token: 0x0600BD8C RID: 48524
[Token(Token = "0x17001D5F")]
AlgorithmIdentifier Algorithm
{
[Token(Token = "0x600BD8C")]
[Address(Slot = "0")]
get;
}
// Token: 0x17001D60 RID: 7520
// (get) Token: 0x0600BD8D RID: 48525
[Token(Token = "0x17001D60")]
object CryptoObject
{
[Token(Token = "0x600BD8D")]
[Address(Slot = "1")]
get;
}
// Token: 0x0600BD8E RID: 48526
[Token(Token = "0x600BD8E")]
[Address(Slot = "2")]
CmsReadable GetReadable(KeyParameter key);
}
}
@@ -0,0 +1,385 @@
using System;
using System.Collections;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D44 RID: 7492
[Token(Token = "0x2001D44")]
public class CmsSignedData
{
// Token: 0x0600BD8F RID: 48527 RVA: 0x002B1DE0 File Offset: 0x002AFFE0
[Token(Token = "0x600BD8F")]
[Address(RVA = "0x166D940", Offset = "0x166C740", VA = "0x18166D940")]
private CmsSignedData(CmsSignedData c)
{
SignedData signedData = c.signedData;
this.signedData = signedData;
ContentInfo contentInfo = c.contentInfo;
this.contentInfo = contentInfo;
CmsProcessable cmsProcessable = c.signedContent;
this.signedContent = cmsProcessable;
SignerInformationStore signerInformationStore = c.signerInfoStore;
this.signerInfoStore = signerInformationStore;
}
// Token: 0x0600BD90 RID: 48528 RVA: 0x002B1E34 File Offset: 0x002B0034
[Token(Token = "0x600BD90")]
[Address(RVA = "0x166D990", Offset = "0x166C790", VA = "0x18166D990")]
public CmsSignedData(byte[] sigBlock)
{
int num;
MemoryStream memoryStream = new MemoryStream(sigBlock, num != 0);
num = 0;
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(memoryStream);
}
// Token: 0x0600BD91 RID: 48529 RVA: 0x002B1E54 File Offset: 0x002B0054
[Token(Token = "0x600BD91")]
[Address(RVA = "0x166D810", Offset = "0x166C610", VA = "0x18166D810")]
public CmsSignedData(CmsProcessable signedContent, byte[] sigBlock)
{
int num;
MemoryStream memoryStream = new MemoryStream(sigBlock, num != 0);
num = 0;
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(memoryStream);
}
// Token: 0x0600BD92 RID: 48530 RVA: 0x002B1E74 File Offset: 0x002B0074
[Token(Token = "0x600BD92")]
[Address(RVA = "0x166D8A0", Offset = "0x166C6A0", VA = "0x18166D8A0")]
public CmsSignedData(IDictionary hashes, byte[] sigBlock)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(sigBlock);
base..ctor();
this.hashes = hashes;
this.contentInfo = contentInfo;
SignedData instance = SignedData.GetInstance(contentInfo.content);
this.signedData = instance;
}
// Token: 0x0600BD93 RID: 48531 RVA: 0x002B1EB8 File Offset: 0x002B00B8
[Token(Token = "0x600BD93")]
[Address(RVA = "0x166D680", Offset = "0x166C480", VA = "0x18166D680")]
public CmsSignedData(CmsProcessable signedContent, Stream sigData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(sigData);
}
// Token: 0x0600BD94 RID: 48532 RVA: 0x002B1ECC File Offset: 0x002B00CC
[Token(Token = "0x600BD94")]
[Address(RVA = "0x166D6C0", Offset = "0x166C4C0", VA = "0x18166D6C0")]
public CmsSignedData(Stream sigData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(sigData);
}
// Token: 0x0600BD95 RID: 48533 RVA: 0x002B1EE0 File Offset: 0x002B00E0
[Token(Token = "0x600BD95")]
[Address(RVA = "0x166D6F0", Offset = "0x166C4F0", VA = "0x18166D6F0")]
public CmsSignedData(CmsProcessable signedContent, ContentInfo sigData)
{
this.signedContent = signedContent;
this.contentInfo = sigData;
SignedData instance = SignedData.GetInstance(sigData.content);
this.signedData = instance;
}
// Token: 0x0600BD96 RID: 48534 RVA: 0x002B1F1C File Offset: 0x002B011C
[Token(Token = "0x600BD96")]
[Address(RVA = "0x166D780", Offset = "0x166C580", VA = "0x18166D780")]
public CmsSignedData(IDictionary hashes, ContentInfo sigData)
{
this.hashes = hashes;
this.contentInfo = sigData;
SignedData instance = SignedData.GetInstance(sigData.content);
this.signedData = instance;
}
// Token: 0x0600BD97 RID: 48535 RVA: 0x002B1F58 File Offset: 0x002B0158
[Token(Token = "0x600BD97")]
[Address(RVA = "0x166DA10", Offset = "0x166C810", VA = "0x18166DA10")]
public CmsSignedData(ContentInfo sigData)
{
Asn1Encodable content;
do
{
base..ctor();
this.contentInfo = sigData;
SignedData instance = SignedData.GetInstance(sigData.content);
this.signedData = instance;
content = instance.contentInfo.content;
if (content == 0)
{
return;
}
}
while (content == 0 || content == 0);
CmsProcessableByteArray cmsProcessableByteArray;
this.signedContent = cmsProcessableByteArray;
}
// Token: 0x17001D61 RID: 7521
// (get) Token: 0x0600BD98 RID: 48536 RVA: 0x002B1FB0 File Offset: 0x002B01B0
[Token(Token = "0x17001D61")]
public int Version
{
[Token(Token = "0x600BD98")]
[Address(RVA = "0x166DBE0", Offset = "0x166C9E0", VA = "0x18166DBE0")]
get
{
return this.signedData.version.Value.IntValue;
}
}
// Token: 0x0600BD99 RID: 48537 RVA: 0x002B1FD8 File Offset: 0x002B01D8
[Token(Token = "0x600BD99")]
[Address(RVA = "0x166C8B0", Offset = "0x166B6B0", VA = "0x18166C8B0")]
public SignerInformationStore GetSignerInfos()
{
SignerInformationStore signerInformationStore;
IList list;
int num5;
do
{
int num = 0;
signerInformationStore = this.signerInfoStore;
if (signerInformationStore != 0)
{
return signerInformationStore;
}
list = Platform.CreateArrayList();
IEnumerator enumerator = this.signedData.signerInfos.GetEnumerator();
int num4;
if (enumerator != 0)
{
if (num < enumerator)
{
num += num;
num++;
}
DerObjectIdentifier contentType = this.signedData.contentInfo.contentType;
SignerInfo signerInfo;
if (this.hashes != 0)
{
Asn1Object asn1Object = signerInfo.digAlgorithm.ToAsn1Object();
BaseDigestCalculator baseDigestCalculator;
baseDigestCalculator.digest = asn1Object;
int num2;
SignerInformation signerInformation = new SignerInformation(signerInfo, contentType, num2, baseDigestCalculator);
int num3 = 0;
num2 = 0;
num3++;
num3 += 19;
}
CmsProcessable cmsProcessable = this.signedContent;
SignerInformation signerInformation2 = new SignerInformation(signerInfo, contentType, cmsProcessable, num4);
num4 = 0;
num5 = 0;
}
if (num4 != 0)
{
}
}
while (num5 != 0);
SignerInformationStore signerInformationStore2 = new SignerInformationStore(list);
this.signerInfoStore = signerInformationStore2;
return signerInformationStore;
}
// Token: 0x0600BD9A RID: 48538 RVA: 0x002B20F0 File Offset: 0x002B02F0
[Token(Token = "0x600BD9A")]
[Address(RVA = "0x166C6B0", Offset = "0x166B4B0", VA = "0x18166C6B0")]
public IX509Store GetAttributeCertificates(string type)
{
IX509Store ix509Store = this.attrCertStore;
if (ix509Store == 0)
{
CmsSignedHelper helper = CmsSignedData.Helper;
Asn1Set certificates = this.signedData.certificates;
IX509Store ix509Store2 = helper.CreateAttributeStore(type, certificates);
this.attrCertStore = ix509Store2;
}
return ix509Store;
}
// Token: 0x0600BD9B RID: 48539 RVA: 0x002B2134 File Offset: 0x002B0334
[Token(Token = "0x600BD9B")]
[Address(RVA = "0x166C750", Offset = "0x166B550", VA = "0x18166C750")]
public IX509Store GetCertificates(string type)
{
IX509Store ix509Store = this.certificateStore;
if (ix509Store == 0)
{
CmsSignedHelper helper = CmsSignedData.Helper;
Asn1Set certificates = this.signedData.certificates;
IX509Store ix509Store2 = helper.CreateCertificateStore(type, certificates);
this.certificateStore = ix509Store2;
}
return ix509Store;
}
// Token: 0x0600BD9C RID: 48540 RVA: 0x002B2178 File Offset: 0x002B0378
[Token(Token = "0x600BD9C")]
[Address(RVA = "0x166C7F0", Offset = "0x166B5F0", VA = "0x18166C7F0")]
public IX509Store GetCrls(string type)
{
IX509Store ix509Store = this.crlStore;
if (ix509Store == 0)
{
CmsSignedHelper helper = CmsSignedData.Helper;
Asn1Set crls = this.signedData.crls;
IX509Store ix509Store2 = helper.CreateCrlStore(type, crls);
this.crlStore = ix509Store2;
}
return ix509Store;
}
// Token: 0x17001D62 RID: 7522
// (get) Token: 0x0600BD9D RID: 48541 RVA: 0x002B21BC File Offset: 0x002B03BC
[Token(Token = "0x17001D62")]
[Obsolete]
public string SignedContentTypeOid
{
[Token(Token = "0x600BD9D")]
[Address(RVA = "0x166DB80", Offset = "0x166C980", VA = "0x18166DB80")]
get
{
return this.signedData.contentInfo.contentType.identifier;
}
}
// Token: 0x17001D63 RID: 7523
// (get) Token: 0x0600BD9E RID: 48542 RVA: 0x002B21E4 File Offset: 0x002B03E4
[Token(Token = "0x17001D63")]
public DerObjectIdentifier SignedContentType
{
[Token(Token = "0x600BD9E")]
[Address(RVA = "0x166DBB0", Offset = "0x166C9B0", VA = "0x18166DBB0")]
get
{
return this.signedData.contentInfo.contentType;
}
}
// Token: 0x17001D64 RID: 7524
// (get) Token: 0x0600BD9F RID: 48543 RVA: 0x002B2208 File Offset: 0x002B0408
[Token(Token = "0x17001D64")]
public CmsProcessable SignedContent
{
[Token(Token = "0x600BD9F")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
get
{
return this.signedContent;
}
}
// Token: 0x17001D65 RID: 7525
// (get) Token: 0x0600BDA0 RID: 48544 RVA: 0x002B221C File Offset: 0x002B041C
[Token(Token = "0x17001D65")]
public ContentInfo ContentInfo
{
[Token(Token = "0x600BDA0")]
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
get
{
return this.contentInfo;
}
}
// Token: 0x0600BDA1 RID: 48545 RVA: 0x002B2230 File Offset: 0x002B0430
[Token(Token = "0x600BDA1")]
[Address(RVA = "0x166C890", Offset = "0x166B690", VA = "0x18166C890")]
public byte[] GetEncoded()
{
return this.contentInfo.GetEncoded();
}
// Token: 0x0600BDA2 RID: 48546 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600BDA2")]
[Address(RVA = "0x166CEC0", Offset = "0x166BCC0", VA = "0x18166CEC0")]
public static CmsSignedData ReplaceSigners(CmsSignedData signedData, SignerInformationStore signerInformationStore)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600BDA3 RID: 48547 RVA: 0x002B2250 File Offset: 0x002B0450
[Token(Token = "0x600BDA3")]
[Address(RVA = "0x166CC30", Offset = "0x166BA30", VA = "0x18166CC30")]
public static CmsSignedData ReplaceCertificatesAndCrls(CmsSignedData signedData, IX509Store x509Certs, IX509Store x509Crls, IX509Store x509AttrCerts)
{
/*
An exception occurred when decompiling this method (0600BDA3)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedData BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedData::ReplaceCertificatesAndCrls(BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedData,BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store.IX509Store,BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store.IX509Store,BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store.IX509Store)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_B5:
stloc:Exception(var_16_BF, call:Exception(Platform::CreateNotImplementedException, ldstr:string("Currently can't replace attribute certificates")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1660
*/;
}
// Token: 0x040078B3 RID: 30899
[Token(Token = "0x40078B3")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x040078B4 RID: 30900
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40078B4")]
private readonly CmsProcessable signedContent;
// Token: 0x040078B5 RID: 30901
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40078B5")]
private SignedData signedData;
// Token: 0x040078B6 RID: 30902
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40078B6")]
private ContentInfo contentInfo;
// Token: 0x040078B7 RID: 30903
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40078B7")]
private SignerInformationStore signerInfoStore;
// Token: 0x040078B8 RID: 30904
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40078B8")]
private IX509Store attrCertStore;
// Token: 0x040078B9 RID: 30905
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40078B9")]
private IX509Store certificateStore;
// Token: 0x040078BA RID: 30906
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40078BA")]
private IX509Store crlStore;
// Token: 0x040078BB RID: 30907
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x40078BB")]
private IDictionary hashes;
}
}
@@ -0,0 +1,544 @@
using System;
using System.Collections;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.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: 0x02001D45 RID: 7493
[Token(Token = "0x2001D45")]
public class CmsSignedDataGenerator : CmsSignedGenerator
{
// Token: 0x0600BDA5 RID: 48549 RVA: 0x002B2338 File Offset: 0x002B0538
[Token(Token = "0x600BDA5")]
[Address(RVA = "0x1668C70", Offset = "0x1667A70", VA = "0x181668C70")]
public CmsSignedDataGenerator()
{
IList list = Platform.CreateArrayList();
this.signerInfs = list;
base..ctor();
}
// Token: 0x0600BDA6 RID: 48550 RVA: 0x002B235C File Offset: 0x002B055C
[Token(Token = "0x600BDA6")]
[Address(RVA = "0x1668BE0", Offset = "0x16679E0", VA = "0x181668BE0")]
public CmsSignedDataGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this.signerInfs = list;
base..ctor(rand);
}
// Token: 0x0600BDA7 RID: 48551 RVA: 0x002B2380 File Offset: 0x002B0580
[Token(Token = "0x600BDA7")]
[Address(RVA = "0x16674A0", Offset = "0x16662A0", VA = "0x1816674A0")]
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: 0x0600BDA8 RID: 48552 RVA: 0x002B23BC File Offset: 0x002B05BC
[Token(Token = "0x600BDA8")]
[Address(RVA = "0x1667A70", Offset = "0x1666870", VA = "0x181667A70")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOID, string digestOID)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
}
// Token: 0x0600BDA9 RID: 48553 RVA: 0x002B23D8 File Offset: 0x002B05D8
[Token(Token = "0x600BDA9")]
[Address(RVA = "0x1667360", Offset = "0x1666160", VA = "0x181667360")]
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: 0x0600BDAA RID: 48554 RVA: 0x002B2414 File Offset: 0x002B0614
[Token(Token = "0x600BDAA")]
[Address(RVA = "0x1667B50", Offset = "0x1666950", VA = "0x181667B50")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOID, string digestOID)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
}
// Token: 0x0600BDAB RID: 48555 RVA: 0x002B2430 File Offset: 0x002B0630
[Token(Token = "0x600BDAB")]
[Address(RVA = "0x1667820", Offset = "0x1666620", VA = "0x181667820")]
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: 0x0600BDAC RID: 48556 RVA: 0x002B2458 File Offset: 0x002B0658
[Token(Token = "0x600BDAC")]
[Address(RVA = "0x1667710", Offset = "0x1666510", VA = "0x181667710")]
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: 0x0600BDAD RID: 48557 RVA: 0x002B246C File Offset: 0x002B066C
[Token(Token = "0x600BDAD")]
[Address(RVA = "0x1667C30", Offset = "0x1666A30", VA = "0x181667C30")]
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: 0x0600BDAE RID: 48558 RVA: 0x002B2494 File Offset: 0x002B0694
[Token(Token = "0x600BDAE")]
[Address(RVA = "0x1667DC0", Offset = "0x1666BC0", VA = "0x181667DC0")]
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: 0x0600BDAF RID: 48559 RVA: 0x002B24A8 File Offset: 0x002B06A8
[Token(Token = "0x600BDAF")]
[Address(RVA = "0x16675E0", Offset = "0x16663E0", VA = "0x1816675E0")]
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: 0x0600BDB0 RID: 48560 RVA: 0x002B24D4 File Offset: 0x002B06D4
[Token(Token = "0x600BDB0")]
[Address(RVA = "0x16679B0", Offset = "0x16667B0", VA = "0x1816679B0")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOID, string digestOID, CmsAttributeTableGenerator signedAttrGen, CmsAttributeTableGenerator unsignedAttrGen)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
}
// Token: 0x0600BDB1 RID: 48561 RVA: 0x002B24EC File Offset: 0x002B06EC
[Token(Token = "0x600BDB1")]
[Address(RVA = "0x1667ED0", Offset = "0x1666CD0", VA = "0x181667ED0")]
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: 0x0600BDB2 RID: 48562 RVA: 0x002B2518 File Offset: 0x002B0718
[Token(Token = "0x600BDB2")]
[Address(RVA = "0x1668000", Offset = "0x1666E00", VA = "0x181668000")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOID, string digestOID, CmsAttributeTableGenerator signedAttrGen, CmsAttributeTableGenerator unsignedAttrGen)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
}
// Token: 0x0600BDB3 RID: 48563 RVA: 0x002B2530 File Offset: 0x002B0730
[Token(Token = "0x600BDB3")]
[Address(RVA = "0x1667280", Offset = "0x1666080", VA = "0x181667280")]
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: 0x0600BDB4 RID: 48564 RVA: 0x002B2578 File Offset: 0x002B0778
[Token(Token = "0x600BDB4")]
[Address(RVA = "0x1668CF0", Offset = "0x1667AF0", VA = "0x181668CF0")]
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: 0x0600BDB5 RID: 48565 RVA: 0x002B25F8 File Offset: 0x002B07F8
[Token(Token = "0x600BDB5")]
[Address(RVA = "0x1668160", Offset = "0x1666F60", VA = "0x181668160")]
public CmsSignedData Generate(CmsProcessable content)
{
int num = 0;
string data = CmsSignedGenerator.Data;
return this.Generate(data, content, num != 0);
}
// Token: 0x0600BDB6 RID: 48566 RVA: 0x002B2618 File Offset: 0x002B0818
[Token(Token = "0x600BDB6")]
[Address(RVA = "0x16681E0", Offset = "0x1666FE0", VA = "0x1816681E0")]
public CmsSignedData Generate(string signedContentType, CmsProcessable content, bool encapsulate)
{
Asn1EncodableVector asn1EncodableVector;
ArrayTypeMismatchException ex2;
SignerInfo signerInfo;
for (;;)
{
int num = 0;
IDictionary digests = this._digests;
IList signers = this._signers;
if (asn1EncodableVector != 0)
{
break;
}
ArrayTypeMismatchException ex;
if (ex != 0)
{
}
if (num != 0)
{
goto IL_17D;
}
if (num != -1)
{
}
if (signedContentType == 0)
{
}
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(signedContentType);
if (derObjectIdentifier != 0)
{
goto Block_3;
}
if (ex2 != 0)
{
}
if (signerInfo == 0)
{
goto Block_4;
}
}
if (asn1EncodableVector == 0)
{
}
if (asn1EncodableVector != 0)
{
Asn1Encodable[] array = new Asn1Encodable[1];
CmsSignedHelper helper = CmsSignedDataGenerator.Helper;
throw new ArrayTypeMismatchException();
}
throw new NullReferenceException();
Block_3:
Asn1Encodable[] array2 = new Asn1Encodable[1];
throw new ArrayTypeMismatchException();
Block_4:
DerInteger version = signerInfo.version;
if (ex2 != 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_17D:
throw new IndexOutOfRangeException();
}
// Token: 0x0600BDB7 RID: 48567 RVA: 0x002B27D4 File Offset: 0x002B09D4
[Token(Token = "0x600BDB7")]
[Address(RVA = "0x1668AE0", Offset = "0x16678E0", VA = "0x181668AE0")]
public CmsSignedData Generate(CmsProcessable content, bool encapsulate)
{
string data = CmsSignedGenerator.Data;
return this.Generate(data, content, encapsulate);
}
// Token: 0x0600BDB8 RID: 48568 RVA: 0x002B27F0 File Offset: 0x002B09F0
[Token(Token = "0x600BDB8")]
[Address(RVA = "0x16680C0", Offset = "0x1666EC0", VA = "0x1816680C0")]
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: 0x040078BC RID: 30908
[Token(Token = "0x40078BC")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x040078BD RID: 30909
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40078BD")]
private readonly IList signerInfs;
// Token: 0x02001D46 RID: 7494
[Token(Token = "0x2001D46")]
private class SignerInf
{
// Token: 0x0600BDBA RID: 48570 RVA: 0x002B2840 File Offset: 0x002B0A40
[Token(Token = "0x600BDBA")]
[Address(RVA = "0x16705E0", Offset = "0x166F3E0", VA = "0x1816705E0")]
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: 0x0600BDBB RID: 48571 RVA: 0x002B28B8 File Offset: 0x002B0AB8
[Token(Token = "0x600BDBB")]
[Address(RVA = "0x1670740", Offset = "0x166F540", VA = "0x181670740")]
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: 0x17001D66 RID: 7526
// (get) Token: 0x0600BDBC RID: 48572 RVA: 0x002B2940 File Offset: 0x002B0B40
[Token(Token = "0x17001D66")]
internal AlgorithmIdentifier DigestAlgorithmID
{
[Token(Token = "0x600BDBC")]
[Address(RVA = "0x1670960", Offset = "0x166F760", VA = "0x181670960")]
get
{
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(this.digestOID);
DerNull instance = DerNull.Instance;
return new AlgorithmIdentifier(derObjectIdentifier, instance);
}
}
// Token: 0x17001D67 RID: 7527
// (get) Token: 0x0600BDBD RID: 48573 RVA: 0x002B2968 File Offset: 0x002B0B68
[Token(Token = "0x17001D67")]
internal CmsAttributeTableGenerator SignedAttributes
{
[Token(Token = "0x600BDBD")]
[Address(RVA = "0x3F63D0", Offset = "0x3F51D0", VA = "0x1803F63D0")]
get
{
return this.sAttr;
}
}
// Token: 0x17001D68 RID: 7528
// (get) Token: 0x0600BDBE RID: 48574 RVA: 0x002B297C File Offset: 0x002B0B7C
[Token(Token = "0x17001D68")]
internal CmsAttributeTableGenerator UnsignedAttributes
{
[Token(Token = "0x600BDBE")]
[Address(RVA = "0x408890", Offset = "0x407690", VA = "0x180408890")]
get
{
return this.unsAttr;
}
}
// Token: 0x0600BDBF RID: 48575 RVA: 0x002B2990 File Offset: 0x002B0B90
[Token(Token = "0x600BDBF")]
[Address(RVA = "0x166FE40", Offset = "0x166EC40", VA = "0x18166FE40")]
internal SignerInfo ToSignerInfo(DerObjectIdentifier contentType, CmsProcessable content, SecureRandom random)
{
string text3;
CmsSignedGenerator cmsSignedGenerator;
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;
int num = 0;
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 = this.outer;
IDictionary digests3 = cmsSignedGenerator._digests;
if (cmsSignedGenerator == 0)
{
}
if (cmsSignedGenerator != 0)
{
ISignatureFactory signatureFactory = this.sigCalc;
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;
BufferedStream bufferedStream;
derOutputStream = new DerOutputStream(bufferedStream);
}
if (derOutputStream != 0 && derOutputStream != 0)
{
break;
}
}
}
int num2 = 0;
if (num2 < cmsSignedGenerator)
{
num2 += num2;
num2++;
}
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);
SignerIdentifier signerIdentifier = this.signerIdentifier;
SignerInfo signerInfo;
return signerInfo;
}
// Token: 0x040078BE RID: 30910
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40078BE")]
private readonly CmsSignedGenerator outer;
// Token: 0x040078BF RID: 30911
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40078BF")]
private readonly ISignatureFactory sigCalc;
// Token: 0x040078C0 RID: 30912
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40078C0")]
private readonly SignerIdentifier signerIdentifier;
// Token: 0x040078C1 RID: 30913
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40078C1")]
private readonly string digestOID;
// Token: 0x040078C2 RID: 30914
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40078C2")]
private readonly string encOID;
// Token: 0x040078C3 RID: 30915
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40078C3")]
private readonly CmsAttributeTableGenerator sAttr;
// Token: 0x040078C4 RID: 30916
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40078C4")]
private readonly CmsAttributeTableGenerator unsAttr;
// Token: 0x040078C5 RID: 30917
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x40078C5")]
private readonly BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable baseSignedTable;
}
}
}
@@ -0,0 +1,486 @@
using System;
using System.Collections;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.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: 0x02001D47 RID: 7495
[Token(Token = "0x2001D47")]
public class CmsSignedDataParser : CmsContentInfoParser
{
// Token: 0x0600BDC0 RID: 48576 RVA: 0x002B2B30 File Offset: 0x002B0D30
[Token(Token = "0x600BDC0")]
[Address(RVA = "0x166A310", Offset = "0x1669110", VA = "0x18166A310")]
public CmsSignedDataParser(byte[] sigBlock)
{
int num;
MemoryStream memoryStream = new MemoryStream(sigBlock, num != 0);
num = 0;
}
// Token: 0x0600BDC1 RID: 48577 RVA: 0x002B2B4C File Offset: 0x002B0D4C
[Token(Token = "0x600BDC1")]
[Address(RVA = "0x1669E50", Offset = "0x1668C50", VA = "0x181669E50")]
public CmsSignedDataParser(CmsTypedStream signedContent, byte[] sigBlock)
{
int num;
MemoryStream memoryStream = new MemoryStream(sigBlock, num != 0);
num = 0;
}
// Token: 0x0600BDC2 RID: 48578 RVA: 0x002B2B64 File Offset: 0x002B0D64
[Token(Token = "0x600BDC2")]
[Address(RVA = "0x166A300", Offset = "0x1669100", VA = "0x18166A300")]
public CmsSignedDataParser(Stream sigData)
{
}
// Token: 0x0600BDC3 RID: 48579 RVA: 0x002B2B74 File Offset: 0x002B0D74
[Token(Token = "0x600BDC3")]
[Address(RVA = "0x1669ED0", Offset = "0x1668CD0", VA = "0x181669ED0")]
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_DF;
}
CmsTypedStream cmsTypedStream;
cmsTypedStream.Drain();
}
CmsTypedStream signedContent2 = this._signedContent;
if (signedContent2 == 0)
{
DerObjectIdentifier contentType2 = encapContentInfo.contentType;
}
IL_DF:
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(signedContent2._oid);
this._signedContentType = derObjectIdentifier;
}
// Token: 0x17001D69 RID: 7529
// (get) Token: 0x0600BDC4 RID: 48580 RVA: 0x002B2CD8 File Offset: 0x002B0ED8
[Token(Token = "0x17001D69")]
public int Version
{
[Token(Token = "0x600BDC4")]
[Address(RVA = "0x166A3E0", Offset = "0x16691E0", VA = "0x18166A3E0")]
get
{
return this._signedData._version.Value.IntValue;
}
}
// Token: 0x17001D6A RID: 7530
// (get) Token: 0x0600BDC5 RID: 48581 RVA: 0x002B2D00 File Offset: 0x002B0F00
[Token(Token = "0x17001D6A")]
public ISet DigestOids
{
[Token(Token = "0x600BDC5")]
[Address(RVA = "0x166A380", Offset = "0x1669180", VA = "0x18166A380")]
get
{
/*
An exception occurred when decompiling this method (0600BDC5)
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 1660
*/;
}
}
// Token: 0x0600BDC6 RID: 48582 RVA: 0x002B2D18 File Offset: 0x002B0F18
[Token(Token = "0x600BDC6")]
[Address(RVA = "0x1669330", Offset = "0x1668130", VA = "0x181669330")]
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;
}
byte[] array;
if (array != 0)
{
}
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 num2;
SignerInformation signerInformation = new SignerInformation(signerInfo, signedContentType, num2, baseDigestCalculator);
num2 = 0;
}
SignerInformationStore signerInformationStore;
this._signerInfoStore = signerInformationStore;
}
return signerInfoStore;
}
// Token: 0x0600BDC7 RID: 48583 RVA: 0x002B2E18 File Offset: 0x002B1018
[Token(Token = "0x600BDC7")]
[Address(RVA = "0x1668EF0", Offset = "0x1667CF0", VA = "0x181668EF0")]
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: 0x0600BDC8 RID: 48584 RVA: 0x002B2E5C File Offset: 0x002B105C
[Token(Token = "0x600BDC8")]
[Address(RVA = "0x1668F90", Offset = "0x1667D90", VA = "0x181668F90")]
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: 0x0600BDC9 RID: 48585 RVA: 0x002B2EA0 File Offset: 0x002B10A0
[Token(Token = "0x600BDC9")]
[Address(RVA = "0x1669030", Offset = "0x1667E30", VA = "0x181669030")]
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: 0x0600BDCA RID: 48586 RVA: 0x002B2EE4 File Offset: 0x002B10E4
[Token(Token = "0x600BDCA")]
[Address(RVA = "0x1669790", Offset = "0x1668590", VA = "0x181669790")]
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: 0x17001D6B RID: 7531
// (get) Token: 0x0600BDCB RID: 48587 RVA: 0x002B2F38 File Offset: 0x002B1138
[Token(Token = "0x17001D6B")]
public DerObjectIdentifier SignedContentType
{
[Token(Token = "0x600BDCB")]
[Address(RVA = "0x3F63E0", Offset = "0x3F51E0", VA = "0x1803F63E0")]
get
{
return this._signedContentType;
}
}
// Token: 0x0600BDCC RID: 48588 RVA: 0x002B2F4C File Offset: 0x002B114C
[Token(Token = "0x600BDCC")]
[Address(RVA = "0x16690D0", Offset = "0x1667ED0", VA = "0x1816690D0")]
public CmsTypedStream GetSignedContent()
{
int num;
CmsTypedStream signedContent;
DigestStream digestStream;
do
{
num = 0;
signedContent = this._signedContent;
if (signedContent == 0)
{
return signedContent;
}
Stream @in = signedContent._in;
IDictionary digests = this._digests;
if (signedContent != 0)
{
if (num < signedContent)
{
num += num;
num++;
}
if (num == 0)
{
num++;
num += 19;
}
if (num == 0)
{
goto IL_6F;
}
int num2;
digestStream = new DigestStream(@in, num, num2);
num2 = 0;
}
if (digestStream != 0)
{
}
}
while (num != 0);
CmsTypedStream cmsTypedStream = new CmsTypedStream(this._signedContent._oid, digestStream);
return signedContent;
IL_6F:
throw new NullReferenceException();
}
// Token: 0x0600BDCD RID: 48589 RVA: 0x002B2FD0 File Offset: 0x002B11D0
[Token(Token = "0x600BDCD")]
[Address(RVA = "0x1669AF0", Offset = "0x16688F0", VA = "0x181669AF0")]
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;
}
cmsSignedDataStreamGenerator.AddCertificates(ix509Store2);
IX509Store ix509Store3;
if (cmsSignedDataParser._crlStore == 0)
{
cmsSignedDataParser.PopulateCertCrlSets();
CmsSignedHelper helper3 = CmsSignedDataParser.Helper;
Asn1Set crlSet = cmsSignedDataParser._crlSet;
ix509Store3 = helper3.CreateCrlStore("Collection", crlSet);
cmsSignedDataParser._crlStore = ix509Store3;
}
cmsSignedDataStreamGenerator.AddCrls(ix509Store3);
Platform.Dispose(stream);
return outStr;
}
// Token: 0x0600BDCE RID: 48590 RVA: 0x002B3104 File Offset: 0x002B1304
[Token(Token = "0x600BDCE")]
[Address(RVA = "0x1669910", Offset = "0x1668710", VA = "0x181669910")]
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;
Streams.PipeAll(signedContent._in, stream);
if (x509AttrCerts != 0)
{
cmsSignedDataStreamGenerator.AddAttributeCertificates(x509AttrCerts);
}
if (x509Certs != 0)
{
cmsSignedDataStreamGenerator.AddCertificates(x509Certs);
}
if (x509Crls != 0)
{
cmsSignedDataStreamGenerator.AddCrls(x509Crls);
}
SignerInformationStore signerInfos = cmsSignedDataParser.GetSignerInfos();
cmsSignedDataStreamGenerator.AddSigners(signerInfos);
throw new NullReferenceException();
}
// Token: 0x0600BDCF RID: 48591 RVA: 0x002B3198 File Offset: 0x002B1398
[Token(Token = "0x600BDCF")]
[Address(RVA = "0x1668E90", Offset = "0x1667C90", VA = "0x181668E90")]
private static Asn1Set GetAsn1Set(Asn1SetParser asn1SetParser)
{
if (asn1SetParser == 0)
{
}
return Asn1Set.GetInstance(0);
}
// Token: 0x040078C6 RID: 30918
[Token(Token = "0x40078C6")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x040078C7 RID: 30919
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40078C7")]
private SignedDataParser _signedData;
// Token: 0x040078C8 RID: 30920
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40078C8")]
private DerObjectIdentifier _signedContentType;
// Token: 0x040078C9 RID: 30921
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40078C9")]
private CmsTypedStream _signedContent;
// Token: 0x040078CA RID: 30922
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40078CA")]
private IDictionary _digests;
// Token: 0x040078CB RID: 30923
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40078CB")]
private ISet _digestOids;
// Token: 0x040078CC RID: 30924
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x40078CC")]
private SignerInformationStore _signerInfoStore;
// Token: 0x040078CD RID: 30925
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x40078CD")]
private Asn1Set _certSet;
// Token: 0x040078CE RID: 30926
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x40078CE")]
private Asn1Set _crlSet;
// Token: 0x040078CF RID: 30927
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x40078CF")]
private bool _isCertCrlParsed;
// Token: 0x040078D0 RID: 30928
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x40078D0")]
private IX509Store _attributeStore;
// Token: 0x040078D1 RID: 30929
[FieldOffset(Offset = "0x70")]
[Token(Token = "0x40078D1")]
private IX509Store _certificateStore;
// Token: 0x040078D2 RID: 30930
[FieldOffset(Offset = "0x78")]
[Token(Token = "0x40078D2")]
private IX509Store _crlStore;
}
}
@@ -0,0 +1,901 @@
using System;
using System.Collections;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.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: 0x02001D48 RID: 7496
[Token(Token = "0x2001D48")]
public class CmsSignedDataStreamGenerator : CmsSignedGenerator
{
// Token: 0x0600BDD1 RID: 48593 RVA: 0x002B31CC File Offset: 0x002B13CC
[Token(Token = "0x600BDD1")]
[Address(RVA = "0x166C520", Offset = "0x166B320", VA = "0x18166C520")]
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;
base..ctor();
}
// Token: 0x0600BDD2 RID: 48594 RVA: 0x002B3220 File Offset: 0x002B1420
[Token(Token = "0x600BDD2")]
[Address(RVA = "0x166C5E0", Offset = "0x166B3E0", VA = "0x18166C5E0")]
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: 0x0600BDD3 RID: 48595 RVA: 0x002B3274 File Offset: 0x002B1474
[Token(Token = "0x600BDD3")]
[Address(RVA = "0x731CC0", Offset = "0x730AC0", VA = "0x180731CC0")]
public void SetBufferSize(int bufferSize)
{
this._bufferSize = bufferSize;
}
// Token: 0x0600BDD4 RID: 48596 RVA: 0x002B3288 File Offset: 0x002B1488
[Token(Token = "0x600BDD4")]
[Address(RVA = "0x166A420", Offset = "0x1669220", VA = "0x18166A420")]
public void AddDigests(params string[] digestOids)
{
this.AddDigests(digestOids);
}
// Token: 0x0600BDD5 RID: 48597 RVA: 0x002B329C File Offset: 0x002B149C
[Token(Token = "0x600BDD5")]
[Address(RVA = "0x166A430", Offset = "0x1669230", VA = "0x18166A430")]
public void AddDigests(IEnumerable digestOids)
{
int num;
do
{
num = 0;
num += num;
num++;
if (num != 0 && num == 0)
{
goto IL_2F;
}
this.ConfigureDigest(num);
num += num;
num++;
num += 19;
if (num != 0)
{
}
}
while (num != 0);
return;
IL_2F:
throw new NullReferenceException();
}
// Token: 0x0600BDD6 RID: 48598 RVA: 0x002B32E0 File Offset: 0x002B14E0
[Token(Token = "0x600BDD6")]
[Address(RVA = "0x166ABA0", Offset = "0x16699A0", VA = "0x18166ABA0")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOid)
{
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
int num = 0;
this.AddSigner(privateKey, cert, digestOid, defaultSignedAttributeTableGenerator, num);
}
// Token: 0x0600BDD7 RID: 48599 RVA: 0x002B3300 File Offset: 0x002B1500
[Token(Token = "0x600BDD7")]
[Address(RVA = "0x166A630", Offset = "0x1669430", VA = "0x18166A630")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid)
{
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
}
// Token: 0x0600BDD8 RID: 48600 RVA: 0x002B331C File Offset: 0x002B151C
[Token(Token = "0x600BDD8")]
[Address(RVA = "0x166A7F0", Offset = "0x16695F0", VA = "0x18166A7F0")]
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: 0x0600BDD9 RID: 48601 RVA: 0x002B332C File Offset: 0x002B152C
[Token(Token = "0x600BDD9")]
[Address(RVA = "0x166AAD0", Offset = "0x16698D0", VA = "0x18166AAD0")]
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: 0x0600BDDA RID: 48602 RVA: 0x002B333C File Offset: 0x002B153C
[Token(Token = "0x600BDDA")]
[Address(RVA = "0x166A720", Offset = "0x1669520", VA = "0x18166A720")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
string encOid = CmsSignedDataStreamGenerator.Helper.GetEncOid(privateKey, digestOid);
}
// Token: 0x0600BDDB RID: 48603 RVA: 0x002B335C File Offset: 0x002B155C
[Token(Token = "0x600BDDB")]
[Address(RVA = "0x166AE00", Offset = "0x1669C00", VA = "0x18166AE00")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
}
// Token: 0x0600BDDC RID: 48604 RVA: 0x002B3370 File Offset: 0x002B1570
[Token(Token = "0x600BDDC")]
[Address(RVA = "0x166AA30", Offset = "0x1669830", VA = "0x18166AA30")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOid)
{
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
int num = 0;
this.AddSigner(privateKey, subjectKeyID, digestOid, defaultSignedAttributeTableGenerator, num);
}
// Token: 0x0600BDDD RID: 48605 RVA: 0x002B3390 File Offset: 0x002B1590
[Token(Token = "0x600BDDD")]
[Address(RVA = "0x166AC40", Offset = "0x1669A40", VA = "0x18166AC40")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOid, string digestOid)
{
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
}
// Token: 0x0600BDDE RID: 48606 RVA: 0x002B33AC File Offset: 0x002B15AC
[Token(Token = "0x600BDDE")]
[Address(RVA = "0x166A960", Offset = "0x1669760", VA = "0x18166A960")]
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: 0x0600BDDF RID: 48607 RVA: 0x002B33BC File Offset: 0x002B15BC
[Token(Token = "0x600BDDF")]
[Address(RVA = "0x166AD30", Offset = "0x1669B30", VA = "0x18166AD30")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
string encOid = CmsSignedDataStreamGenerator.Helper.GetEncOid(privateKey, digestOid);
}
// Token: 0x0600BDE0 RID: 48608 RVA: 0x002B33DC File Offset: 0x002B15DC
[Token(Token = "0x600BDE0")]
[Address(RVA = "0x166A8C0", Offset = "0x16696C0", VA = "0x18166A8C0")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
}
// Token: 0x0600BDE1 RID: 48609 RVA: 0x002B33F0 File Offset: 0x002B15F0
[Token(Token = "0x600BDE1")]
[Address(RVA = "0x166B840", Offset = "0x166A640", VA = "0x18166B840")]
private void DoAddSigner(AsymmetricKeyParameter privateKey, SignerIdentifier signerIdentifier, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
IList signerInfs = this._signerInfs;
throw new NullReferenceException();
}
// Token: 0x0600BDE2 RID: 48610 RVA: 0x002B340C File Offset: 0x002B160C
[Token(Token = "0x600BDE2")]
[Address(RVA = "0x166A5E0", Offset = "0x16693E0", VA = "0x18166A5E0", Slot = "6")]
internal override void AddSignerCallback(SignerInformation si)
{
Asn1Object asn1Object = si.digestAlgorithm.ToAsn1Object();
}
// Token: 0x0600BDE3 RID: 48611 RVA: 0x002B342C File Offset: 0x002B162C
[Token(Token = "0x600BDE3")]
[Address(RVA = "0x166BCC0", Offset = "0x166AAC0", VA = "0x18166BCC0")]
public Stream Open(Stream outStream)
{
int num = 0;
int num2 = 0;
string data = CmsSignedGenerator.Data;
return this.Open(outStream, data, num2 != 0, num);
}
// Token: 0x0600BDE4 RID: 48612 RVA: 0x002B3450 File Offset: 0x002B1650
[Token(Token = "0x600BDE4")]
[Address(RVA = "0x166BC20", Offset = "0x166AA20", VA = "0x18166BC20")]
public Stream Open(Stream outStream, bool encapsulate)
{
int num = 0;
string data = CmsSignedGenerator.Data;
return this.Open(outStream, data, encapsulate, num);
}
// Token: 0x0600BDE5 RID: 48613 RVA: 0x002B3470 File Offset: 0x002B1670
[Token(Token = "0x600BDE5")]
[Address(RVA = "0x166BB80", Offset = "0x166A980", VA = "0x18166BB80")]
public Stream Open(Stream outStream, bool encapsulate, Stream dataOutputStream)
{
string data = CmsSignedGenerator.Data;
return this.Open(outStream, data, encapsulate, dataOutputStream);
}
// Token: 0x0600BDE6 RID: 48614 RVA: 0x002B3490 File Offset: 0x002B1690
[Token(Token = "0x600BDE6")]
[Address(RVA = "0x166C3E0", Offset = "0x166B1E0", VA = "0x18166C3E0")]
public Stream Open(Stream outStream, string signedContentType, bool encapsulate)
{
int num = 0;
return this.Open(outStream, signedContentType, encapsulate, num);
}
// Token: 0x0600BDE7 RID: 48615 RVA: 0x002B34AC File Offset: 0x002B16AC
[Token(Token = "0x600BDE7")]
[Address(RVA = "0x166BD50", Offset = "0x166AB50", VA = "0x18166BD50")]
public Stream Open(Stream outStream, string signedContentType, bool encapsulate, Stream dataOutputStream)
{
int num;
Asn1EncodableVector asn1EncodableVector;
for (;;)
{
num = 0;
if (outStream == 0)
{
goto IL_E1;
}
if (outStream.CanSeek)
{
if (outStream != 0 && !outStream.CanSeek)
{
goto IL_ED;
}
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 == 0)
{
goto Block_5;
}
}
}
Asn1Encodable[] array;
if (asn1EncodableVector == 0 || asn1EncodableVector != 0)
{
array = new Asn1Encodable[1];
DerObjectIdentifier derObjectIdentifier2 = new DerObjectIdentifier(num);
DerNull 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();
IL_E1:
ArgumentNullException ex2 = new ArgumentNullException("outStream");
IL_ED:
ArgumentException ex3 = new ArgumentException("Expected writeable stream", "dataOutputStream");
throw new IndexOutOfRangeException();
}
// Token: 0x0600BDE8 RID: 48616 RVA: 0x002B35D0 File Offset: 0x002B17D0
[Token(Token = "0x600BDE8")]
[Address(RVA = "0x166C400", Offset = "0x166B200", VA = "0x18166C400")]
private void RegisterDigestOid(string digestOid)
{
ISet messageDigestOids = this._messageDigestOids;
if (!this._messageDigestsLocked)
{
return;
}
throw new NullReferenceException();
}
// Token: 0x0600BDE9 RID: 48617 RVA: 0x002B3600 File Offset: 0x002B1800
[Token(Token = "0x600BDE9")]
[Address(RVA = "0x166B6A0", Offset = "0x166A4A0", VA = "0x18166B6A0")]
private void ConfigureDigest(string digestOid)
{
/*
An exception occurred when decompiling this method (0600BDE9)
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 1660
*/;
}
// Token: 0x0600BDEA RID: 48618 RVA: 0x002B3660 File Offset: 0x002B1860
[Token(Token = "0x600BDEA")]
[Address(RVA = "0x166B950", Offset = "0x166A750", VA = "0x18166B950")]
internal void Generate(Stream outStream, string eContentType, bool encapsulate, Stream dataOutputStream, CmsProcessable content)
{
}
// Token: 0x0600BDEB RID: 48619 RVA: 0x002B3670 File Offset: 0x002B1870
[Token(Token = "0x600BDEB")]
[Address(RVA = "0x166B050", Offset = "0x1669E50", VA = "0x18166B050")]
private DerInteger CalculateVersion(DerObjectIdentifier contentOid)
{
int num;
do
{
num = 0;
if (this._certs != 0)
{
if (num != 0)
{
goto IL_6D;
}
if (num != -1)
{
}
if ((ulong)1L != 0UL)
{
goto IL_60;
}
}
if (this._crls == 0)
{
break;
}
if ((uint)(-1) != 0U)
{
}
}
while (num != 0);
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_60:
return new DerInteger(5);
IL_6D:
throw new NullReferenceException();
}
// Token: 0x0600BDEC RID: 48620 RVA: 0x002B36F0 File Offset: 0x002B18F0
[Token(Token = "0x600BDEC")]
[Address(RVA = "0x166B450", Offset = "0x166A250", VA = "0x18166B450")]
private bool CheckForVersion3(IList signerInfos)
{
int num;
do
{
num = 0;
SignerInfo signerInfo;
int intValue = signerInfo.version.Value.IntValue;
while (intValue != 3)
{
}
if (intValue != 0)
{
}
}
while (num != 0);
if (num != -1)
{
return true;
}
throw new NullReferenceException();
}
// Token: 0x0600BDED RID: 48621 RVA: 0x002B3750 File Offset: 0x002B1950
[Token(Token = "0x600BDED")]
[Address(RVA = "0x166AEA0", Offset = "0x1669CA0", VA = "0x18166AEA0")]
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)
{
}
}
while (num != 0);
return safeTeeOutputStream;
}
// Token: 0x0600BDEE RID: 48622 RVA: 0x002B377C File Offset: 0x002B197C
[Token(Token = "0x600BDEE")]
[Address(RVA = "0x166BA10", Offset = "0x166A810", VA = "0x18166BA10")]
private static Stream GetSafeOutputStream(Stream s)
{
if (s == 0)
{
NullOutputStream nullOutputStream = new NullOutputStream();
}
return s;
}
// Token: 0x0600BDEF RID: 48623 RVA: 0x002B3794 File Offset: 0x002B1994
[Token(Token = "0x600BDEF")]
[Address(RVA = "0x166BA60", Offset = "0x166A860", VA = "0x18166BA60")]
private static Stream GetSafeTeeOutputStream(Stream s1, Stream s2)
{
/*
An exception occurred when decompiling this method (0600BDEF)
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 1660
*/;
}
// Token: 0x040078D3 RID: 30931
[Token(Token = "0x40078D3")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x040078D4 RID: 30932
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40078D4")]
private readonly IList _signerInfs;
// Token: 0x040078D5 RID: 30933
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x40078D5")]
private readonly ISet _messageDigestOids;
// Token: 0x040078D6 RID: 30934
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x40078D6")]
private readonly IDictionary _messageDigests;
// Token: 0x040078D7 RID: 30935
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x40078D7")]
private readonly IDictionary _messageHashes;
// Token: 0x040078D8 RID: 30936
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x40078D8")]
private bool _messageDigestsLocked;
// Token: 0x040078D9 RID: 30937
[FieldOffset(Offset = "0x64")]
[Token(Token = "0x40078D9")]
private int _bufferSize;
// Token: 0x02001D49 RID: 7497
[Token(Token = "0x2001D49")]
private class DigestAndSignerInfoGeneratorHolder
{
// Token: 0x0600BDF1 RID: 48625 RVA: 0x002B37D4 File Offset: 0x002B19D4
[Token(Token = "0x600BDF1")]
[Address(RVA = "0x4089A0", Offset = "0x4077A0", VA = "0x1804089A0")]
internal DigestAndSignerInfoGeneratorHolder(ISignerInfoGenerator signerInf, string digestOID)
{
this.signerInf = signerInf;
this.digestOID = digestOID;
}
// Token: 0x17001D6C RID: 7532
// (get) Token: 0x0600BDF2 RID: 48626 RVA: 0x002B37F8 File Offset: 0x002B19F8
[Token(Token = "0x17001D6C")]
internal AlgorithmIdentifier DigestAlgorithm
{
[Token(Token = "0x600BDF2")]
[Address(RVA = "0x2008D30", Offset = "0x2007B30", VA = "0x182008D30")]
get
{
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(this.digestOID);
DerNull instance = DerNull.Instance;
return new AlgorithmIdentifier(derObjectIdentifier, instance);
}
}
// Token: 0x040078DA RID: 30938
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40078DA")]
internal readonly ISignerInfoGenerator signerInf;
// Token: 0x040078DB RID: 30939
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40078DB")]
internal readonly string digestOID;
}
// Token: 0x02001D4A RID: 7498
[Token(Token = "0x2001D4A")]
private class SignerInfoGeneratorImpl : ISignerInfoGenerator
{
// Token: 0x0600BDF3 RID: 48627 RVA: 0x002B3820 File Offset: 0x002B1A20
[Token(Token = "0x600BDF3")]
[Address(RVA = "0x2014BF0", Offset = "0x20139F0", VA = "0x182014BF0")]
internal SignerInfoGeneratorImpl(CmsSignedDataStreamGenerator outer, AsymmetricKeyParameter key, SignerIdentifier signerIdentifier, string digestOID, string encOID, CmsAttributeTableGenerator sAttr, CmsAttributeTableGenerator unsAttr)
{
/*
An exception occurred when decompiling this method (0600BDF3)
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 1660
*/;
}
// Token: 0x0600BDF4 RID: 48628 RVA: 0x002B3918 File Offset: 0x002B1B18
[Token(Token = "0x600BDF4")]
[Address(RVA = "0x20145B0", Offset = "0x20133B0", VA = "0x1820145B0", 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_98;
}
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;
IL_98:
ISigner sig = this._sig;
byte[] array;
int length = array.Length;
ISigner sig2 = this._sig;
int num2 = 0;
if (this._unsAttr != num2)
{
string text3 = this.outer.ToString();
CmsAttributeTableGenerator unsAttr = this._unsAttr;
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator2 = this.outer;
}
CmsSignedHelper helper2 = CmsSignedDataStreamGenerator.Helper;
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(this._encOID);
ISet noParams = CmsSignedHelper.noParams;
Asn1Encodable asn1Encodable;
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(derObjectIdentifier, asn1Encodable);
SignerInfo signerInfo;
return signerInfo;
}
// Token: 0x040078DC RID: 30940
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40078DC")]
private readonly CmsSignedDataStreamGenerator outer;
// Token: 0x040078DD RID: 30941
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40078DD")]
private readonly SignerIdentifier _signerIdentifier;
// Token: 0x040078DE RID: 30942
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40078DE")]
private readonly string _digestOID;
// Token: 0x040078DF RID: 30943
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40078DF")]
private readonly string _encOID;
// Token: 0x040078E0 RID: 30944
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40078E0")]
private readonly CmsAttributeTableGenerator _sAttr;
// Token: 0x040078E1 RID: 30945
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40078E1")]
private readonly CmsAttributeTableGenerator _unsAttr;
// Token: 0x040078E2 RID: 30946
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40078E2")]
private readonly string _encName;
// Token: 0x040078E3 RID: 30947
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x40078E3")]
private readonly ISigner _sig;
}
// Token: 0x02001D4B RID: 7499
[Token(Token = "0x2001D4B")]
private class CmsSignedDataOutputStream : BaseOutputStream
{
// Token: 0x0600BDF5 RID: 48629 RVA: 0x002B3ABC File Offset: 0x002B1CBC
[Token(Token = "0x600BDF5")]
[Address(RVA = "0x2000840", Offset = "0x1FFF640", VA = "0x182000840")]
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: 0x0600BDF6 RID: 48630 RVA: 0x002B3B00 File Offset: 0x002B1D00
[Token(Token = "0x600BDF6")]
[Address(RVA = "0x1663250", Offset = "0x1662050", VA = "0x181663250", Slot = "30")]
public override void WriteByte(byte b)
{
bool canRead = this._out.CanRead;
}
// Token: 0x0600BDF7 RID: 48631 RVA: 0x002B3B20 File Offset: 0x002B1D20
[Token(Token = "0x600BDF7")]
[Address(RVA = "0x1663280", Offset = "0x1662080", VA = "0x181663280", Slot = "29")]
public override void Write(byte[] bytes, int off, int len)
{
bool canRead = this._out.CanRead;
}
// Token: 0x0600BDF8 RID: 48632 RVA: 0x002B3B40 File Offset: 0x002B1D40
[Token(Token = "0x600BDF8")]
[Address(RVA = "0x1FFFD50", Offset = "0x1FFEB50", VA = "0x181FFFD50", Slot = "15")]
public override void Close()
{
this.DoClose();
base.Close();
}
// Token: 0x0600BDF9 RID: 48633 RVA: 0x002B3B5C File Offset: 0x002B1D5C
[Token(Token = "0x600BDF9")]
[Address(RVA = "0x1FFFD70", Offset = "0x1FFEB70", VA = "0x181FFFD70")]
private void DoClose()
{
int num5;
Asn1EncodableVector asn1EncodableVector;
Asn1Encodable[] array2;
AlgorithmIdentifier algorithmIdentifier;
for (;;)
{
int num = 0;
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);
BerSequenceGenerator sigGen = this._sigGen;
int num2;
int num3;
BerTaggedObject berTaggedObject = new BerTaggedObject(num2 != 0, num3, asn1Set2);
num3 = 0;
num2 = 0;
CmsSignedDataStreamGenerator.CmsSignedDataOutputStream.WriteToGenerator(sigGen, berTaggedObject);
}
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator2 = this.outer;
IList crls = cmsSignedDataStreamGenerator2._crls;
if (cmsSignedDataStreamGenerator2 > 0)
{
IList crls2 = this.outer._crls;
Asn1Set asn1Set3 = CmsUtilities.CreateDerSetFromList(crls2);
Asn1Set asn1Set4 = CmsUtilities.CreateBerSetFromList(crls2);
BerSequenceGenerator sigGen2 = this._sigGen;
int num4;
BerTaggedObject berTaggedObject2 = new BerTaggedObject(num4 != 0, 1, asn1Set4);
num4 = 0;
CmsSignedDataStreamGenerator.CmsSignedDataOutputStream.WriteToGenerator(sigGen2, berTaggedObject2);
}
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator3 = this.outer;
IDictionary messageDigests = cmsSignedDataStreamGenerator3._messageDigests;
if (cmsSignedDataStreamGenerator3 != 0)
{
IDictionary messageHashes = this.outer._messageHashes;
}
num5 = 0;
byte[] array;
if (array != 0)
{
}
if (num == 0)
{
if (num5 != -1)
{
}
IList signerInfs = this.outer._signerInfs;
if (asn1EncodableVector != 0)
{
break;
}
if (array2 != 0)
{
}
if (algorithmIdentifier == 0)
{
if (array2 == (ulong)(-1L) || "{il2cpp array field local64->}" == (ulong)511L)
{
}
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator4 = this.outer;
IList signers = cmsSignedDataStreamGenerator4._signers;
Asn1Encodable[] array3;
if (cmsSignedDataStreamGenerator4 != 0)
{
if (cmsSignedDataStreamGenerator4 == 0)
{
}
if (cmsSignedDataStreamGenerator4 == 0)
{
continue;
}
array3 = new Asn1Encodable[1];
IList crls3 = cmsSignedDataStreamGenerator4._crls;
if (crls3 != 0)
{
}
array3[0] = crls3;
asn1EncodableVector.Add(array3);
}
if (array3 != 0)
{
}
if (algorithmIdentifier == 0)
{
goto Block_9;
}
}
}
}
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(num5);
DerNull instance = DerNull.Instance;
algorithmIdentifier = new AlgorithmIdentifier(derObjectIdentifier, instance);
IDictionary messageHashes2 = this.outer._messageHashes;
CmsSignedHelper helper = CmsSignedDataStreamGenerator.Helper;
IDictionary digests2 = this.outer._digests;
array2 = new Asn1Encodable[1];
IList v = asn1EncodableVector.v;
throw new ArrayTypeMismatchException();
Block_9:
BerSequenceGenerator sigGen3 = this._sigGen;
DerSet derSet = new DerSet(asn1EncodableVector);
CmsSignedDataStreamGenerator.CmsSignedDataOutputStream.WriteToGenerator(sigGen3, derSet);
Stream rawOutputStream2 = this._sigGen.GetRawOutputStream();
Stream rawOutputStream3 = this._sGen.GetRawOutputStream();
}
// Token: 0x0600BDFA RID: 48634 RVA: 0x002B3DA4 File Offset: 0x002B1FA4
[Token(Token = "0x600BDFA")]
[Address(RVA = "0x20007C0", Offset = "0x1FFF5C0", VA = "0x1820007C0")]
private static void WriteToGenerator(Asn1Generator ag, Asn1Encodable ae)
{
byte[] encoded = ae.GetEncoded();
}
// Token: 0x040078E4 RID: 30948
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40078E4")]
private readonly CmsSignedDataStreamGenerator outer;
// Token: 0x040078E5 RID: 30949
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40078E5")]
private Stream _out;
// Token: 0x040078E6 RID: 30950
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40078E6")]
private DerObjectIdentifier _contentOID;
// Token: 0x040078E7 RID: 30951
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x40078E7")]
private BerSequenceGenerator _sGen;
// Token: 0x040078E8 RID: 30952
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x40078E8")]
private BerSequenceGenerator _sigGen;
// Token: 0x040078E9 RID: 30953
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x40078E9")]
private BerSequenceGenerator _eiGen;
}
}
}
@@ -0,0 +1,390 @@
using System;
using System.Collections;
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: 0x02001D4D RID: 7501
[Token(Token = "0x2001D4D")]
public class CmsSignedGenerator
{
// Token: 0x0600BDFF RID: 48639 RVA: 0x002B414C File Offset: 0x002B234C
[Token(Token = "0x600BDFF")]
[Address(RVA = "0x20017C0", Offset = "0x20005C0", VA = "0x1820017C0")]
protected CmsSignedGenerator()
{
SecureRandom secureRandom = new SecureRandom();
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 = secureRandom;
}
// Token: 0x0600BE00 RID: 48640 RVA: 0x002B41B8 File Offset: 0x002B23B8
[Token(Token = "0x600BE00")]
[Address(RVA = "0x2001730", Offset = "0x2000530", VA = "0x182001730")]
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: 0x0600BE01 RID: 48641 RVA: 0x002B421C File Offset: 0x002B241C
[Token(Token = "0x600BE01")]
[Address(RVA = "0x2000FD0", Offset = "0x1FFFDD0", VA = "0x182000FD0", Slot = "4")]
protected internal virtual IDictionary GetBaseParameters(DerObjectIdentifier contentType, AlgorithmIdentifier digAlgId, byte[] hash)
{
IDictionary dictionary = Platform.CreateHashtable();
if (contentType != 0)
{
}
return dictionary;
}
// Token: 0x0600BE02 RID: 48642 RVA: 0x002B423C File Offset: 0x002B243C
[Token(Token = "0x600BE02")]
[Address(RVA = "0x2000F60", Offset = "0x1FFFD60", VA = "0x182000F60", Slot = "5")]
protected internal virtual Asn1Set GetAttributeSet(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attr)
{
/*
An exception occurred when decompiling this method (0600BE02)
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 1660
*/;
}
// Token: 0x0600BE03 RID: 48643 RVA: 0x002B425C File Offset: 0x002B245C
[Token(Token = "0x600BE03")]
[Address(RVA = "0x2000C30", Offset = "0x1FFFA30", VA = "0x182000C30")]
public void AddCertificates(IX509Store certStore)
{
IList certs = this._certs;
IList certificatesFromStore = CmsUtilities.GetCertificatesFromStore(certStore);
CollectionUtilities.AddRange(certs, certificatesFromStore);
}
// Token: 0x0600BE04 RID: 48644 RVA: 0x002B4280 File Offset: 0x002B2480
[Token(Token = "0x600BE04")]
[Address(RVA = "0x2000C60", Offset = "0x1FFFA60", VA = "0x182000C60")]
public void AddCrls(IX509Store crlStore)
{
IList crls = this._crls;
IList crlsFromStore = CmsUtilities.GetCrlsFromStore(crlStore);
CollectionUtilities.AddRange(crls, crlsFromStore);
}
// Token: 0x0600BE05 RID: 48645 RVA: 0x002B42A4 File Offset: 0x002B24A4
[Token(Token = "0x600BE05")]
[Address(RVA = "0x20008E0", Offset = "0x1FFF6E0", VA = "0x1820008E0")]
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 == 0)
{
return;
}
throw new NullReferenceException();
}
// Token: 0x0600BE06 RID: 48646 RVA: 0x002B4350 File Offset: 0x002B2550
[Token(Token = "0x600BE06")]
[Address(RVA = "0x2000C90", Offset = "0x1FFFA90", VA = "0x182000C90")]
public void AddSigners(SignerInformationStore signerStore)
{
int num;
do
{
num = 0;
IList list = Platform.CreateArrayList(signerStore.all);
Asn1Set attributeSet;
if (list != 0)
{
if (num < list)
{
num += num;
num++;
}
if (num == 0)
{
num++;
num += 19;
}
if (num == 0)
{
goto IL_61;
}
IList signers = this._signers;
if (num < num)
{
num += num;
num++;
}
attributeSet = this.GetAttributeSet(num);
num += num;
}
if (attributeSet != 0)
{
}
}
while (num != 0);
return;
IL_61:
throw new NullReferenceException();
}
// Token: 0x0600BE07 RID: 48647 RVA: 0x002B43C4 File Offset: 0x002B25C4
[Token(Token = "0x600BE07")]
[Address(RVA = "0x2001120", Offset = "0x1FFFF20", VA = "0x182001120")]
public IDictionary GetGeneratedDigests()
{
return Platform.CreateHashtable(this._digests);
}
// Token: 0x17001D6D RID: 7533
// (get) Token: 0x0600BE08 RID: 48648 RVA: 0x002B43DC File Offset: 0x002B25DC
// (set) Token: 0x0600BE09 RID: 48649 RVA: 0x002B43F0 File Offset: 0x002B25F0
[Token(Token = "0x17001D6D")]
public bool UseDerForCerts
{
[Token(Token = "0x600BE08")]
[Address(RVA = "0x4364F0", Offset = "0x4352F0", VA = "0x1804364F0")]
get
{
return this._useDerForCerts;
}
[Token(Token = "0x600BE09")]
[Address(RVA = "0x436790", Offset = "0x435590", VA = "0x180436790")]
set
{
this._useDerForCerts = value;
}
}
// Token: 0x17001D6E RID: 7534
// (get) Token: 0x0600BE0A RID: 48650 RVA: 0x002B4404 File Offset: 0x002B2604
// (set) Token: 0x0600BE0B RID: 48651 RVA: 0x002B4418 File Offset: 0x002B2618
[Token(Token = "0x17001D6E")]
public bool UseDerForCrls
{
[Token(Token = "0x600BE0A")]
[Address(RVA = "0x4364D0", Offset = "0x4352D0", VA = "0x1804364D0")]
get
{
return this._useDerForCrls;
}
[Token(Token = "0x600BE0B")]
[Address(RVA = "0x436770", Offset = "0x435570", VA = "0x180436770")]
set
{
this._useDerForCrls = value;
}
}
// Token: 0x0600BE0C RID: 48652 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600BE0C")]
[Address(RVA = "0x402080", Offset = "0x400E80", VA = "0x180402080", Slot = "6")]
internal virtual void AddSignerCallback(SignerInformation si)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600BE0D RID: 48653 RVA: 0x002B442C File Offset: 0x002B262C
[Token(Token = "0x600BE0D")]
[Address(RVA = "0x2001180", Offset = "0x1FFFF80", VA = "0x182001180")]
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: 0x0600BE0E RID: 48654 RVA: 0x002B4474 File Offset: 0x002B2674
[Token(Token = "0x600BE0E")]
[Address(RVA = "0x2001270", Offset = "0x2000070", VA = "0x182001270")]
internal static SignerIdentifier GetSignerIdentifier(byte[] subjectKeyIdentifier)
{
return new SignerIdentifier(new DerOctetString(subjectKeyIdentifier));
}
// Token: 0x040078EC RID: 30956
[Token(Token = "0x40078EC")]
public static readonly string Data = CmsObjectIdentifiers.Data.identifier;
// Token: 0x040078ED RID: 30957
[Token(Token = "0x40078ED")]
public static readonly string DigestSha1 = OiwObjectIdentifiers.IdSha1.identifier;
// Token: 0x040078EE RID: 30958
[Token(Token = "0x40078EE")]
public static readonly string DigestSha224 = NistObjectIdentifiers.IdSha224.identifier;
// Token: 0x040078EF RID: 30959
[Token(Token = "0x40078EF")]
public static readonly string DigestSha256 = NistObjectIdentifiers.IdSha256.identifier;
// Token: 0x040078F0 RID: 30960
[Token(Token = "0x40078F0")]
public static readonly string DigestSha384 = NistObjectIdentifiers.IdSha384.identifier;
// Token: 0x040078F1 RID: 30961
[Token(Token = "0x40078F1")]
public static readonly string DigestSha512 = NistObjectIdentifiers.IdSha512.identifier;
// Token: 0x040078F2 RID: 30962
[Token(Token = "0x40078F2")]
public static readonly string DigestMD5 = PkcsObjectIdentifiers.MD5.identifier;
// Token: 0x040078F3 RID: 30963
[Token(Token = "0x40078F3")]
public static readonly string DigestGost3411 = CryptoProObjectIdentifiers.GostR3411.identifier;
// Token: 0x040078F4 RID: 30964
[Token(Token = "0x40078F4")]
public static readonly string DigestRipeMD128 = TeleTrusTObjectIdentifiers.RipeMD128.identifier;
// Token: 0x040078F5 RID: 30965
[Token(Token = "0x40078F5")]
public static readonly string DigestRipeMD160 = TeleTrusTObjectIdentifiers.RipeMD160.identifier;
// Token: 0x040078F6 RID: 30966
[Token(Token = "0x40078F6")]
public static readonly string DigestRipeMD256 = TeleTrusTObjectIdentifiers.RipeMD256.identifier;
// Token: 0x040078F7 RID: 30967
[Token(Token = "0x40078F7")]
public static readonly string EncryptionRsa = PkcsObjectIdentifiers.RsaEncryption.identifier;
// Token: 0x040078F8 RID: 30968
[Token(Token = "0x40078F8")]
public static readonly string EncryptionDsa = X9ObjectIdentifiers.IdDsaWithSha1.identifier;
// Token: 0x040078F9 RID: 30969
[Token(Token = "0x40078F9")]
public static readonly string EncryptionECDsa = X9ObjectIdentifiers.ECDsaWithSha1.identifier;
// Token: 0x040078FA RID: 30970
[Token(Token = "0x40078FA")]
public static readonly string EncryptionRsaPss = PkcsObjectIdentifiers.IdRsassaPss.identifier;
// Token: 0x040078FB RID: 30971
[Token(Token = "0x40078FB")]
public static readonly string EncryptionGost3410 = CryptoProObjectIdentifiers.GostR3410x94.identifier;
// Token: 0x040078FC RID: 30972
[Token(Token = "0x40078FC")]
public static readonly string EncryptionECGost3410 = CryptoProObjectIdentifiers.GostR3410x2001.identifier;
// Token: 0x040078FD RID: 30973
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40078FD")]
internal IList _certs;
// Token: 0x040078FE RID: 30974
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40078FE")]
internal IList _crls;
// Token: 0x040078FF RID: 30975
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40078FF")]
internal IList _signers;
// Token: 0x04007900 RID: 30976
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007900")]
internal IDictionary _digests;
// Token: 0x04007901 RID: 30977
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007901")]
internal bool _useDerForCerts;
// Token: 0x04007902 RID: 30978
[FieldOffset(Offset = "0x31")]
[Token(Token = "0x4007902")]
internal bool _useDerForCrls;
// Token: 0x04007903 RID: 30979
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007903")]
protected readonly SecureRandom rand;
}
}
@@ -0,0 +1,354 @@
using System;
using System.Collections;
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: 0x02001D4E RID: 7502
[Token(Token = "0x2001D4E")]
internal class CmsSignedHelper
{
// Token: 0x0600BE10 RID: 48656 RVA: 0x002B45A0 File Offset: 0x002B27A0
[Token(Token = "0x600BE10")]
[Address(RVA = "0x2001CF0", Offset = "0x2000AF0", VA = "0x182001CF0")]
private static void AddEntries(DerObjectIdentifier oid, string digest, string encryption)
{
IDictionary dictionary = CmsSignedHelper.digestAlgs;
IDictionary dictionary2 = CmsSignedHelper.encryptionAlgs;
}
// Token: 0x0600BE11 RID: 48657 RVA: 0x002B45C0 File Offset: 0x002B27C0
[Token(Token = "0x600BE11")]
[Address(RVA = "0x2002FE0", Offset = "0x2001DE0", VA = "0x182002FE0")]
static CmsSignedHelper()
{
/*
An exception occurred when decompiling this method (0600BE11)
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 1660
*/;
}
// Token: 0x0600BE12 RID: 48658 RVA: 0x002B4ADC File Offset: 0x002B2CDC
[Token(Token = "0x600BE12")]
[Address(RVA = "0x2002420", Offset = "0x2001220", VA = "0x182002420")]
internal string GetDigestAlgName(string digestAlgOid)
{
IDictionary dictionary = CmsSignedHelper.digestAlgs;
return digestAlgOid;
}
// Token: 0x0600BE13 RID: 48659 RVA: 0x002B4AF8 File Offset: 0x002B2CF8
[Token(Token = "0x600BE13")]
[Address(RVA = "0x20026E0", Offset = "0x20014E0", VA = "0x1820026E0")]
internal AlgorithmIdentifier GetEncAlgorithmIdentifier(DerObjectIdentifier encOid, Asn1Encodable sigX509Parameters)
{
ISet set = CmsSignedHelper.noParams;
return new AlgorithmIdentifier(encOid, sigX509Parameters);
}
// Token: 0x0600BE14 RID: 48660 RVA: 0x002B4B20 File Offset: 0x002B2D20
[Token(Token = "0x600BE14")]
[Address(RVA = "0x20024D0", Offset = "0x20012D0", VA = "0x1820024D0")]
internal string[] GetDigestAliases(string algName)
{
IDictionary dictionary = CmsSignedHelper.digestAliases;
throw new NullReferenceException();
}
// Token: 0x0600BE15 RID: 48661 RVA: 0x002B4B38 File Offset: 0x002B2D38
[Token(Token = "0x600BE15")]
[Address(RVA = "0x2002ED0", Offset = "0x2001CD0", VA = "0x182002ED0")]
internal string GetEncryptionAlgName(string encryptionAlgOid)
{
IDictionary dictionary = CmsSignedHelper.encryptionAlgs;
return encryptionAlgOid;
}
// Token: 0x0600BE16 RID: 48662 RVA: 0x002B4B54 File Offset: 0x002B2D54
[Token(Token = "0x600BE16")]
[Address(RVA = "0x20025D0", Offset = "0x20013D0", VA = "0x1820025D0")]
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: 0x0600BE17 RID: 48663 RVA: 0x002B4B88 File Offset: 0x002B2D88
[Token(Token = "0x600BE17")]
[Address(RVA = "0x2002F80", Offset = "0x2001D80", VA = "0x182002F80")]
internal ISigner GetSignatureInstance(string algorithm)
{
return SignerUtilities.GetSigner(algorithm);
}
// Token: 0x0600BE18 RID: 48664 RVA: 0x002B4B9C File Offset: 0x002B2D9C
[Token(Token = "0x600BE18")]
[Address(RVA = "0x2001DD0", Offset = "0x2000BD0", VA = "0x182001DD0")]
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_8D;
}
Asn1Sequence asn1Sequence;
if (new X509V2AttributeCertificate(asn1Sequence.GetEncoded()) != 0)
{
}
if (num == 0)
{
break;
}
}
}
string text = "AttributeCertificate/" + type;
X509CollectionStoreParameters x509CollectionStoreParameters = new X509CollectionStoreParameters(list);
return X509StoreFactory.Create(text, x509CollectionStoreParameters);
IL_8D:
throw new NullReferenceException();
}
// Token: 0x0600BE19 RID: 48665 RVA: 0x002B4C3C File Offset: 0x002B2E3C
[Token(Token = "0x600BE19")]
[Address(RVA = "0x2002100", Offset = "0x2000F00", VA = "0x182002100")]
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: 0x0600BE1A RID: 48666 RVA: 0x002B4C88 File Offset: 0x002B2E88
[Token(Token = "0x600BE1A")]
[Address(RVA = "0x2002220", Offset = "0x2001020", VA = "0x182002220")]
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: 0x0600BE1B RID: 48667 RVA: 0x002B4CD4 File Offset: 0x002B2ED4
[Token(Token = "0x600BE1B")]
[Address(RVA = "0x2001880", Offset = "0x2000680", VA = "0x182001880")]
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_45;
}
byte[] array;
if (x509CertificateParser.ReadCertificate(array) != 0)
{
}
if (num == 0)
{
break;
}
}
}
return;
IL_45:
throw new NullReferenceException();
}
// Token: 0x0600BE1C RID: 48668 RVA: 0x002B4D2C File Offset: 0x002B2F2C
[Token(Token = "0x600BE1C")]
[Address(RVA = "0x2001AD0", Offset = "0x20008D0", VA = "0x182001AD0")]
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_3F;
}
byte[] array;
if (x509CrlParser.ReadCrl(array) != 0)
{
}
if (num == 0)
{
break;
}
}
}
return;
IL_3F:
throw new NullReferenceException();
}
// Token: 0x0600BE1D RID: 48669 RVA: 0x002B4D80 File Offset: 0x002B2F80
[Token(Token = "0x600BE1D")]
[Address(RVA = "0x2002340", Offset = "0x2001140", VA = "0x182002340")]
internal AlgorithmIdentifier FixAlgID(AlgorithmIdentifier algId)
{
if (algId.ObjectID != 0)
{
return algId;
}
Asn1Object asn1Object = algId.ToAsn1Object();
AlgorithmIdentifier algorithmIdentifier;
return algorithmIdentifier;
}
// Token: 0x0600BE1E RID: 48670 RVA: 0x002B4DA8 File Offset: 0x002B2FA8
[Token(Token = "0x600BE1E")]
[Address(RVA = "0x20027D0", Offset = "0x20015D0", VA = "0x1820027D0")]
internal string GetEncOid(AsymmetricKeyParameter key, string digestOID)
{
/*
An exception occurred when decompiling this method (0600BE1E)
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 1660
*/;
}
// Token: 0x0600BE1F RID: 48671 RVA: 0x002B4EA8 File Offset: 0x002B30A8
[Token(Token = "0x600BE1F")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public CmsSignedHelper()
{
}
// Token: 0x04007904 RID: 30980
[Token(Token = "0x4007904")]
internal static readonly CmsSignedHelper Instance;
// Token: 0x04007905 RID: 30981
[Token(Token = "0x4007905")]
private static readonly string EncryptionECDsaWithSha1;
// Token: 0x04007906 RID: 30982
[Token(Token = "0x4007906")]
private static readonly string EncryptionECDsaWithSha224;
// Token: 0x04007907 RID: 30983
[Token(Token = "0x4007907")]
private static readonly string EncryptionECDsaWithSha256;
// Token: 0x04007908 RID: 30984
[Token(Token = "0x4007908")]
private static readonly string EncryptionECDsaWithSha384;
// Token: 0x04007909 RID: 30985
[Token(Token = "0x4007909")]
private static readonly string EncryptionECDsaWithSha512;
// Token: 0x0400790A RID: 30986
[Token(Token = "0x400790A")]
private static readonly IDictionary encryptionAlgs;
// Token: 0x0400790B RID: 30987
[Token(Token = "0x400790B")]
private static readonly IDictionary digestAlgs;
// Token: 0x0400790C RID: 30988
[Token(Token = "0x400790C")]
private static readonly IDictionary digestAliases;
// Token: 0x0400790D RID: 30989
[Token(Token = "0x400790D")]
private static readonly ISet noParams;
// Token: 0x0400790E RID: 30990
[Token(Token = "0x400790E")]
private static readonly IDictionary ecAlgorithms;
}
}
@@ -0,0 +1,35 @@
using System;
using System.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D4F RID: 7503
[Token(Token = "0x2001D4F")]
[Serializable]
public class CmsStreamException : IOException
{
// Token: 0x0600BE20 RID: 48672 RVA: 0x002B4EBC File Offset: 0x002B30BC
[Token(Token = "0x600BE20")]
[Address(RVA = "0x18E71B0", Offset = "0x18E5FB0", VA = "0x1818E71B0")]
public CmsStreamException()
{
}
// Token: 0x0600BE21 RID: 48673 RVA: 0x002B4ED0 File Offset: 0x002B30D0
[Token(Token = "0x600BE21")]
[Address(RVA = "0x424140", Offset = "0x422F40", VA = "0x180424140")]
public CmsStreamException(string name)
: base(name)
{
}
// Token: 0x0600BE22 RID: 48674 RVA: 0x002B4EE4 File Offset: 0x002B30E4
[Token(Token = "0x600BE22")]
[Address(RVA = "0x18E71C0", Offset = "0x18E5FC0", VA = "0x1818E71C0")]
public CmsStreamException(string name, Exception e)
: base(name, e)
{
}
}
}
@@ -0,0 +1,109 @@
using System;
using System.IO;
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: 0x02001D50 RID: 7504
[Token(Token = "0x2001D50")]
public class CmsTypedStream
{
// Token: 0x0600BE23 RID: 48675 RVA: 0x002B4EFC File Offset: 0x002B30FC
[Token(Token = "0x600BE23")]
[Address(RVA = "0x2004660", Offset = "0x2003460", VA = "0x182004660")]
public CmsTypedStream(Stream inStream)
{
string identifier = PkcsObjectIdentifiers.Data.identifier;
}
// Token: 0x0600BE24 RID: 48676 RVA: 0x002B4F1C File Offset: 0x002B311C
[Token(Token = "0x600BE24")]
[Address(RVA = "0x20045A0", Offset = "0x20033A0", VA = "0x1820045A0")]
public CmsTypedStream(string oid, Stream inStream)
{
}
// Token: 0x0600BE25 RID: 48677 RVA: 0x002B4F2C File Offset: 0x002B312C
[Token(Token = "0x600BE25")]
[Address(RVA = "0x20045C0", Offset = "0x20033C0", VA = "0x1820045C0")]
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: 0x17001D6F RID: 7535
// (get) Token: 0x0600BE26 RID: 48678 RVA: 0x002B4F5C File Offset: 0x002B315C
[Token(Token = "0x17001D6F")]
public string ContentType
{
[Token(Token = "0x600BE26")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
get
{
return this._oid;
}
}
// Token: 0x17001D70 RID: 7536
// (get) Token: 0x0600BE27 RID: 48679 RVA: 0x002B4F70 File Offset: 0x002B3170
[Token(Token = "0x17001D70")]
public Stream ContentStream
{
[Token(Token = "0x600BE27")]
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
get
{
return this._in;
}
}
// Token: 0x0600BE28 RID: 48680 RVA: 0x002B4F84 File Offset: 0x002B3184
[Token(Token = "0x600BE28")]
[Address(RVA = "0x2004540", Offset = "0x2003340", VA = "0x182004540")]
public void Drain()
{
Streams.Drain(this._in);
Platform.Dispose(this._in);
}
// Token: 0x0400790F RID: 30991
[Token(Token = "0x400790F")]
private const int BufferSize = 32768;
// Token: 0x04007910 RID: 30992
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007910")]
private readonly string _oid;
// Token: 0x04007911 RID: 30993
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007911")]
private readonly Stream _in;
// Token: 0x02001D51 RID: 7505
[Token(Token = "0x2001D51")]
private class FullReaderStream : FilterStream
{
// Token: 0x0600BE29 RID: 48681 RVA: 0x002B4FA8 File Offset: 0x002B31A8
[Token(Token = "0x600BE29")]
[Address(RVA = "0x1880EE0", Offset = "0x187FCE0", VA = "0x181880EE0")]
internal FullReaderStream(Stream input)
: base(input)
{
}
// Token: 0x0600BE2A RID: 48682 RVA: 0x002B4FBC File Offset: 0x002B31BC
[Token(Token = "0x600BE2A")]
[Address(RVA = "0x200A370", Offset = "0x2009170", VA = "0x18200A370", Slot = "27")]
public override int Read(byte[] buf, int off, int len)
{
return Streams.ReadFully(this.s, buf, off, len);
}
}
}
}
@@ -0,0 +1,290 @@
using System;
using System.Collections;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.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: 0x02001D52 RID: 7506
[Token(Token = "0x2001D52")]
internal class CmsUtilities
{
// Token: 0x17001D71 RID: 7537
// (get) Token: 0x0600BE2B RID: 48683 RVA: 0x002B4FD8 File Offset: 0x002B31D8
[Token(Token = "0x17001D71")]
internal static int MaximumMemory
{
[Token(Token = "0x600BE2B")]
[Address(RVA = "0x2005640", Offset = "0x2004440", VA = "0x182005640")]
get
{
return int.MaxValue;
}
}
// Token: 0x0600BE2C RID: 48684 RVA: 0x002B4FEC File Offset: 0x002B31EC
[Token(Token = "0x600BE2C")]
[Address(RVA = "0x2005450", Offset = "0x2004250", VA = "0x182005450")]
internal static ContentInfo ReadContentInfo(byte[] input)
{
return CmsUtilities.ReadContentInfo(new Asn1InputStream(input));
}
// Token: 0x0600BE2D RID: 48685 RVA: 0x002B5004 File Offset: 0x002B3204
[Token(Token = "0x600BE2D")]
[Address(RVA = "0x20054B0", Offset = "0x20042B0", VA = "0x1820054B0")]
internal static ContentInfo ReadContentInfo(Stream input)
{
return CmsUtilities.ReadContentInfo(new Asn1InputStream(input, int.MaxValue));
}
// Token: 0x0600BE2E RID: 48686 RVA: 0x002B5024 File Offset: 0x002B3224
[Token(Token = "0x600BE2E")]
[Address(RVA = "0x2005510", Offset = "0x2004310", VA = "0x182005510")]
private static ContentInfo ReadContentInfo(Asn1InputStream aIn)
{
return ContentInfo.GetInstance(aIn.ReadObject());
}
// Token: 0x0600BE2F RID: 48687 RVA: 0x002B5044 File Offset: 0x002B3244
[Token(Token = "0x600BE2F")]
[Address(RVA = "0x2005620", Offset = "0x2004420", VA = "0x182005620")]
public static byte[] StreamToByteArray(Stream inStream)
{
return Streams.ReadAll(inStream);
}
// Token: 0x0600BE30 RID: 48688 RVA: 0x002B5058 File Offset: 0x002B3258
[Token(Token = "0x600BE30")]
[Address(RVA = "0x2005630", Offset = "0x2004430", VA = "0x182005630")]
public static byte[] StreamToByteArray(Stream inStream, int limit)
{
return Streams.ReadAllLimited(inStream, limit);
}
// Token: 0x0600BE31 RID: 48689 RVA: 0x002B506C File Offset: 0x002B326C
[Token(Token = "0x600BE31")]
[Address(RVA = "0x2004D00", Offset = "0x2003B00", VA = "0x182004D00")]
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 != 0)
{
throw new NullReferenceException();
}
}
return list;
}
// Token: 0x0600BE32 RID: 48690 RVA: 0x002B50EC File Offset: 0x002B32EC
[Token(Token = "0x600BE32")]
[Address(RVA = "0x2005030", Offset = "0x2003E30", VA = "0x182005030")]
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 != 0)
{
throw new NullReferenceException();
}
}
return list;
}
// Token: 0x0600BE33 RID: 48691 RVA: 0x002B516C File Offset: 0x002B336C
[Token(Token = "0x600BE33")]
[Address(RVA = "0x20047A0", Offset = "0x20035A0", VA = "0x1820047A0")]
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_71;
}
array = new Asn1Encodable[1];
if (num != 0)
{
}
array[0] = num;
asn1EncodableVector.Add(array);
}
if (array != 0)
{
}
}
while (num != 0);
BerSet berSet = new BerSet(asn1EncodableVector);
throw new NullReferenceException();
IL_71:
throw new NullReferenceException();
}
// Token: 0x0600BE34 RID: 48692 RVA: 0x002B51F0 File Offset: 0x002B33F0
[Token(Token = "0x600BE34")]
[Address(RVA = "0x2004A50", Offset = "0x2003850", VA = "0x182004A50")]
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_71;
}
array = new Asn1Encodable[1];
if (num != 0)
{
}
array[0] = num;
asn1EncodableVector.Add(array);
}
if (array != 0)
{
}
}
while (num != 0);
DerSet derSet = new DerSet(asn1EncodableVector);
throw new NullReferenceException();
IL_71:
throw new NullReferenceException();
}
// Token: 0x0600BE35 RID: 48693 RVA: 0x002B5274 File Offset: 0x002B3474
[Token(Token = "0x600BE35")]
[Address(RVA = "0x2004700", Offset = "0x2003500", VA = "0x182004700")]
internal static Stream CreateBerOctetOutputStream(Stream s, int tagNo, bool isExplicit, int bufferSize)
{
return new BerOctetStringGenerator(s, tagNo, isExplicit).GetOctetOutputStream(bufferSize);
}
// Token: 0x0600BE36 RID: 48694 RVA: 0x002B5298 File Offset: 0x002B3498
[Token(Token = "0x600BE36")]
[Address(RVA = "0x2005410", Offset = "0x2004210", VA = "0x182005410")]
internal static TbsCertificateStructure GetTbsCertificateStructure(X509Certificate cert)
{
DateTime notAfter = cert.NotAfter;
Asn1Object asn1Object;
return TbsCertificateStructure.GetInstance(asn1Object);
}
// Token: 0x0600BE37 RID: 48695 RVA: 0x002B52B8 File Offset: 0x002B34B8
[Token(Token = "0x600BE37")]
[Address(RVA = "0x2005360", Offset = "0x2004160", VA = "0x182005360")]
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: 0x0600BE38 RID: 48696 RVA: 0x002B52FC File Offset: 0x002B34FC
[Token(Token = "0x600BE38")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public CmsUtilities()
{
}
}
}
@@ -0,0 +1,43 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D53 RID: 7507
[Token(Token = "0x2001D53")]
internal class CounterSignatureDigestCalculator : IDigestCalculator
{
// Token: 0x0600BE39 RID: 48697 RVA: 0x002B5310 File Offset: 0x002B3510
[Token(Token = "0x600BE39")]
[Address(RVA = "0x4089A0", Offset = "0x4077A0", VA = "0x1804089A0")]
internal CounterSignatureDigestCalculator(string alg, byte[] data)
{
this.alg = alg;
this.data = data;
}
// Token: 0x0600BE3A RID: 48698 RVA: 0x002B5334 File Offset: 0x002B3534
[Token(Token = "0x600BE3A")]
[Address(RVA = "0x2005650", Offset = "0x2004450", VA = "0x182005650", 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: 0x04007912 RID: 30994
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007912")]
private readonly string alg;
// Token: 0x04007913 RID: 30995
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007913")]
private readonly byte[] data;
}
}
@@ -0,0 +1,86 @@
using System;
using System.Collections;
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: 0x02001D54 RID: 7508
[Token(Token = "0x2001D54")]
public class DefaultAuthenticatedAttributeTableGenerator : CmsAttributeTableGenerator
{
// Token: 0x0600BE3B RID: 48699 RVA: 0x002B536C File Offset: 0x002B356C
[Token(Token = "0x600BE3B")]
[Address(RVA = "0x2007220", Offset = "0x2006020", VA = "0x182007220")]
public DefaultAuthenticatedAttributeTableGenerator()
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
}
// Token: 0x0600BE3C RID: 48700 RVA: 0x002B5390 File Offset: 0x002B3590
[Token(Token = "0x600BE3C")]
[Address(RVA = "0x2007190", Offset = "0x2005F90", VA = "0x182007190")]
public DefaultAuthenticatedAttributeTableGenerator(AttributeTable attributeTable)
{
if (attributeTable == 0)
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
return;
}
IDictionary dictionary2 = attributeTable.ToDictionary();
this.table = dictionary2;
}
// Token: 0x0600BE3D RID: 48701 RVA: 0x002B53C8 File Offset: 0x002B35C8
[Token(Token = "0x600BE3D")]
[Address(RVA = "0x2006DA0", Offset = "0x2005BA0", VA = "0x182006DA0", 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: 0x0600BE3E RID: 48702 RVA: 0x002B543C File Offset: 0x002B363C
[Token(Token = "0x600BE3E")]
[Address(RVA = "0x2007120", Offset = "0x2005F20", VA = "0x182007120", Slot = "6")]
public virtual AttributeTable GetAttributes(IDictionary parameters)
{
AttributeTable attributes = this.GetAttributes(parameters);
AttributeTable attributeTable;
return attributeTable;
}
// Token: 0x04007914 RID: 30996
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007914")]
private readonly IDictionary table;
}
}
@@ -0,0 +1,184 @@
using System;
using System.Collections;
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: 0x02001D4C RID: 7500
[Token(Token = "0x2001D4C")]
public class DefaultDigestAlgorithmIdentifierFinder
{
// Token: 0x0600BDFB RID: 48635 RVA: 0x002B3DC0 File Offset: 0x002B1FC0
[Token(Token = "0x600BDFB")]
[Address(RVA = "0x2007280", Offset = "0x2006080", VA = "0x182007280")]
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: 0x0600BDFC RID: 48636 RVA: 0x002B40B8 File Offset: 0x002B22B8
[Token(Token = "0x600BDFC")]
[Address(RVA = "0x2008320", Offset = "0x2007120", VA = "0x182008320")]
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: 0x0600BDFD RID: 48637 RVA: 0x002B4114 File Offset: 0x002B2314
[Token(Token = "0x600BDFD")]
[Address(RVA = "0x2008560", Offset = "0x2007360", VA = "0x182008560")]
public AlgorithmIdentifier find(string digAlgName)
{
IDictionary dictionary = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
IDictionary dictionary2 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
AlgorithmIdentifier algorithmIdentifier;
return algorithmIdentifier;
}
// Token: 0x0600BDFE RID: 48638 RVA: 0x002B4138 File Offset: 0x002B2338
[Token(Token = "0x600BDFE")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public DefaultDigestAlgorithmIdentifierFinder()
{
}
// Token: 0x040078EA RID: 30954
[Token(Token = "0x40078EA")]
private static readonly IDictionary digestOids;
// Token: 0x040078EB RID: 30955
[Token(Token = "0x40078EB")]
private static readonly IDictionary digestNameToOids;
}
}
@@ -0,0 +1,97 @@
using System;
using System.Collections;
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: 0x02001D55 RID: 7509
[Token(Token = "0x2001D55")]
public class DefaultSignedAttributeTableGenerator : CmsAttributeTableGenerator
{
// Token: 0x0600BE3F RID: 48703 RVA: 0x002B5454 File Offset: 0x002B3654
[Token(Token = "0x600BE3F")]
[Address(RVA = "0x2008C50", Offset = "0x2007A50", VA = "0x182008C50")]
public DefaultSignedAttributeTableGenerator()
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
}
// Token: 0x0600BE40 RID: 48704 RVA: 0x002B5478 File Offset: 0x002B3678
[Token(Token = "0x600BE40")]
[Address(RVA = "0x2008BC0", Offset = "0x20079C0", VA = "0x182008BC0")]
public DefaultSignedAttributeTableGenerator(AttributeTable attributeTable)
{
if (attributeTable == 0)
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
return;
}
IDictionary dictionary2 = attributeTable.ToDictionary();
this.table = dictionary2;
}
// Token: 0x0600BE41 RID: 48705 RVA: 0x002B54B0 File Offset: 0x002B36B0
[Token(Token = "0x600BE41")]
[Address(RVA = "0x2008CB0", Offset = "0x2007AB0", VA = "0x182008CB0", Slot = "5")]
protected virtual Hashtable createStandardAttributeTable(IDictionary parameters)
{
Hashtable hashtable = new Hashtable(this.table);
this.DoCreateStandardAttributeTable(parameters, hashtable);
return hashtable;
}
// Token: 0x0600BE42 RID: 48706 RVA: 0x002B54D4 File Offset: 0x002B36D4
[Token(Token = "0x600BE42")]
[Address(RVA = "0x20086A0", Offset = "0x20074A0", VA = "0x1820086A0")]
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: 0x0600BE43 RID: 48707 RVA: 0x002B5560 File Offset: 0x002B3760
[Token(Token = "0x600BE43")]
[Address(RVA = "0x2008B50", Offset = "0x2007950", VA = "0x182008B50", Slot = "6")]
public virtual AttributeTable GetAttributes(IDictionary parameters)
{
AttributeTable attributes = this.GetAttributes(parameters);
AttributeTable attributeTable;
return attributeTable;
}
// Token: 0x04007915 RID: 30997
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007915")]
private readonly IDictionary table;
}
}
@@ -0,0 +1,15 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D56 RID: 7510
[Token(Token = "0x2001D56")]
internal interface IDigestCalculator
{
// Token: 0x0600BE44 RID: 48708
[Token(Token = "0x600BE44")]
[Address(Slot = "0")]
byte[] GetDigest();
}
}
@@ -0,0 +1,18 @@
using System;
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: 0x02001D69 RID: 7529
[Token(Token = "0x2001D69")]
internal interface ISignerInfoGenerator
{
// Token: 0x0600BEA0 RID: 48800
[Token(Token = "0x600BEA0")]
[Address(Slot = "0")]
SignerInfo Generate(DerObjectIdentifier contentType, AlgorithmIdentifier digestAlgorithm, byte[] calculatedDigest);
}
}
@@ -0,0 +1,136 @@
using System;
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: 0x02001D57 RID: 7511
[Token(Token = "0x2001D57")]
internal class KekRecipientInfoGenerator : RecipientInfoGenerator
{
// Token: 0x0600BE45 RID: 48709 RVA: 0x002B5578 File Offset: 0x002B3778
[Token(Token = "0x600BE45")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
internal KekRecipientInfoGenerator()
{
}
// Token: 0x17001D72 RID: 7538
// (set) Token: 0x0600BE46 RID: 48710 RVA: 0x002B558C File Offset: 0x002B378C
[Token(Token = "0x17001D72")]
internal KekIdentifier KekIdentifier
{
[Token(Token = "0x600BE46")]
[Address(RVA = "0x460F90", Offset = "0x45FD90", VA = "0x180460F90")]
set
{
this.kekIdentifier = value;
}
}
// Token: 0x17001D73 RID: 7539
// (set) Token: 0x0600BE47 RID: 48711 RVA: 0x002B55A0 File Offset: 0x002B37A0
[Token(Token = "0x17001D73")]
internal KeyParameter KeyEncryptionKey
{
[Token(Token = "0x600BE47")]
[Address(RVA = "0x200EEB0", Offset = "0x200DCB0", VA = "0x18200EEB0")]
set
{
string text = this.keyEncryptionKeyOID;
this.keyEncryptionKey = value;
AlgorithmIdentifier algorithmIdentifier = KekRecipientInfoGenerator.DetermineKeyEncAlg(text, value);
this.keyEncryptionAlgorithm = algorithmIdentifier;
}
}
// Token: 0x17001D74 RID: 7540
// (set) Token: 0x0600BE48 RID: 48712 RVA: 0x002B55CC File Offset: 0x002B37CC
[Token(Token = "0x17001D74")]
internal string KeyEncryptionKeyOID
{
[Token(Token = "0x600BE48")]
[Address(RVA = "0x3F7210", Offset = "0x3F6010", VA = "0x1803F7210")]
set
{
this.keyEncryptionKeyOID = value;
}
}
// Token: 0x0600BE49 RID: 48713 RVA: 0x002B55E0 File Offset: 0x002B37E0
[Token(Token = "0x600BE49")]
[Address(RVA = "0x200EC70", Offset = "0x200DA70", VA = "0x18200EC70", 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: 0x0600BE4A RID: 48714 RVA: 0x002B5648 File Offset: 0x002B3848
[Token(Token = "0x600BE4A")]
[Address(RVA = "0x200E700", Offset = "0x200D500", VA = "0x18200E700")]
private static AlgorithmIdentifier DetermineKeyEncAlg(string algorithm, KeyParameter key)
{
/*
An exception occurred when decompiling this method (0600BE4A)
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 1660
*/;
}
// Token: 0x04007916 RID: 30998
[Token(Token = "0x4007916")]
private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance;
// Token: 0x04007917 RID: 30999
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007917")]
private KeyParameter keyEncryptionKey;
// Token: 0x04007918 RID: 31000
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007918")]
private string keyEncryptionKeyOID;
// Token: 0x04007919 RID: 31001
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007919")]
private KekIdentifier kekIdentifier;
// Token: 0x0400791A RID: 31002
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400791A")]
private AlgorithmIdentifier keyEncryptionAlgorithm;
}
}
@@ -0,0 +1,49 @@
using System;
using System.IO;
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: 0x02001D58 RID: 7512
[Token(Token = "0x2001D58")]
public class KekRecipientInformation : RecipientInformation
{
// Token: 0x0600BE4C RID: 48716 RVA: 0x002B576C File Offset: 0x002B396C
[Token(Token = "0x600BE4C")]
[Address(RVA = "0x200F140", Offset = "0x200DF40", VA = "0x18200F140")]
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: 0x0600BE4D RID: 48717 RVA: 0x002B57BC File Offset: 0x002B39BC
[Token(Token = "0x600BE4D")]
[Address(RVA = "0x200EF30", Offset = "0x200DD30", VA = "0x18200EF30", 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: 0x0400791B RID: 31003
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400791B")]
private KekRecipientInfo info;
}
}
@@ -0,0 +1,253 @@
using System;
using System.Collections;
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: 0x02001D59 RID: 7513
[Token(Token = "0x2001D59")]
internal class KeyAgreeRecipientInfoGenerator : RecipientInfoGenerator
{
// Token: 0x0600BE4E RID: 48718 RVA: 0x002B5840 File Offset: 0x002B3A40
[Token(Token = "0x600BE4E")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
internal KeyAgreeRecipientInfoGenerator()
{
}
// Token: 0x17001D75 RID: 7541
// (set) Token: 0x0600BE4F RID: 48719 RVA: 0x002B5854 File Offset: 0x002B3A54
[Token(Token = "0x17001D75")]
internal DerObjectIdentifier KeyAgreementOID
{
[Token(Token = "0x600BE4F")]
[Address(RVA = "0x3F7200", Offset = "0x3F6000", VA = "0x1803F7200")]
set
{
this.keyAgreementOID = value;
}
}
// Token: 0x17001D76 RID: 7542
// (set) Token: 0x0600BE50 RID: 48720 RVA: 0x002B5868 File Offset: 0x002B3A68
[Token(Token = "0x17001D76")]
internal DerObjectIdentifier KeyEncryptionOID
{
[Token(Token = "0x600BE50")]
[Address(RVA = "0x3F7210", Offset = "0x3F6010", VA = "0x1803F7210")]
set
{
this.keyEncryptionOID = value;
}
}
// Token: 0x17001D77 RID: 7543
// (set) Token: 0x0600BE51 RID: 48721 RVA: 0x002B587C File Offset: 0x002B3A7C
[Token(Token = "0x17001D77")]
internal ICollection RecipientCerts
{
[Token(Token = "0x600BE51")]
[Address(RVA = "0x20100F0", Offset = "0x200EEF0", VA = "0x1820100F0")]
set
{
IList list = Platform.CreateArrayList(value);
this.recipientCerts = list;
}
}
// Token: 0x17001D78 RID: 7544
// (set) Token: 0x0600BE52 RID: 48722 RVA: 0x002B5898 File Offset: 0x002B3A98
[Token(Token = "0x17001D78")]
internal AsymmetricCipherKeyPair SenderKeyPair
{
[Token(Token = "0x600BE52")]
[Address(RVA = "0x409C60", Offset = "0x408A60", VA = "0x180409C60")]
set
{
this.senderKeyPair = value;
}
}
// Token: 0x0600BE53 RID: 48723 RVA: 0x002B58AC File Offset: 0x002B3AAC
[Token(Token = "0x600BE53")]
[Address(RVA = "0x200F360", Offset = "0x200E160", VA = "0x18200F360", 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_25C;
}
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_250;
}
if (mqvuserKeyingMaterial == 0)
{
}
if (mqvuserKeyingMaterial == 0)
{
goto IL_250;
}
if (privateParameter == 0)
{
}
if (privateParameter == 0)
{
goto IL_250;
}
}
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 == 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_250:
throw new NullReferenceException();
IL_25C:
throw new NullReferenceException();
}
// Token: 0x0600BE54 RID: 48724 RVA: 0x002B5B30 File Offset: 0x002B3D30
[Token(Token = "0x600BE54")]
[Address(RVA = "0x200F240", Offset = "0x200E040", VA = "0x18200F240")]
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: 0x0400791C RID: 31004
[Token(Token = "0x400791C")]
private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance;
// Token: 0x0400791D RID: 31005
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400791D")]
private DerObjectIdentifier keyAgreementOID;
// Token: 0x0400791E RID: 31006
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400791E")]
private DerObjectIdentifier keyEncryptionOID;
// Token: 0x0400791F RID: 31007
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400791F")]
private IList recipientCerts;
// Token: 0x04007920 RID: 31008
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007920")]
private AsymmetricCipherKeyPair senderKeyPair;
}
}
@@ -0,0 +1,256 @@
using System;
using System.Collections;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.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: 0x02001D5A RID: 7514
[Token(Token = "0x2001D5A")]
public class KeyAgreeRecipientInformation : RecipientInformation
{
// Token: 0x0600BE56 RID: 48726 RVA: 0x002B5B84 File Offset: 0x002B3D84
[Token(Token = "0x600BE56")]
[Address(RVA = "0x2010CC0", Offset = "0x200FAC0", VA = "0x182010CC0")]
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 == 0)
{
return;
}
throw new NullReferenceException();
}
// Token: 0x0600BE57 RID: 48727 RVA: 0x002B5C68 File Offset: 0x002B3E68
[Token(Token = "0x600BE57")]
[Address(RVA = "0x20111A0", Offset = "0x200FFA0", VA = "0x1820111A0")]
internal KeyAgreeRecipientInformation(KeyAgreeRecipientInfo info, RecipientID rid, Asn1OctetString encryptedKey, CmsSecureReadable secureReadable)
{
this.rid = rid;
this.encryptedKey = encryptedKey;
this.info = info;
}
// Token: 0x0600BE58 RID: 48728 RVA: 0x002B5C90 File Offset: 0x002B3E90
[Token(Token = "0x600BE58")]
[Address(RVA = "0x2010760", Offset = "0x200F560", VA = "0x182010760")]
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: 0x0600BE59 RID: 48729 RVA: 0x002B5D40 File Offset: 0x002B3F40
[Token(Token = "0x600BE59")]
[Address(RVA = "0x20106A0", Offset = "0x200F4A0", VA = "0x1820106A0")]
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: 0x0600BE5A RID: 48730 RVA: 0x002B5D74 File Offset: 0x002B3F74
[Token(Token = "0x600BE5A")]
[Address(RVA = "0x2010640", Offset = "0x200F440", VA = "0x182010640")]
private AsymmetricKeyParameter GetPublicKeyFromOriginatorID(OriginatorID origID)
{
/*
An exception occurred when decompiling this method (0600BE5A)
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 1660
*/;
}
// Token: 0x0600BE5B RID: 48731 RVA: 0x002B5D8C File Offset: 0x002B3F8C
[Token(Token = "0x600BE5B")]
[Address(RVA = "0x2010160", Offset = "0x200EF60", VA = "0x182010160")]
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: 0x0600BE5C RID: 48732 RVA: 0x002B5E24 File Offset: 0x002B4024
[Token(Token = "0x600BE5C")]
[Address(RVA = "0x2011070", Offset = "0x200FE70", VA = "0x182011070")]
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: 0x0600BE5D RID: 48733 RVA: 0x002B5E5C File Offset: 0x002B405C
[Token(Token = "0x600BE5D")]
[Address(RVA = "0x20108C0", Offset = "0x200F6C0", VA = "0x1820108C0")]
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: 0x0600BE5E RID: 48734 RVA: 0x002B5FC8 File Offset: 0x002B41C8
[Token(Token = "0x600BE5E")]
[Address(RVA = "0x20104E0", Offset = "0x200F2E0", VA = "0x1820104E0", Slot = "4")]
public override CmsTypedStream GetContentStream(ICipherParameters key)
{
/*
An exception occurred when decompiling this method (0600BE5E)
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 1660
*/;
}
// Token: 0x04007921 RID: 31009
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007921")]
private KeyAgreeRecipientInfo info;
// Token: 0x04007922 RID: 31010
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007922")]
private Asn1OctetString encryptedKey;
}
}
@@ -0,0 +1,120 @@
using System;
using System.Collections;
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: 0x02001D5B RID: 7515
[Token(Token = "0x2001D5B")]
internal class KeyTransRecipientInfoGenerator : RecipientInfoGenerator
{
// Token: 0x0600BE5F RID: 48735 RVA: 0x002B6010 File Offset: 0x002B4210
[Token(Token = "0x600BE5F")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
internal KeyTransRecipientInfoGenerator()
{
}
// Token: 0x17001D79 RID: 7545
// (set) Token: 0x0600BE60 RID: 48736 RVA: 0x002B6024 File Offset: 0x002B4224
[Token(Token = "0x17001D79")]
internal X509Certificate RecipientCert
{
[Token(Token = "0x600BE60")]
[Address(RVA = "0x20114D0", Offset = "0x20102D0", VA = "0x1820114D0")]
set
{
DateTime notAfter = value.NotAfter;
Asn1Object asn1Object;
TbsCertificateStructure instance = TbsCertificateStructure.GetInstance(asn1Object);
this.recipientTbsCert = instance;
ICollection collection;
this.recipientPublicKey = collection;
SubjectPublicKeyInfo subjectPublicKeyInfo = this.recipientTbsCert.subjectPublicKeyInfo;
this.info = subjectPublicKeyInfo;
}
}
// Token: 0x17001D7A RID: 7546
// (set) Token: 0x0600BE61 RID: 48737 RVA: 0x002B6068 File Offset: 0x002B4268
[Token(Token = "0x17001D7A")]
internal AsymmetricKeyParameter RecipientPublicKey
{
[Token(Token = "0x600BE61")]
[Address(RVA = "0x2011550", Offset = "0x2010350", VA = "0x182011550")]
set
{
this.recipientPublicKey = value;
SubjectPublicKeyInfo subjectPublicKeyInfo = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(this.recipientPublicKey);
this.info = subjectPublicKeyInfo;
}
}
// Token: 0x17001D7B RID: 7547
// (set) Token: 0x0600BE62 RID: 48738 RVA: 0x002B609C File Offset: 0x002B429C
[Token(Token = "0x17001D7B")]
internal Asn1OctetString SubjectKeyIdentifier
{
[Token(Token = "0x600BE62")]
[Address(RVA = "0x460F90", Offset = "0x45FD90", VA = "0x180460F90")]
set
{
this.subjectKeyIdentifier = value;
}
}
// Token: 0x0600BE63 RID: 48739 RVA: 0x002B60B0 File Offset: 0x002B42B0
[Token(Token = "0x600BE63")]
[Address(RVA = "0x2011200", Offset = "0x2010000", VA = "0x182011200", 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: 0x04007923 RID: 31011
[Token(Token = "0x4007923")]
private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance;
// Token: 0x04007924 RID: 31012
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007924")]
private TbsCertificateStructure recipientTbsCert;
// Token: 0x04007925 RID: 31013
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007925")]
private AsymmetricKeyParameter recipientPublicKey;
// Token: 0x04007926 RID: 31014
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007926")]
private Asn1OctetString subjectKeyIdentifier;
// Token: 0x04007927 RID: 31015
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007927")]
private SubjectPublicKeyInfo info;
}
}
@@ -0,0 +1,83 @@
using System;
using System.IO;
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: 0x02001D5C RID: 7516
[Token(Token = "0x2001D5C")]
public class KeyTransRecipientInformation : RecipientInformation
{
// Token: 0x0600BE65 RID: 48741 RVA: 0x002B6160 File Offset: 0x002B4360
[Token(Token = "0x600BE65")]
[Address(RVA = "0x20119B0", Offset = "0x20107B0", VA = "0x1820119B0")]
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: 0x0600BE66 RID: 48742 RVA: 0x002B6238 File Offset: 0x002B4438
[Token(Token = "0x600BE66")]
[Address(RVA = "0x2011620", Offset = "0x2010420", VA = "0x182011620")]
private string GetExchangeEncryptionAlgorithmName(DerObjectIdentifier oid)
{
DerObjectIdentifier rsaEncryption = PkcsObjectIdentifiers.RsaEncryption;
return oid.identifier;
}
// Token: 0x0600BE67 RID: 48743 RVA: 0x002B6260 File Offset: 0x002B4460
[Token(Token = "0x600BE67")]
[Address(RVA = "0x20116C0", Offset = "0x20104C0", VA = "0x1820116C0")]
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: 0x0600BE68 RID: 48744 RVA: 0x002B62B4 File Offset: 0x002B44B4
[Token(Token = "0x600BE68")]
[Address(RVA = "0x20115F0", Offset = "0x20103F0", VA = "0x1820115F0", Slot = "4")]
public override CmsTypedStream GetContentStream(ICipherParameters key)
{
KeyParameter keyParameter = this.UnwrapKey(key);
return base.GetContentFromSessionKey(keyParameter);
}
// Token: 0x04007928 RID: 31016
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007928")]
private KeyTransRecipientInfo info;
}
}
@@ -0,0 +1,60 @@
using System;
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: 0x02001D5D RID: 7517
[Token(Token = "0x2001D5D")]
public class OriginatorID : X509CertStoreSelector
{
// Token: 0x0600BE69 RID: 48745 RVA: 0x002B62D0 File Offset: 0x002B44D0
[Token(Token = "0x600BE69")]
[Address(RVA = "0x2011C70", Offset = "0x2010A70", VA = "0x182011C70", Slot = "2")]
public override int GetHashCode()
{
/*
An exception occurred when decompiling this method (0600BE69)
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 1660
*/;
}
// Token: 0x0600BE6A RID: 48746 RVA: 0x002B630C File Offset: 0x002B450C
[Token(Token = "0x600BE6A")]
[Address(RVA = "0x2011B50", Offset = "0x2010950", VA = "0x182011B50", 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: 0x0600BE6B RID: 48747 RVA: 0x002B6350 File Offset: 0x002B4550
[Token(Token = "0x600BE6B")]
[Address(RVA = "0x2011D20", Offset = "0x2010B20", VA = "0x182011D20")]
public OriginatorID()
{
}
}
}
@@ -0,0 +1,77 @@
using System;
using System.Collections;
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: 0x02001D5E RID: 7518
[Token(Token = "0x2001D5E")]
public class OriginatorInfoGenerator
{
// Token: 0x0600BE6C RID: 48748 RVA: 0x002B6364 File Offset: 0x002B4564
[Token(Token = "0x600BE6C")]
[Address(RVA = "0x2011DC0", Offset = "0x2010BC0", VA = "0x182011DC0")]
public OriginatorInfoGenerator(X509Certificate origCert)
{
IList list = Platform.CreateArrayList(1);
this.origCerts = list;
this.origCrls = (ulong)0L;
throw new NullReferenceException();
}
// Token: 0x0600BE6D RID: 48749 RVA: 0x002B6394 File Offset: 0x002B4594
[Token(Token = "0x600BE6D")]
[Address(RVA = "0x2011EF0", Offset = "0x2010CF0", VA = "0x182011EF0")]
public OriginatorInfoGenerator(IX509Store origCerts)
{
IList certificatesFromStore = CmsUtilities.GetCertificatesFromStore(origCerts);
this.origCerts = certificatesFromStore;
this.origCrls = (ulong)0L;
}
// Token: 0x0600BE6E RID: 48750 RVA: 0x002B63C0 File Offset: 0x002B45C0
[Token(Token = "0x600BE6E")]
[Address(RVA = "0x2011E80", Offset = "0x2010C80", VA = "0x182011E80")]
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: 0x0600BE6F RID: 48751 RVA: 0x002B63FC File Offset: 0x002B45FC
[Token(Token = "0x600BE6F")]
[Address(RVA = "0x2011D30", Offset = "0x2010B30", VA = "0x182011D30", 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: 0x04007929 RID: 31017
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007929")]
private readonly IList origCerts;
// Token: 0x0400792A RID: 31018
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400792A")]
private readonly IList origCrls;
}
}
@@ -0,0 +1,132 @@
using System;
using System.Collections;
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: 0x02001D5F RID: 7519
[Token(Token = "0x2001D5F")]
public class OriginatorInformation
{
// Token: 0x0600BE70 RID: 48752 RVA: 0x002B6430 File Offset: 0x002B4630
[Token(Token = "0x600BE70")]
[Address(RVA = "0x3FFB80", Offset = "0x3FE980", VA = "0x1803FFB80")]
internal OriginatorInformation(OriginatorInfo originatorInfo)
{
this.originatorInfo = originatorInfo;
}
// Token: 0x0600BE71 RID: 48753 RVA: 0x002B644C File Offset: 0x002B464C
[Token(Token = "0x600BE71")]
[Address(RVA = "0x2011F30", Offset = "0x2010D30", VA = "0x182011F30", 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_82;
}
X509CertificateStructure x509CertificateStructure;
if (new X509Certificate(x509CertificateStructure) != 0)
{
}
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_82:
throw new NullReferenceException();
}
// Token: 0x0600BE72 RID: 48754 RVA: 0x002B64E8 File Offset: 0x002B46E8
[Token(Token = "0x600BE72")]
[Address(RVA = "0x20122C0", Offset = "0x20110C0", VA = "0x1820122C0", 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_82;
}
CertificateList certificateList;
if (new X509Crl(certificateList) != 0)
{
}
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_82:
throw new NullReferenceException();
}
// Token: 0x0600BE73 RID: 48755 RVA: 0x002B6584 File Offset: 0x002B4784
[Token(Token = "0x600BE73")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20", Slot = "6")]
public virtual OriginatorInfo ToAsn1Structure()
{
return this.originatorInfo;
}
// Token: 0x0400792B RID: 31019
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400792B")]
private readonly OriginatorInfo originatorInfo;
}
}
@@ -0,0 +1,115 @@
using System;
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: 0x02001D62 RID: 7522
[Token(Token = "0x2001D62")]
internal class PasswordRecipientInfoGenerator : RecipientInfoGenerator
{
// Token: 0x0600BE7E RID: 48766 RVA: 0x002B6710 File Offset: 0x002B4910
[Token(Token = "0x600BE7E")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
internal PasswordRecipientInfoGenerator()
{
}
// Token: 0x17001D7C RID: 7548
// (set) Token: 0x0600BE7F RID: 48767 RVA: 0x002B6724 File Offset: 0x002B4924
[Token(Token = "0x17001D7C")]
internal AlgorithmIdentifier KeyDerivationAlgorithm
{
[Token(Token = "0x600BE7F")]
[Address(RVA = "0x3F7200", Offset = "0x3F6000", VA = "0x1803F7200")]
set
{
this.keyDerivationAlgorithm = value;
}
}
// Token: 0x17001D7D RID: 7549
// (set) Token: 0x0600BE80 RID: 48768 RVA: 0x002B6738 File Offset: 0x002B4938
[Token(Token = "0x17001D7D")]
internal KeyParameter KeyEncryptionKey
{
[Token(Token = "0x600BE80")]
[Address(RVA = "0x3F7210", Offset = "0x3F6010", VA = "0x1803F7210")]
set
{
this.keyEncryptionKey = value;
}
}
// Token: 0x17001D7E RID: 7550
// (set) Token: 0x0600BE81 RID: 48769 RVA: 0x002B674C File Offset: 0x002B494C
[Token(Token = "0x17001D7E")]
internal string KeyEncryptionKeyOID
{
[Token(Token = "0x600BE81")]
[Address(RVA = "0x460F90", Offset = "0x45FD90", VA = "0x180460F90")]
set
{
this.keyEncryptionKeyOID = value;
}
}
// Token: 0x0600BE82 RID: 48770 RVA: 0x002B6760 File Offset: 0x002B4960
[Token(Token = "0x600BE82")]
[Address(RVA = "0x2012650", Offset = "0x2011450", VA = "0x182012650", 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: 0x0400792C RID: 31020
[Token(Token = "0x400792C")]
private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance;
// Token: 0x0400792D RID: 31021
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400792D")]
private AlgorithmIdentifier keyDerivationAlgorithm;
// Token: 0x0400792E RID: 31022
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400792E")]
private KeyParameter keyEncryptionKey;
// Token: 0x0400792F RID: 31023
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400792F")]
private string keyEncryptionKeyOID;
}
}
@@ -0,0 +1,74 @@
using System;
using System.IO;
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: 0x02001D63 RID: 7523
[Token(Token = "0x2001D63")]
public class PasswordRecipientInformation : RecipientInformation
{
// Token: 0x0600BE84 RID: 48772 RVA: 0x002B6858 File Offset: 0x002B4A58
[Token(Token = "0x600BE84")]
[Address(RVA = "0x2012EC0", Offset = "0x2011CC0", VA = "0x182012EC0")]
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: 0x17001D7F RID: 7551
// (get) Token: 0x0600BE85 RID: 48773 RVA: 0x002B6890 File Offset: 0x002B4A90
[Token(Token = "0x17001D7F")]
public virtual AlgorithmIdentifier KeyDerivationAlgorithm
{
[Token(Token = "0x600BE85")]
[Address(RVA = "0x420450", Offset = "0x41F250", VA = "0x180420450", Slot = "5")]
get
{
return this.info.keyDerivationAlgorithm;
}
}
// Token: 0x0600BE86 RID: 48774 RVA: 0x002B68B0 File Offset: 0x002B4AB0
[Token(Token = "0x600BE86")]
[Address(RVA = "0x2012A90", Offset = "0x2011890", VA = "0x182012A90", 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: 0x04007930 RID: 31024
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007930")]
private readonly PasswordRecipientInfo info;
}
}
@@ -0,0 +1,70 @@
using System;
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: 0x02001D60 RID: 7520
[Token(Token = "0x2001D60")]
public class Pkcs5Scheme2PbeKey : CmsPbeKey
{
// Token: 0x0600BE74 RID: 48756 RVA: 0x002B6598 File Offset: 0x002B4798
[Token(Token = "0x600BE74")]
[Address(RVA = "0x20130A0", Offset = "0x2011EA0", VA = "0x1820130A0")]
[Obsolete]
public Pkcs5Scheme2PbeKey(string password, byte[] salt, int iterationCount)
{
char[] array = password.ToCharArray();
base..ctor(array, salt, iterationCount);
}
// Token: 0x0600BE75 RID: 48757 RVA: 0x002B65BC File Offset: 0x002B47BC
[Token(Token = "0x600BE75")]
[Address(RVA = "0x1666C30", Offset = "0x1665A30", VA = "0x181666C30")]
[Obsolete]
public Pkcs5Scheme2PbeKey(string password, AlgorithmIdentifier keyDerivationAlgorithm)
{
char[] array = password.ToCharArray();
base..ctor(array, keyDerivationAlgorithm);
}
// Token: 0x0600BE76 RID: 48758 RVA: 0x002B65E0 File Offset: 0x002B47E0
[Token(Token = "0x600BE76")]
[Address(RVA = "0x2013100", Offset = "0x2011F00", VA = "0x182013100")]
public Pkcs5Scheme2PbeKey(char[] password, byte[] salt, int iterationCount)
: base(password, salt, iterationCount)
{
}
// Token: 0x0600BE77 RID: 48759 RVA: 0x002B65F8 File Offset: 0x002B47F8
[Token(Token = "0x600BE77")]
[Address(RVA = "0x2013110", Offset = "0x2011F10", VA = "0x182013110")]
public Pkcs5Scheme2PbeKey(char[] password, AlgorithmIdentifier keyDerivationAlgorithm)
: base(password, keyDerivationAlgorithm)
{
}
// Token: 0x0600BE78 RID: 48760 RVA: 0x002B6610 File Offset: 0x002B4810
[Token(Token = "0x600BE78")]
[Address(RVA = "0x2012F50", Offset = "0x2011D50", VA = "0x182012F50", 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,70 @@
using System;
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: 0x02001D61 RID: 7521
[Token(Token = "0x2001D61")]
public class Pkcs5Scheme2Utf8PbeKey : CmsPbeKey
{
// Token: 0x0600BE79 RID: 48761 RVA: 0x002B6654 File Offset: 0x002B4854
[Token(Token = "0x600BE79")]
[Address(RVA = "0x20130A0", Offset = "0x2011EA0", VA = "0x1820130A0")]
[Obsolete]
public Pkcs5Scheme2Utf8PbeKey(string password, byte[] salt, int iterationCount)
{
char[] array = password.ToCharArray();
base..ctor(array, salt, iterationCount);
}
// Token: 0x0600BE7A RID: 48762 RVA: 0x002B6678 File Offset: 0x002B4878
[Token(Token = "0x600BE7A")]
[Address(RVA = "0x1666C30", Offset = "0x1665A30", VA = "0x181666C30")]
[Obsolete]
public Pkcs5Scheme2Utf8PbeKey(string password, AlgorithmIdentifier keyDerivationAlgorithm)
{
char[] array = password.ToCharArray();
base..ctor(array, keyDerivationAlgorithm);
}
// Token: 0x0600BE7B RID: 48763 RVA: 0x002B669C File Offset: 0x002B489C
[Token(Token = "0x600BE7B")]
[Address(RVA = "0x2013100", Offset = "0x2011F00", VA = "0x182013100")]
public Pkcs5Scheme2Utf8PbeKey(char[] password, byte[] salt, int iterationCount)
: base(password, salt, iterationCount)
{
}
// Token: 0x0600BE7C RID: 48764 RVA: 0x002B66B4 File Offset: 0x002B48B4
[Token(Token = "0x600BE7C")]
[Address(RVA = "0x2013110", Offset = "0x2011F10", VA = "0x182013110")]
public Pkcs5Scheme2Utf8PbeKey(char[] password, AlgorithmIdentifier keyDerivationAlgorithm)
: base(password, keyDerivationAlgorithm)
{
}
// Token: 0x0600BE7D RID: 48765 RVA: 0x002B66CC File Offset: 0x002B48CC
[Token(Token = "0x600BE7D")]
[Address(RVA = "0x2013120", Offset = "0x2011F20", VA = "0x182013120", 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,91 @@
using System;
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: 0x02001D64 RID: 7524
[Token(Token = "0x2001D64")]
public class RecipientID : X509CertStoreSelector
{
// Token: 0x17001D80 RID: 7552
// (get) Token: 0x0600BE87 RID: 48775 RVA: 0x002B6994 File Offset: 0x002B4B94
// (set) Token: 0x0600BE88 RID: 48776 RVA: 0x002B69AC File Offset: 0x002B4BAC
[Token(Token = "0x17001D80")]
public byte[] KeyIdentifier
{
[Token(Token = "0x600BE87")]
[Address(RVA = "0x20134B0", Offset = "0x20122B0", VA = "0x1820134B0")]
get
{
return Arrays.Clone(this.keyIdentifier);
}
[Token(Token = "0x600BE88")]
[Address(RVA = "0x2013510", Offset = "0x2012310", VA = "0x182013510")]
set
{
byte[] array = Arrays.Clone(value);
this.keyIdentifier = array;
}
}
// Token: 0x0600BE89 RID: 48777 RVA: 0x002B69C8 File Offset: 0x002B4BC8
[Token(Token = "0x600BE89")]
[Address(RVA = "0x20133E0", Offset = "0x20121E0", VA = "0x1820133E0", 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: 0x0600BE8A RID: 48778 RVA: 0x002B6A14 File Offset: 0x002B4C14
[Token(Token = "0x600BE8A")]
[Address(RVA = "0x2013270", Offset = "0x2012070", VA = "0x182013270", 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: 0x0600BE8B RID: 48779 RVA: 0x002B6A68 File Offset: 0x002B4C68
[Token(Token = "0x600BE8B")]
[Address(RVA = "0x2011D20", Offset = "0x2010B20", VA = "0x182011D20")]
public RecipientID()
{
}
// Token: 0x04007931 RID: 31025
[FieldOffset(Offset = "0x88")]
[Token(Token = "0x4007931")]
private byte[] keyIdentifier;
}
}
@@ -0,0 +1,18 @@
using System;
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: 0x02001D65 RID: 7525
[Token(Token = "0x2001D65")]
internal interface RecipientInfoGenerator
{
// Token: 0x0600BE8C RID: 48780
[Token(Token = "0x600BE8C")]
[Address(Slot = "0")]
RecipientInfo Generate(KeyParameter contentEncryptionKey, SecureRandom random);
}
}
@@ -0,0 +1,168 @@
using System;
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: 0x02001D66 RID: 7526
[Token(Token = "0x2001D66")]
public abstract class RecipientInformation
{
// Token: 0x0600BE8D RID: 48781 RVA: 0x002B6A7C File Offset: 0x002B4C7C
[Token(Token = "0x600BE8D")]
[Address(RVA = "0x2013FC0", Offset = "0x2012DC0", VA = "0x182013FC0")]
internal RecipientInformation(AlgorithmIdentifier keyEncAlg, CmsSecureReadable secureReadable)
{
RecipientID recipientID = new RecipientID();
this.rid = recipientID;
base..ctor();
this.keyEncAlg = keyEncAlg;
this.secureReadable = secureReadable;
}
// Token: 0x0600BE8E RID: 48782 RVA: 0x002B6AAC File Offset: 0x002B4CAC
[Token(Token = "0x600BE8E")]
[Address(RVA = "0x2013AD0", Offset = "0x20128D0", VA = "0x182013AD0")]
internal string GetContentAlgorithmName()
{
CmsSecureReadable cmsSecureReadable = this.secureReadable;
int num = 0;
num += num;
num++;
throw new NullReferenceException();
}
// Token: 0x17001D81 RID: 7553
// (get) Token: 0x0600BE8F RID: 48783 RVA: 0x002B6AD4 File Offset: 0x002B4CD4
[Token(Token = "0x17001D81")]
public RecipientID RecipientID
{
[Token(Token = "0x600BE8F")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
get
{
return this.rid;
}
}
// Token: 0x17001D82 RID: 7554
// (get) Token: 0x0600BE90 RID: 48784 RVA: 0x002B6AE8 File Offset: 0x002B4CE8
[Token(Token = "0x17001D82")]
public AlgorithmIdentifier KeyEncryptionAlgorithmID
{
[Token(Token = "0x600BE90")]
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
get
{
return this.keyEncAlg;
}
}
// Token: 0x17001D83 RID: 7555
// (get) Token: 0x0600BE91 RID: 48785 RVA: 0x002B6AFC File Offset: 0x002B4CFC
[Token(Token = "0x17001D83")]
public string KeyEncryptionAlgOid
{
[Token(Token = "0x600BE91")]
[Address(RVA = "0x2014040", Offset = "0x2012E40", VA = "0x182014040")]
get
{
Asn1Object asn1Object = this.keyEncAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001D84 RID: 7556
// (get) Token: 0x0600BE92 RID: 48786 RVA: 0x002B6B1C File Offset: 0x002B4D1C
[Token(Token = "0x17001D84")]
public Asn1Object KeyEncryptionAlgParams
{
[Token(Token = "0x600BE92")]
[Address(RVA = "0x2014080", Offset = "0x2012E80", VA = "0x182014080")]
get
{
DerObjectIdentifier objectID = this.keyEncAlg.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600BE93 RID: 48787 RVA: 0x002B6B48 File Offset: 0x002B4D48
[Token(Token = "0x600BE93")]
[Address(RVA = "0x2013BA0", Offset = "0x20129A0", VA = "0x182013BA0")]
internal CmsTypedStream GetContentFromSessionKey(KeyParameter sKey)
{
CmsSecureReadable cmsSecureReadable = this.secureReadable;
int num = 0;
num += num;
num++;
uint num2;
if (num < (int)num2)
{
num += num;
num++;
}
string identifier;
uint num3;
CmsTypedStream cmsTypedStream = new CmsTypedStream(identifier, num, (int)num3);
identifier = PkcsObjectIdentifiers.Data.identifier;
return cmsTypedStream;
}
// Token: 0x0600BE94 RID: 48788 RVA: 0x002B6BB8 File Offset: 0x002B4DB8
[Token(Token = "0x600BE94")]
[Address(RVA = "0x2013DE0", Offset = "0x2012BE0", VA = "0x182013DE0")]
public byte[] GetContent(ICipherParameters key)
{
string text = this.ToString();
byte[] array;
return array;
}
// Token: 0x0600BE95 RID: 48789 RVA: 0x002B6BE8 File Offset: 0x002B4DE8
[Token(Token = "0x600BE95")]
[Address(RVA = "0x2013EB0", Offset = "0x2012CB0", VA = "0x182013EB0")]
public byte[] GetMac()
{
if (this.resultMac == (ulong)0L)
{
CmsSecureReadable cmsSecureReadable = this.secureReadable;
byte[] array;
this.resultMac = array;
}
return Arrays.Clone(this.resultMac);
}
// Token: 0x0600BE96 RID: 48790
[Token(Token = "0x600BE96")]
[Address(Slot = "4")]
public abstract CmsTypedStream GetContentStream(ICipherParameters key);
// Token: 0x04007932 RID: 31026
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007932")]
internal RecipientID rid;
// Token: 0x04007933 RID: 31027
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007933")]
internal AlgorithmIdentifier keyEncAlg;
// Token: 0x04007934 RID: 31028
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007934")]
internal CmsSecureReadable secureReadable;
// Token: 0x04007935 RID: 31029
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007935")]
private byte[] resultMac;
}
}
@@ -0,0 +1,146 @@
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D67 RID: 7527
[Token(Token = "0x2001D67")]
public class RecipientInformationStore
{
// Token: 0x0600BE97 RID: 48791 RVA: 0x002B6C20 File Offset: 0x002B4E20
[Token(Token = "0x600BE97")]
[Address(RVA = "0x20137C0", Offset = "0x20125C0", VA = "0x1820137C0")]
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_6F;
}
IDictionary dictionary2 = this.table;
if (num != 0 && num == 0)
{
goto IL_5D;
}
IDictionary dictionary3 = this.table;
list = Platform.CreateArrayList(1);
num2 = 0;
}
if (list != 0)
{
}
}
while (num2 != 0);
IList list2;
this.all = list2;
return;
IL_5D:
throw new NullReferenceException();
IL_6F:
throw new NullReferenceException();
}
// Token: 0x17001D85 RID: 7557
[Token(Token = "0x17001D85")]
public RecipientInformation this[RecipientID selector]
{
[Token(Token = "0x600BE98")]
[Address(RVA = "0x2013580", Offset = "0x2012380", VA = "0x182013580")]
get
{
IDictionary dictionary;
do
{
dictionary = this.table;
}
while (dictionary == 0);
throw new NullReferenceException();
}
}
// Token: 0x0600BE99 RID: 48793 RVA: 0x002B6CCC File Offset: 0x002B4ECC
[Token(Token = "0x600BE99")]
[Address(RVA = "0x2013580", Offset = "0x2012380", VA = "0x182013580")]
public RecipientInformation GetFirstRecipient(RecipientID selector)
{
IDictionary dictionary;
do
{
dictionary = this.table;
}
while (dictionary == 0);
throw new NullReferenceException();
}
// Token: 0x17001D86 RID: 7558
// (get) Token: 0x0600BE9A RID: 48794 RVA: 0x002B6CF0 File Offset: 0x002B4EF0
[Token(Token = "0x17001D86")]
public int Count
{
[Token(Token = "0x600BE9A")]
[Address(RVA = "0x2013A80", Offset = "0x2012880", VA = "0x182013A80")]
get
{
IList list = this.all;
throw new NullReferenceException();
}
}
// Token: 0x0600BE9B RID: 48795 RVA: 0x002B6D0C File Offset: 0x002B4F0C
[Token(Token = "0x600BE9B")]
[Address(RVA = "0x2013760", Offset = "0x2012560", VA = "0x182013760")]
public ICollection GetRecipients()
{
/*
An exception occurred when decompiling this method (0600BE9B)
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 1660
*/;
}
// Token: 0x0600BE9C RID: 48796 RVA: 0x002B6D24 File Offset: 0x002B4F24
[Token(Token = "0x600BE9C")]
[Address(RVA = "0x2013670", Offset = "0x2012470", VA = "0x182013670")]
public ICollection GetRecipients(RecipientID selector)
{
IDictionary dictionary = this.table;
IList list = Platform.CreateArrayList();
throw new NullReferenceException();
}
// Token: 0x04007936 RID: 31030
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007936")]
private readonly IList all;
// Token: 0x04007937 RID: 31031
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007937")]
private readonly IDictionary table;
}
}
@@ -0,0 +1,60 @@
using System;
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: 0x02001D68 RID: 7528
[Token(Token = "0x2001D68")]
public class SignerID : X509CertStoreSelector
{
// Token: 0x0600BE9D RID: 48797 RVA: 0x002B6D48 File Offset: 0x002B4F48
[Token(Token = "0x600BE9D")]
[Address(RVA = "0x20141F0", Offset = "0x2012FF0", VA = "0x1820141F0", Slot = "2")]
public override int GetHashCode()
{
/*
An exception occurred when decompiling this method (0600BE9D)
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 1660
*/;
}
// Token: 0x0600BE9E RID: 48798 RVA: 0x002B6D84 File Offset: 0x002B4F84
[Token(Token = "0x600BE9E")]
[Address(RVA = "0x20140D0", Offset = "0x2012ED0", VA = "0x1820140D0", 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: 0x0600BE9F RID: 48799 RVA: 0x002B6DC8 File Offset: 0x002B4FC8
[Token(Token = "0x600BE9F")]
[Address(RVA = "0x2011D20", Offset = "0x2010B20", VA = "0x182011D20")]
public SignerID()
{
}
}
}
@@ -0,0 +1,90 @@
using System;
using System.Collections;
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: 0x02001D6A RID: 7530
[Token(Token = "0x2001D6A")]
public class SignerInfoGenerator
{
// Token: 0x0600BEA1 RID: 48801 RVA: 0x002B6DDC File Offset: 0x002B4FDC
[Token(Token = "0x600BEA1")]
[Address(RVA = "0x2015050", Offset = "0x2013E50", VA = "0x182015050")]
internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory signerFactory)
{
}
// Token: 0x0600BEA2 RID: 48802 RVA: 0x002B6DEC File Offset: 0x002B4FEC
[Token(Token = "0x600BEA2")]
[Address(RVA = "0x2014F10", Offset = "0x2013D10", VA = "0x182014F10")]
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: 0x0600BEA3 RID: 48803 RVA: 0x002B6E40 File Offset: 0x002B5040
[Token(Token = "0x600BEA3")]
[Address(RVA = "0x2014FF0", Offset = "0x2013DF0", VA = "0x182014FF0")]
internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory contentSigner, CmsAttributeTableGenerator signedGen, CmsAttributeTableGenerator unsignedGen)
{
this.sigId = sigId;
this.signedGen = signedGen;
this.unsignedGen = 0;
this.contentSigner = contentSigner;
}
// Token: 0x0600BEA4 RID: 48804 RVA: 0x002B6E70 File Offset: 0x002B5070
[Token(Token = "0x600BEA4")]
[Address(RVA = "0x3F7200", Offset = "0x3F6000", VA = "0x1803F7200")]
internal void setAssociatedCertificate(X509Certificate certificate)
{
this.certificate = certificate;
}
// Token: 0x04007938 RID: 31032
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007938")]
internal X509Certificate certificate;
// Token: 0x04007939 RID: 31033
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007939")]
internal ISignatureFactory contentSigner;
// Token: 0x0400793A RID: 31034
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400793A")]
internal SignerIdentifier sigId;
// Token: 0x0400793B RID: 31035
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400793B")]
internal CmsAttributeTableGenerator signedGen;
// Token: 0x0400793C RID: 31036
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400793C")]
internal CmsAttributeTableGenerator unsignedGen;
// Token: 0x0400793D RID: 31037
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x400793D")]
private bool isDirectSignature;
}
}
@@ -0,0 +1,118 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D6B RID: 7531
[Token(Token = "0x2001D6B")]
public class SignerInfoGeneratorBuilder
{
// Token: 0x0600BEA5 RID: 48805 RVA: 0x002B6E84 File Offset: 0x002B5084
[Token(Token = "0x600BEA5")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public SignerInfoGeneratorBuilder()
{
}
// Token: 0x0600BEA6 RID: 48806 RVA: 0x002B6E98 File Offset: 0x002B5098
[Token(Token = "0x600BEA6")]
[Address(RVA = "0x20145A0", Offset = "0x20133A0", VA = "0x1820145A0")]
public SignerInfoGeneratorBuilder SetDirectSignature(bool hasNoSignedAttributes)
{
this.directSignature = hasNoSignedAttributes;
return this;
}
// Token: 0x0600BEA7 RID: 48807 RVA: 0x002B6EB0 File Offset: 0x002B50B0
[Token(Token = "0x600BEA7")]
[Address(RVA = "0x1871FF0", Offset = "0x1870DF0", VA = "0x181871FF0")]
public SignerInfoGeneratorBuilder WithSignedAttributeGenerator(CmsAttributeTableGenerator signedGen)
{
this.signedGen = signedGen;
return this;
}
// Token: 0x0600BEA8 RID: 48808 RVA: 0x002B6EC8 File Offset: 0x002B50C8
[Token(Token = "0x600BEA8")]
[Address(RVA = "0x1872000", Offset = "0x1870E00", VA = "0x181872000")]
public SignerInfoGeneratorBuilder WithUnsignedAttributeGenerator(CmsAttributeTableGenerator unsignedGen)
{
this.unsignedGen = unsignedGen;
return this;
}
// Token: 0x0600BEA9 RID: 48809 RVA: 0x002B6EE0 File Offset: 0x002B50E0
[Token(Token = "0x600BEA9")]
[Address(RVA = "0x20142A0", Offset = "0x20130A0", VA = "0x1820142A0")]
public SignerInfoGenerator Build(ISignatureFactory contentSigner, X509Certificate certificate)
{
BigInteger serialNumber = certificate.SerialNumber;
int version = certificate.Version;
IssuerAndSerialNumber issuerAndSerialNumber;
SignerIdentifier signerIdentifier = new SignerIdentifier(issuerAndSerialNumber);
SignerInfoGenerator signerInfoGenerator = this.CreateGenerator(contentSigner, signerIdentifier);
signerInfoGenerator.certificate = certificate;
return signerInfoGenerator;
}
// Token: 0x0600BEAA RID: 48810 RVA: 0x002B6F20 File Offset: 0x002B5120
[Token(Token = "0x600BEAA")]
[Address(RVA = "0x20143C0", Offset = "0x20131C0", VA = "0x1820143C0")]
public SignerInfoGenerator Build(ISignatureFactory signerFactory, byte[] subjectKeyIdentifier)
{
SignerIdentifier signerIdentifier = new SignerIdentifier(new DerOctetString(subjectKeyIdentifier));
return this.CreateGenerator(signerFactory, signerIdentifier);
}
// Token: 0x0600BEAB RID: 48811 RVA: 0x002B6F44 File Offset: 0x002B5144
[Token(Token = "0x600BEAB")]
[Address(RVA = "0x2014460", Offset = "0x2013260", VA = "0x182014460")]
private SignerInfoGenerator CreateGenerator(ISignatureFactory contentSigner, SignerIdentifier sigId)
{
/*
An exception occurred when decompiling this method (0600BEAB)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInfoGenerator BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInfoGeneratorBuilder::CreateGenerator(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ISignatureFactory,BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.SignerIdentifier)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_70:
stloc:int32(var_8_71, ldc.i4:int32(0))
stfld:SignerIdentifier(SignerInfoGenerator::sigId, ldloc:SignerInfoGenerator(var_7), ldloc:SignerIdentifier(sigId))
stfld:ISignatureFactory(SignerInfoGenerator::contentSigner, ldloc:SignerInfoGenerator(var_7), ldloc:ISignatureFactory(contentSigner))
stfld:bool(SignerInfoGenerator::isDirectSignature, ldloc:SignerInfoGenerator(var_7), ldc.i4:bool(1))
stfld:CmsAttributeTableGenerator(SignerInfoGenerator::signedGen, ldloc:SignerInfoGenerator(var_7), ldloc:int32[exp:CmsAttributeTableGenerator](var_8_71))
stfld:CmsAttributeTableGenerator(SignerInfoGenerator::unsignedGen, ldloc:SignerInfoGenerator(var_7), ldloc:int32[exp:CmsAttributeTableGenerator](var_8_71))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1660
*/;
}
// Token: 0x0400793E RID: 31038
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400793E")]
private bool directSignature;
// Token: 0x0400793F RID: 31039
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400793F")]
private CmsAttributeTableGenerator signedGen;
// Token: 0x04007940 RID: 31040
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007940")]
private CmsAttributeTableGenerator unsignedGen;
}
}
@@ -0,0 +1,736 @@
using System;
using System.Collections;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.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: 0x02001D6C RID: 7532
[Token(Token = "0x2001D6C")]
public class SignerInformation
{
// Token: 0x0600BEAC RID: 48812 RVA: 0x002B6FF0 File Offset: 0x002B51F0
[Token(Token = "0x600BEAC")]
[Address(RVA = "0x2017FB0", Offset = "0x2016DB0", VA = "0x182017FB0")]
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: 0x0600BEAD RID: 48813 RVA: 0x002B714C File Offset: 0x002B534C
[Token(Token = "0x600BEAD")]
[Address(RVA = "0x2017EF0", Offset = "0x2016CF0", VA = "0x182017EF0")]
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: 0x17001D87 RID: 7559
// (get) Token: 0x0600BEAE RID: 48814 RVA: 0x002B7234 File Offset: 0x002B5434
[Token(Token = "0x17001D87")]
public bool IsCounterSignature
{
[Token(Token = "0x600BEAE")]
[Address(RVA = "0x7C9360", Offset = "0x7C8160", VA = "0x1807C9360")]
get
{
return this.isCounterSignature;
}
}
// Token: 0x17001D88 RID: 7560
// (get) Token: 0x0600BEAF RID: 48815 RVA: 0x002B7248 File Offset: 0x002B5448
[Token(Token = "0x17001D88")]
public DerObjectIdentifier ContentType
{
[Token(Token = "0x600BEAF")]
[Address(RVA = "0x415290", Offset = "0x414090", VA = "0x180415290")]
get
{
return this.contentType;
}
}
// Token: 0x17001D89 RID: 7561
// (get) Token: 0x0600BEB0 RID: 48816 RVA: 0x002B725C File Offset: 0x002B545C
[Token(Token = "0x17001D89")]
public SignerID SignerID
{
[Token(Token = "0x600BEB0")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
get
{
return this.sid;
}
}
// Token: 0x17001D8A RID: 7562
// (get) Token: 0x0600BEB1 RID: 48817 RVA: 0x002B7270 File Offset: 0x002B5470
[Token(Token = "0x17001D8A")]
public int Version
{
[Token(Token = "0x600BEB1")]
[Address(RVA = "0x166DBE0", Offset = "0x166C9E0", VA = "0x18166DBE0")]
get
{
return this.info.version.Value.IntValue;
}
}
// Token: 0x17001D8B RID: 7563
// (get) Token: 0x0600BEB2 RID: 48818 RVA: 0x002B7298 File Offset: 0x002B5498
[Token(Token = "0x17001D8B")]
public AlgorithmIdentifier DigestAlgorithmID
{
[Token(Token = "0x600BEB2")]
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
get
{
return this.digestAlgorithm;
}
}
// Token: 0x17001D8C RID: 7564
// (get) Token: 0x0600BEB3 RID: 48819 RVA: 0x002B72AC File Offset: 0x002B54AC
[Token(Token = "0x17001D8C")]
public string DigestAlgOid
{
[Token(Token = "0x600BEB3")]
[Address(RVA = "0x1661330", Offset = "0x1660130", VA = "0x181661330")]
get
{
Asn1Object asn1Object = this.digestAlgorithm.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001D8D RID: 7565
// (get) Token: 0x0600BEB4 RID: 48820 RVA: 0x002B72CC File Offset: 0x002B54CC
[Token(Token = "0x17001D8D")]
public Asn1Object DigestAlgParams
{
[Token(Token = "0x600BEB4")]
[Address(RVA = "0x20181C0", Offset = "0x2016FC0", VA = "0x1820181C0")]
get
{
DerObjectIdentifier objectID = this.digestAlgorithm.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600BEB5 RID: 48821 RVA: 0x002B72F8 File Offset: 0x002B54F8
[Token(Token = "0x600BEB5")]
[Address(RVA = "0x2016BB0", Offset = "0x20159B0", VA = "0x182016BB0")]
public byte[] GetContentDigest()
{
/*
An exception occurred when decompiling this method (0600BEB5)
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 1660
*/;
}
// Token: 0x17001D8E RID: 7566
// (get) Token: 0x0600BEB6 RID: 48822 RVA: 0x002B7318 File Offset: 0x002B5518
[Token(Token = "0x17001D8E")]
public AlgorithmIdentifier EncryptionAlgorithmID
{
[Token(Token = "0x600BEB6")]
[Address(RVA = "0x3F63E0", Offset = "0x3F51E0", VA = "0x1803F63E0")]
get
{
return this.encryptionAlgorithm;
}
}
// Token: 0x17001D8F RID: 7567
// (get) Token: 0x0600BEB7 RID: 48823 RVA: 0x002B732C File Offset: 0x002B552C
[Token(Token = "0x17001D8F")]
public string EncryptionAlgOid
{
[Token(Token = "0x600BEB7")]
[Address(RVA = "0x2018210", Offset = "0x2017010", VA = "0x182018210")]
get
{
Asn1Object asn1Object = this.encryptionAlgorithm.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001D90 RID: 7568
// (get) Token: 0x0600BEB8 RID: 48824 RVA: 0x002B734C File Offset: 0x002B554C
[Token(Token = "0x17001D90")]
public Asn1Object EncryptionAlgParams
{
[Token(Token = "0x600BEB8")]
[Address(RVA = "0x2018250", Offset = "0x2017050", VA = "0x182018250")]
get
{
DerObjectIdentifier objectID = this.encryptionAlgorithm.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x17001D91 RID: 7569
// (get) Token: 0x0600BEB9 RID: 48825 RVA: 0x002B7378 File Offset: 0x002B5578
[Token(Token = "0x17001D91")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable SignedAttributes
{
[Token(Token = "0x600BEB9")]
[Address(RVA = "0x20182A0", Offset = "0x20170A0", VA = "0x1820182A0")]
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: 0x17001D92 RID: 7570
// (get) Token: 0x0600BEBA RID: 48826 RVA: 0x002B73B4 File Offset: 0x002B55B4
[Token(Token = "0x17001D92")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable UnsignedAttributes
{
[Token(Token = "0x600BEBA")]
[Address(RVA = "0x2018320", Offset = "0x2017120", VA = "0x182018320")]
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: 0x0600BEBB RID: 48827 RVA: 0x002B73F0 File Offset: 0x002B55F0
[Token(Token = "0x600BEBB")]
[Address(RVA = "0x2017200", Offset = "0x2016000", VA = "0x182017200")]
public byte[] GetSignature()
{
byte[] array = this.signature;
throw new NullReferenceException();
}
// Token: 0x0600BEBC RID: 48828 RVA: 0x002B740C File Offset: 0x002B560C
[Token(Token = "0x600BEBC")]
[Address(RVA = "0x2016C60", Offset = "0x2015A60", VA = "0x182016C60")]
public SignerInformationStore GetCounterSignatures()
{
IList list;
SignerInformation signerInformation;
do
{
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributes = this.UnsignedAttributes;
if (unsignedAttributes == 0)
{
goto IL_AB;
}
list = Platform.CreateArrayList();
DerObjectIdentifier counterSignature = CmsAttributes.CounterSignature;
IEnumerator enumerator = unsignedAttributes.GetAll(counterSignature).GetEnumerator();
if (enumerator != 0)
{
if (enumerator == 0 || enumerator == 0)
{
goto IL_E7;
}
CmsSignedHelper instance = CmsSignedHelper.Instance;
SignerInfo signerInfo;
Asn1Object asn1Object = signerInfo.digAlgorithm.ToAsn1Object();
CounterSignatureDigestCalculator counterSignatureDigestCalculator;
string text;
counterSignatureDigestCalculator.alg = text;
byte[] array;
counterSignatureDigestCalculator.data = array;
int num;
int num2;
signerInformation = new SignerInformation(signerInfo, num, num2, counterSignatureDigestCalculator);
num2 = 0;
num = 0;
if ((uint)(-1) != 0U)
{
}
if (signerInformation != 0)
{
goto IL_E1;
}
while ((ulong)((uint)(-1)) == (ulong)(-1L))
{
}
}
if ((uint)(-1) != 0U)
{
}
}
while (signerInformation != 0);
SignerInformationStore signerInformationStore = new SignerInformationStore(list);
IL_AB:
return new SignerInformationStore(Platform.CreateArrayList(0));
IL_E1:
throw new NullReferenceException();
IL_E7:
throw new NullReferenceException();
}
// Token: 0x0600BEBD RID: 48829 RVA: 0x002B750C File Offset: 0x002B570C
[Token(Token = "0x600BEBD")]
[Address(RVA = "0x20171B0", Offset = "0x2015FB0", VA = "0x1820171B0")]
public byte[] GetEncodedSignedAttributes()
{
Asn1Set asn1Set = this.signedAttributeSet;
if (asn1Set == 0)
{
}
return asn1Set.GetEncoded("DER");
}
// Token: 0x0600BEBE RID: 48830 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600BEBE")]
[Address(RVA = "0x2015CC0", Offset = "0x2014AC0", VA = "0x182015CC0")]
private bool DoVerify(AsymmetricKeyParameter key)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600BEBF RID: 48831 RVA: 0x002B7534 File Offset: 0x002B5734
[Token(Token = "0x600BEBF")]
[Address(RVA = "0x20175B0", Offset = "0x20163B0", VA = "0x1820175B0")]
private bool IsNull(Asn1Encodable o)
{
return (o != 0 && o != 0) || o == 0;
}
// Token: 0x0600BEC0 RID: 48832 RVA: 0x002B7554 File Offset: 0x002B5754
[Token(Token = "0x600BEC0")]
[Address(RVA = "0x2015BC0", Offset = "0x20149C0", VA = "0x182015BC0")]
private DigestInfo DerDecode(byte[] encoding)
{
/*
An exception occurred when decompiling this method (0600BEC0)
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 1660
*/;
}
// Token: 0x0600BEC1 RID: 48833 RVA: 0x002B75A4 File Offset: 0x002B57A4
[Token(Token = "0x600BEC1")]
[Address(RVA = "0x2017780", Offset = "0x2016580", VA = "0x182017780")]
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: 0x0600BEC2 RID: 48834 RVA: 0x002B7704 File Offset: 0x002B5904
[Token(Token = "0x600BEC2")]
[Address(RVA = "0x2017DE0", Offset = "0x2016BE0", VA = "0x182017DE0")]
public bool Verify(AsymmetricKeyParameter pubKey)
{
/*
An exception occurred when decompiling this method (0600BEC2)
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 1660
*/;
}
// Token: 0x0600BEC3 RID: 48835 RVA: 0x002B7740 File Offset: 0x002B5940
[Token(Token = "0x600BEC3")]
[Address(RVA = "0x2017D60", Offset = "0x2016B60", VA = "0x182017D60")]
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: 0x0600BEC4 RID: 48836 RVA: 0x002B7768 File Offset: 0x002B5968
[Token(Token = "0x600BEC4")]
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
public SignerInfo ToSignerInfo()
{
return this.info;
}
// Token: 0x0600BEC5 RID: 48837 RVA: 0x002B777C File Offset: 0x002B597C
[Token(Token = "0x600BEC5")]
[Address(RVA = "0x2017360", Offset = "0x2016160", VA = "0x182017360")]
private Asn1Object GetSingleValuedSignedAttribute(DerObjectIdentifier attrOID, string printableName)
{
/*
An exception occurred when decompiling this method (0600BEC5)
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 1660
*/;
}
// Token: 0x0600BEC6 RID: 48838 RVA: 0x002B77EC File Offset: 0x002B59EC
[Token(Token = "0x600BEC6")]
[Address(RVA = "0x2017280", Offset = "0x2016080", VA = "0x182017280")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Time GetSigningTime()
{
/*
An exception occurred when decompiling this method (0600BEC6)
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 1660
*/;
}
// Token: 0x0600BEC7 RID: 48839 RVA: 0x002B7824 File Offset: 0x002B5A24
[Token(Token = "0x600BEC7")]
[Address(RVA = "0x2017630", Offset = "0x2016430", VA = "0x182017630")]
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: 0x0600BEC8 RID: 48840 RVA: 0x002B78A8 File Offset: 0x002B5AA8
[Token(Token = "0x600BEC8")]
[Address(RVA = "0x2015690", Offset = "0x2014490", VA = "0x182015690")]
public static SignerInformation AddCounterSigners(SignerInformation signerInformation, SignerInformationStore counterSigners)
{
int num;
Asn1EncodableVector asn1EncodableVector;
Asn1EncodableVector asn1EncodableVector2;
do
{
num = 0;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributes = signerInformation.UnsignedAttributes;
if (unsignedAttributes == 0)
{
}
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_D5;
}
array = new Asn1Encodable[1];
if (list != 0)
{
}
array[0] = list;
asn1EncodableVector2.Add(array);
}
if (array != 0)
{
}
}
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;
asn1EncodableVector.Add(array2);
DerSet derSet2 = new DerSet(asn1EncodableVector);
throw new NullReferenceException();
IL_D5:
throw new NullReferenceException();
}
// Token: 0x04007941 RID: 31041
[Token(Token = "0x4007941")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x04007942 RID: 31042
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007942")]
private SignerID sid;
// Token: 0x04007943 RID: 31043
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007943")]
private SignerInfo info;
// Token: 0x04007944 RID: 31044
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007944")]
private AlgorithmIdentifier digestAlgorithm;
// Token: 0x04007945 RID: 31045
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007945")]
private AlgorithmIdentifier encryptionAlgorithm;
// Token: 0x04007946 RID: 31046
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007946")]
private readonly Asn1Set signedAttributeSet;
// Token: 0x04007947 RID: 31047
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007947")]
private readonly Asn1Set unsignedAttributeSet;
// Token: 0x04007948 RID: 31048
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007948")]
private CmsProcessable content;
// Token: 0x04007949 RID: 31049
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007949")]
private byte[] signature;
// Token: 0x0400794A RID: 31050
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x400794A")]
private DerObjectIdentifier contentType;
// Token: 0x0400794B RID: 31051
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x400794B")]
private IDigestCalculator digestCalculator;
// Token: 0x0400794C RID: 31052
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x400794C")]
private byte[] resultDigest;
// Token: 0x0400794D RID: 31053
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x400794D")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttributeTable;
// Token: 0x0400794E RID: 31054
[FieldOffset(Offset = "0x70")]
[Token(Token = "0x400794E")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributeTable;
// Token: 0x0400794F RID: 31055
[FieldOffset(Offset = "0x78")]
[Token(Token = "0x400794F")]
private readonly bool isCounterSignature;
}
}
@@ -0,0 +1,142 @@
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D6D RID: 7533
[Token(Token = "0x2001D6D")]
public class SignerInformationStore
{
// Token: 0x0600BECA RID: 48842 RVA: 0x002B79A8 File Offset: 0x002B5BA8
[Token(Token = "0x600BECA")]
[Address(RVA = "0x2015570", Offset = "0x2014370", VA = "0x182015570")]
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: 0x0600BECB RID: 48843 RVA: 0x002B79F0 File Offset: 0x002B5BF0
[Token(Token = "0x600BECB")]
[Address(RVA = "0x20152B0", Offset = "0x20140B0", VA = "0x1820152B0")]
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_6F;
}
IDictionary dictionary2 = this.table;
if (num != 0 && num == 0)
{
goto IL_5D;
}
IDictionary dictionary3 = this.table;
list = Platform.CreateArrayList(1);
num2 = 0;
}
if (list != 0)
{
}
}
while (num2 != 0);
IList list2;
this.all = list2;
return;
IL_5D:
throw new NullReferenceException();
IL_6F:
throw new NullReferenceException();
}
// Token: 0x0600BECC RID: 48844 RVA: 0x002B7A78 File Offset: 0x002B5C78
[Token(Token = "0x600BECC")]
[Address(RVA = "0x2015070", Offset = "0x2013E70", VA = "0x182015070")]
public SignerInformation GetFirstSigner(SignerID selector)
{
IDictionary dictionary;
do
{
dictionary = this.table;
}
while (dictionary == 0);
throw new NullReferenceException();
}
// Token: 0x17001D93 RID: 7571
// (get) Token: 0x0600BECD RID: 48845 RVA: 0x002B7A9C File Offset: 0x002B5C9C
[Token(Token = "0x17001D93")]
public int Count
{
[Token(Token = "0x600BECD")]
[Address(RVA = "0x2015640", Offset = "0x2014440", VA = "0x182015640")]
get
{
IList list = this.all;
throw new NullReferenceException();
}
}
// Token: 0x0600BECE RID: 48846 RVA: 0x002B7AB8 File Offset: 0x002B5CB8
[Token(Token = "0x600BECE")]
[Address(RVA = "0x2015160", Offset = "0x2013F60", VA = "0x182015160")]
public ICollection GetSigners()
{
/*
An exception occurred when decompiling this method (0600BECE)
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 1660
*/;
}
// Token: 0x0600BECF RID: 48847 RVA: 0x002B7AD0 File Offset: 0x002B5CD0
[Token(Token = "0x600BECF")]
[Address(RVA = "0x20151C0", Offset = "0x2013FC0", VA = "0x1820151C0")]
public ICollection GetSigners(SignerID selector)
{
IDictionary dictionary = this.table;
IList list = Platform.CreateArrayList();
throw new NullReferenceException();
}
// Token: 0x04007950 RID: 31056
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007950")]
private readonly IList all;
// Token: 0x04007951 RID: 31057
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007951")]
private readonly IDictionary table;
}
}
@@ -0,0 +1,33 @@
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001D6E RID: 7534
[Token(Token = "0x2001D6E")]
public class SimpleAttributeTableGenerator : CmsAttributeTableGenerator
{
// Token: 0x0600BED0 RID: 48848 RVA: 0x002B7AF4 File Offset: 0x002B5CF4
[Token(Token = "0x600BED0")]
[Address(RVA = "0x3FFB80", Offset = "0x3FE980", VA = "0x1803FFB80")]
public SimpleAttributeTableGenerator(AttributeTable attributes)
{
this.attributes = attributes;
}
// Token: 0x0600BED1 RID: 48849 RVA: 0x002B7B10 File Offset: 0x002B5D10
[Token(Token = "0x600BED1")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20", Slot = "5")]
public virtual AttributeTable GetAttributes(IDictionary parameters)
{
return this.attributes;
}
// Token: 0x04007952 RID: 31058
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007952")]
private readonly AttributeTable attributes;
}
}