This commit is contained in:
niko
2026-04-12 16:51:38 +02:00
parent 1b6f6d81d0
commit c12fbe3fc6
17828 changed files with 2994770 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: 0x02001E00 RID: 7680
[Token(Token = "0x2001E00")]
internal class BaseDigestCalculator : IDigestCalculator
{
// Token: 0x0600C0AD RID: 49325 RVA: 0x002B80B4 File Offset: 0x002B62B4
[Token(Token = "0x600C0AD")]
[Address(RVA = "0x493D90", Offset = "0x492D90", VA = "0x180493D90")]
internal BaseDigestCalculator(byte[] digest)
{
this.digest = digest;
}
// Token: 0x0600C0AE RID: 49326 RVA: 0x002B80D0 File Offset: 0x002B62D0
[Token(Token = "0x600C0AE")]
[Address(RVA = "0x213E0F0", Offset = "0x213D0F0", VA = "0x18213E0F0", Slot = "4")]
public byte[] GetDigest()
{
return Arrays.Clone(this.digest);
}
// Token: 0x040079FC RID: 31228
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40079FC")]
private readonly byte[] digest;
}
}
@@ -0,0 +1,34 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001E01 RID: 7681
[Token(Token = "0x2001E01")]
[Serializable]
public class CmsAttributeTableGenerationException : CmsException
{
// Token: 0x0600C0AF RID: 49327 RVA: 0x002B80E8 File Offset: 0x002B62E8
[Token(Token = "0x600C0AF")]
[Address(RVA = "0x2140300", Offset = "0x213F300", VA = "0x182140300")]
public CmsAttributeTableGenerationException()
{
}
// Token: 0x0600C0B0 RID: 49328 RVA: 0x002B80FC File Offset: 0x002B62FC
[Token(Token = "0x600C0B0")]
[Address(RVA = "0x21403E0", Offset = "0x213F3E0", VA = "0x1821403E0")]
public CmsAttributeTableGenerationException(string name)
: base(name)
{
}
// Token: 0x0600C0B1 RID: 49329 RVA: 0x002B8110 File Offset: 0x002B6310
[Token(Token = "0x600C0B1")]
[Address(RVA = "0x2140360", Offset = "0x213F360", VA = "0x182140360")]
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: 0x02001E03 RID: 7683
[Token(Token = "0x2001E03")]
public interface CmsAttributeTableGenerator
{
// Token: 0x0600C0B2 RID: 49330
[Token(Token = "0x600C0B2")]
[Address(Slot = "0")]
AttributeTable GetAttributes(IDictionary parameters);
}
}
@@ -0,0 +1,23 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001E02 RID: 7682
[Token(Token = "0x2001E02")]
public enum CmsAttributeTableParameter
{
// Token: 0x040079FE RID: 31230
[Token(Token = "0x40079FE")]
ContentType,
// Token: 0x040079FF RID: 31231
[Token(Token = "0x40079FF")]
Digest,
// Token: 0x04007A00 RID: 31232
[Token(Token = "0x4007A00")]
Signature,
// Token: 0x04007A01 RID: 31233
[Token(Token = "0x4007A01")]
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: 0x02001E04 RID: 7684
[Token(Token = "0x2001E04")]
internal class CmsAuthEnvelopedData
{
// Token: 0x0600C0B3 RID: 49331 RVA: 0x002B8128 File Offset: 0x002B6328
[Token(Token = "0x600C0B3")]
[Address(RVA = "0x2140450", Offset = "0x213F450", VA = "0x182140450")]
public CmsAuthEnvelopedData(byte[] authEnvData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(authEnvData);
}
// Token: 0x0600C0B4 RID: 49332 RVA: 0x002B813C File Offset: 0x002B633C
[Token(Token = "0x600C0B4")]
[Address(RVA = "0x2140480", Offset = "0x213F480", VA = "0x182140480")]
public CmsAuthEnvelopedData(Stream authEnvData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(authEnvData);
}
// Token: 0x0600C0B5 RID: 49333 RVA: 0x002B8150 File Offset: 0x002B6350
[Token(Token = "0x600C0B5")]
[Address(RVA = "0x21404B0", Offset = "0x213F4B0", VA = "0x1821404B0")]
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: 0x04007A02 RID: 31234
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A02")]
internal RecipientInformationStore recipientInfoStore;
// Token: 0x04007A03 RID: 31235
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007A03")]
internal ContentInfo contentInfo;
// Token: 0x04007A04 RID: 31236
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007A04")]
private OriginatorInfo originator;
// Token: 0x04007A05 RID: 31237
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007A05")]
private AlgorithmIdentifier authEncAlg;
// Token: 0x04007A06 RID: 31238
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007A06")]
private Asn1Set authAttrs;
// Token: 0x04007A07 RID: 31239
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007A07")]
private byte[] mac;
// Token: 0x04007A08 RID: 31240
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007A08")]
private Asn1Set unauthAttrs;
// Token: 0x02001E05 RID: 7685
[Token(Token = "0x2001E05")]
private class AuthEnvelopedSecureReadable : CmsSecureReadable
{
// Token: 0x0600C0B6 RID: 49334 RVA: 0x002B81F8 File Offset: 0x002B63F8
[Token(Token = "0x600C0B6")]
[Address(RVA = "0x493D90", Offset = "0x492D90", VA = "0x180493D90")]
internal AuthEnvelopedSecureReadable(CmsAuthEnvelopedData parent)
{
this.parent = parent;
}
// Token: 0x17001DE2 RID: 7650
// (get) Token: 0x0600C0B7 RID: 49335 RVA: 0x002B8214 File Offset: 0x002B6414
[Token(Token = "0x17001DE2")]
public AlgorithmIdentifier Algorithm
{
[Token(Token = "0x600C0B7")]
[Address(RVA = "0x7788D0", Offset = "0x7778D0", VA = "0x1807788D0", Slot = "4")]
get
{
return this.parent.authEncAlg;
}
}
// Token: 0x17001DE3 RID: 7651
// (get) Token: 0x0600C0B8 RID: 49336 RVA: 0x002B8234 File Offset: 0x002B6434
[Token(Token = "0x17001DE3")]
public object CryptoObject
{
[Token(Token = "0x600C0B8")]
[Address(RVA = "0x4242C0", Offset = "0x4232C0", VA = "0x1804242C0", Slot = "5")]
get
{
}
}
// Token: 0x0600C0B9 RID: 49337 RVA: 0x002B8244 File Offset: 0x002B6444
[Token(Token = "0x600C0B9")]
[Address(RVA = "0x213E090", Offset = "0x213D090", VA = "0x18213E090", Slot = "6")]
public CmsReadable GetReadable(KeyParameter key)
{
/*
An exception occurred when decompiling this method (0600C0B9)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsReadable BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsAuthEnvelopedData/AuthEnvelopedSecureReadable::GetReadable(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.KeyParameter)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:CmsException(var_0_0A, newobj:CmsException(CmsException::.ctor, ldstr:string("AuthEnveloped data decryption not yet implemented")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x04007A09 RID: 31241
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A09")]
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: 0x02001E06 RID: 7686
[Token(Token = "0x2001E06")]
internal class CmsAuthEnvelopedGenerator
{
// Token: 0x0600C0BA RID: 49338 RVA: 0x002B825C File Offset: 0x002B645C
[Token(Token = "0x600C0BA")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public CmsAuthEnvelopedGenerator()
{
}
// Token: 0x04007A0A RID: 31242
[Token(Token = "0x4007A0A")]
public static readonly string Aes128Ccm = NistObjectIdentifiers.IdAes128Ccm.identifier;
// Token: 0x04007A0B RID: 31243
[Token(Token = "0x4007A0B")]
public static readonly string Aes192Ccm = NistObjectIdentifiers.IdAes192Ccm.identifier;
// Token: 0x04007A0C RID: 31244
[Token(Token = "0x4007A0C")]
public static readonly string Aes256Ccm = NistObjectIdentifiers.IdAes256Ccm.identifier;
// Token: 0x04007A0D RID: 31245
[Token(Token = "0x4007A0D")]
public static readonly string Aes128Gcm = NistObjectIdentifiers.IdAes128Gcm.identifier;
// Token: 0x04007A0E RID: 31246
[Token(Token = "0x4007A0E")]
public static readonly string Aes192Gcm = NistObjectIdentifiers.IdAes192Gcm.identifier;
// Token: 0x04007A0F RID: 31247
[Token(Token = "0x4007A0F")]
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: 0x02001E07 RID: 7687
[Token(Token = "0x2001E07")]
public class CmsAuthenticatedData
{
// Token: 0x0600C0BC RID: 49340 RVA: 0x002B82E0 File Offset: 0x002B64E0
[Token(Token = "0x600C0BC")]
[Address(RVA = "0x21427D0", Offset = "0x21417D0", VA = "0x1821427D0")]
public CmsAuthenticatedData(byte[] authData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(authData);
}
// Token: 0x0600C0BD RID: 49341 RVA: 0x002B82F4 File Offset: 0x002B64F4
[Token(Token = "0x600C0BD")]
[Address(RVA = "0x2142970", Offset = "0x2141970", VA = "0x182142970")]
public CmsAuthenticatedData(Stream authData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(authData);
}
// Token: 0x0600C0BE RID: 49342 RVA: 0x002B8308 File Offset: 0x002B6508
[Token(Token = "0x600C0BE")]
[Address(RVA = "0x2142800", Offset = "0x2141800", VA = "0x182142800")]
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: 0x0600C0BF RID: 49343 RVA: 0x002B83C8 File Offset: 0x002B65C8
[Token(Token = "0x600C0BF")]
[Address(RVA = "0x2142700", Offset = "0x2141700", VA = "0x182142700")]
public byte[] GetMac()
{
return Arrays.Clone(this.mac);
}
// Token: 0x17001DE4 RID: 7652
// (get) Token: 0x0600C0C0 RID: 49344 RVA: 0x002B83E0 File Offset: 0x002B65E0
[Token(Token = "0x17001DE4")]
public AlgorithmIdentifier MacAlgorithmID
{
[Token(Token = "0x600C0C0")]
[Address(RVA = "0x4157C0", Offset = "0x4147C0", VA = "0x1804157C0")]
get
{
return this.macAlg;
}
}
// Token: 0x17001DE5 RID: 7653
// (get) Token: 0x0600C0C1 RID: 49345 RVA: 0x002B83F4 File Offset: 0x002B65F4
[Token(Token = "0x17001DE5")]
public string MacAlgOid
{
[Token(Token = "0x600C0C1")]
[Address(RVA = "0x21429A0", Offset = "0x21419A0", VA = "0x1821429A0")]
get
{
Asn1Object asn1Object = this.macAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x0600C0C2 RID: 49346 RVA: 0x002B8414 File Offset: 0x002B6614
[Token(Token = "0x600C0C2")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530")]
public RecipientInformationStore GetRecipientInfos()
{
return this.recipientInfoStore;
}
// Token: 0x17001DE6 RID: 7654
// (get) Token: 0x0600C0C3 RID: 49347 RVA: 0x002B8428 File Offset: 0x002B6628
[Token(Token = "0x17001DE6")]
public ContentInfo ContentInfo
{
[Token(Token = "0x600C0C3")]
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0")]
get
{
return this.contentInfo;
}
}
// Token: 0x0600C0C4 RID: 49348 RVA: 0x002B843C File Offset: 0x002B663C
[Token(Token = "0x600C0C4")]
[Address(RVA = "0x2142670", Offset = "0x2141670", VA = "0x182142670")]
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: 0x0600C0C5 RID: 49349 RVA: 0x002B845C File Offset: 0x002B665C
[Token(Token = "0x600C0C5")]
[Address(RVA = "0x2142760", Offset = "0x2141760", VA = "0x182142760")]
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: 0x0600C0C6 RID: 49350 RVA: 0x002B847C File Offset: 0x002B667C
[Token(Token = "0x600C0C6")]
[Address(RVA = "0x21426E0", Offset = "0x21416E0", VA = "0x1821426E0")]
public byte[] GetEncoded()
{
return this.contentInfo.GetEncoded();
}
// Token: 0x04007A10 RID: 31248
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A10")]
internal RecipientInformationStore recipientInfoStore;
// Token: 0x04007A11 RID: 31249
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007A11")]
internal ContentInfo contentInfo;
// Token: 0x04007A12 RID: 31250
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007A12")]
private AlgorithmIdentifier macAlg;
// Token: 0x04007A13 RID: 31251
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007A13")]
private Asn1Set authAttrs;
// Token: 0x04007A14 RID: 31252
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007A14")]
private Asn1Set unauthAttrs;
// Token: 0x04007A15 RID: 31253
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007A15")]
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: 0x02001E08 RID: 7688
[Token(Token = "0x2001E08")]
public class CmsAuthenticatedDataGenerator : CmsAuthenticatedGenerator
{
// Token: 0x0600C0C7 RID: 49351 RVA: 0x002B849C File Offset: 0x002B669C
[Token(Token = "0x600C0C7")]
[Address(RVA = "0x2140F20", Offset = "0x213FF20", VA = "0x182140F20")]
public CmsAuthenticatedDataGenerator()
{
}
// Token: 0x0600C0C8 RID: 49352 RVA: 0x002B84B0 File Offset: 0x002B66B0
[Token(Token = "0x600C0C8")]
[Address(RVA = "0x2140F80", Offset = "0x213FF80", VA = "0x182140F80")]
public CmsAuthenticatedDataGenerator(SecureRandom rand)
: base(rand)
{
}
// Token: 0x0600C0C9 RID: 49353 RVA: 0x002B84C4 File Offset: 0x002B66C4
[Token(Token = "0x600C0C9")]
[Address(RVA = "0x2140880", Offset = "0x213F880", VA = "0x182140880")]
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: 0x0600C0CA RID: 49354 RVA: 0x002B85DC File Offset: 0x002B67DC
[Token(Token = "0x600C0CA")]
[Address(RVA = "0x2140750", Offset = "0x213F750", VA = "0x182140750")]
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: 0x02001E09 RID: 7689
[Token(Token = "0x2001E09")]
public class CmsAuthenticatedDataParser : CmsContentInfoParser
{
// Token: 0x0600C0CB RID: 49355 RVA: 0x002B861C File Offset: 0x002B681C
[Token(Token = "0x600C0CB")]
[Address(RVA = "0x2141A00", Offset = "0x2140A00", VA = "0x182141A00")]
public CmsAuthenticatedDataParser(byte[] envelopedData)
{
int num;
MemoryStream memoryStream = new MemoryStream(envelopedData, num != 0);
num = 0;
}
// Token: 0x0600C0CC RID: 49356 RVA: 0x002B8634 File Offset: 0x002B6834
[Token(Token = "0x600C0CC")]
[Address(RVA = "0x21417C0", Offset = "0x21407C0", VA = "0x1821417C0")]
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: 0x17001DE7 RID: 7655
// (get) Token: 0x0600C0CD RID: 49357 RVA: 0x002B86E4 File Offset: 0x002B68E4
[Token(Token = "0x17001DE7")]
public AlgorithmIdentifier MacAlgorithmID
{
[Token(Token = "0x600C0CD")]
[Address(RVA = "0x4157E0", Offset = "0x4147E0", VA = "0x1804157E0")]
get
{
return this.macAlg;
}
}
// Token: 0x17001DE8 RID: 7656
// (get) Token: 0x0600C0CE RID: 49358 RVA: 0x002B86F8 File Offset: 0x002B68F8
[Token(Token = "0x17001DE8")]
public string MacAlgOid
{
[Token(Token = "0x600C0CE")]
[Address(RVA = "0x2141A70", Offset = "0x2140A70", VA = "0x182141A70")]
get
{
Asn1Object asn1Object = this.macAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001DE9 RID: 7657
// (get) Token: 0x0600C0CF RID: 49359 RVA: 0x002B8718 File Offset: 0x002B6918
[Token(Token = "0x17001DE9")]
public Asn1Object MacAlgParams
{
[Token(Token = "0x600C0CF")]
[Address(RVA = "0x2141AB0", Offset = "0x2140AB0", VA = "0x182141AB0")]
get
{
DerObjectIdentifier objectID = this.macAlg.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600C0D0 RID: 49360 RVA: 0x002B8744 File Offset: 0x002B6944
[Token(Token = "0x600C0D0")]
[Address(RVA = "0x4157C0", Offset = "0x4147C0", VA = "0x1804157C0")]
public RecipientInformationStore GetRecipientInfos()
{
return this._recipientInfoStore;
}
// Token: 0x0600C0D1 RID: 49361 RVA: 0x002B8758 File Offset: 0x002B6958
[Token(Token = "0x600C0D1")]
[Address(RVA = "0x2141450", Offset = "0x2140450", VA = "0x182141450")]
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: 0x0600C0D2 RID: 49362 RVA: 0x002B879C File Offset: 0x002B699C
[Token(Token = "0x600C0D2")]
[Address(RVA = "0x2141190", Offset = "0x2140190", VA = "0x182141190")]
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: 0x0600C0D3 RID: 49363 RVA: 0x002B884C File Offset: 0x002B6A4C
[Token(Token = "0x600C0D3")]
[Address(RVA = "0x2141500", Offset = "0x2140500", VA = "0x182141500")]
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: 0x04007A16 RID: 31254
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007A16")]
internal RecipientInformationStore _recipientInfoStore;
// Token: 0x04007A17 RID: 31255
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007A17")]
internal AuthenticatedDataParser authData;
// Token: 0x04007A18 RID: 31256
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007A18")]
private AlgorithmIdentifier macAlg;
// Token: 0x04007A19 RID: 31257
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007A19")]
private byte[] mac;
// Token: 0x04007A1A RID: 31258
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007A1A")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable authAttrs;
// Token: 0x04007A1B RID: 31259
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007A1B")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unauthAttrs;
// Token: 0x04007A1C RID: 31260
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x4007A1C")]
private bool authAttrNotRead;
// Token: 0x04007A1D RID: 31261
[FieldOffset(Offset = "0x51")]
[Token(Token = "0x4007A1D")]
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: 0x02001E0A RID: 7690
[Token(Token = "0x2001E0A")]
public class CmsAuthenticatedDataStreamGenerator : CmsAuthenticatedGenerator
{
// Token: 0x0600C0D4 RID: 49364 RVA: 0x002B88FC File Offset: 0x002B6AFC
[Token(Token = "0x600C0D4")]
[Address(RVA = "0x2140F20", Offset = "0x213FF20", VA = "0x182140F20")]
public CmsAuthenticatedDataStreamGenerator()
{
}
// Token: 0x0600C0D5 RID: 49365 RVA: 0x002B8910 File Offset: 0x002B6B10
[Token(Token = "0x600C0D5")]
[Address(RVA = "0x2140F80", Offset = "0x213FF80", VA = "0x182140F80")]
public CmsAuthenticatedDataStreamGenerator(SecureRandom rand)
: base(rand)
{
}
// Token: 0x0600C0D6 RID: 49366 RVA: 0x002B8924 File Offset: 0x002B6B24
[Token(Token = "0x600C0D6")]
[Address(RVA = "0x5AB430", Offset = "0x5AA430", VA = "0x1805AB430")]
public void SetBufferSize(int bufferSize)
{
this._bufferSize = bufferSize;
}
// Token: 0x0600C0D7 RID: 49367 RVA: 0x002B8938 File Offset: 0x002B6B38
[Token(Token = "0x600C0D7")]
[Address(RVA = "0x90C8E0", Offset = "0x90B8E0", VA = "0x18090C8E0")]
public void SetBerEncodeRecipients(bool berEncodeRecipientSet)
{
this._berEncodeRecipientSet = berEncodeRecipientSet;
}
// Token: 0x0600C0D8 RID: 49368 RVA: 0x002B894C File Offset: 0x002B6B4C
[Token(Token = "0x600C0D8")]
[Address(RVA = "0x2141B00", Offset = "0x2140B00", VA = "0x182141B00")]
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: 0x0600C0D9 RID: 49369 RVA: 0x002B8A00 File Offset: 0x002B6C00
[Token(Token = "0x600C0D9")]
[Address(RVA = "0x2141E90", Offset = "0x2140E90", VA = "0x182141E90")]
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: 0x0600C0DA RID: 49370 RVA: 0x002B8B00 File Offset: 0x002B6D00
[Token(Token = "0x600C0DA")]
[Address(RVA = "0x2142580", Offset = "0x2141580", VA = "0x182142580")]
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: 0x0600C0DB RID: 49371 RVA: 0x002B8B40 File Offset: 0x002B6D40
[Token(Token = "0x600C0DB")]
[Address(RVA = "0x2142490", Offset = "0x2141490", VA = "0x182142490")]
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: 0x04007A1E RID: 31262
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007A1E")]
private int _bufferSize;
// Token: 0x04007A1F RID: 31263
[FieldOffset(Offset = "0x2C")]
[Token(Token = "0x4007A1F")]
private bool _berEncodeRecipientSet;
// Token: 0x02001E0B RID: 7691
[Token(Token = "0x2001E0B")]
private class CmsAuthenticatedDataOutputStream : BaseOutputStream
{
// Token: 0x0600C0DC RID: 49372 RVA: 0x002B8B78 File Offset: 0x002B6D78
[Token(Token = "0x600C0DC")]
[Address(RVA = "0x2141130", Offset = "0x2140130", VA = "0x182141130")]
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: 0x0600C0DD RID: 49373 RVA: 0x002B8BB0 File Offset: 0x002B6DB0
[Token(Token = "0x600C0DD")]
[Address(RVA = "0x21410D0", Offset = "0x21400D0", VA = "0x1821410D0", Slot = "30")]
public override void WriteByte(byte b)
{
bool canRead = this.macStream.CanRead;
}
// Token: 0x0600C0DE RID: 49374 RVA: 0x002B8BD0 File Offset: 0x002B6DD0
[Token(Token = "0x600C0DE")]
[Address(RVA = "0x2141100", Offset = "0x2140100", VA = "0x182141100", Slot = "29")]
public override void Write(byte[] bytes, int off, int len)
{
bool canRead = this.macStream.CanRead;
}
// Token: 0x0600C0DF RID: 49375 RVA: 0x002B8BF0 File Offset: 0x002B6DF0
[Token(Token = "0x600C0DF")]
[Address(RVA = "0x2140F90", Offset = "0x213FF90", VA = "0x182140F90", 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: 0x04007A20 RID: 31264
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007A20")]
private readonly Stream macStream;
// Token: 0x04007A21 RID: 31265
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007A21")]
private readonly IMac mac;
// Token: 0x04007A22 RID: 31266
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007A22")]
private readonly BerSequenceGenerator cGen;
// Token: 0x04007A23 RID: 31267
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007A23")]
private readonly BerSequenceGenerator authGen;
// Token: 0x04007A24 RID: 31268
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x4007A24")]
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: 0x02001E0C RID: 7692
[Token(Token = "0x2001E0C")]
public class CmsAuthenticatedGenerator : CmsEnvelopedGenerator
{
// Token: 0x0600C0E0 RID: 49376 RVA: 0x002B8C5C File Offset: 0x002B6E5C
[Token(Token = "0x600C0E0")]
[Address(RVA = "0x2140F20", Offset = "0x213FF20", VA = "0x182140F20")]
public CmsAuthenticatedGenerator()
{
}
// Token: 0x0600C0E1 RID: 49377 RVA: 0x002B8C70 File Offset: 0x002B6E70
[Token(Token = "0x600C0E1")]
[Address(RVA = "0x21429E0", Offset = "0x21419E0", VA = "0x1821429E0")]
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: 0x02001E0D RID: 7693
[Token(Token = "0x2001E0D")]
public class CmsCompressedData
{
// Token: 0x0600C0E2 RID: 49378 RVA: 0x002B8C9C File Offset: 0x002B6E9C
[Token(Token = "0x600C0E2")]
[Address(RVA = "0x21438E0", Offset = "0x21428E0", VA = "0x1821438E0")]
public CmsCompressedData(byte[] compressedData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(compressedData);
base..ctor();
this.contentInfo = contentInfo;
}
// Token: 0x0600C0E3 RID: 49379 RVA: 0x002B8CC0 File Offset: 0x002B6EC0
[Token(Token = "0x600C0E3")]
[Address(RVA = "0x2143920", Offset = "0x2142920", VA = "0x182143920")]
public CmsCompressedData(Stream compressedDataStream)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(compressedDataStream);
base..ctor();
this.contentInfo = contentInfo;
}
// Token: 0x0600C0E4 RID: 49380 RVA: 0x002B8CE4 File Offset: 0x002B6EE4
[Token(Token = "0x600C0E4")]
[Address(RVA = "0x493D90", Offset = "0x492D90", VA = "0x180493D90")]
public CmsCompressedData(ContentInfo contentInfo)
{
this.contentInfo = contentInfo;
}
// Token: 0x0600C0E5 RID: 49381 RVA: 0x002B8D00 File Offset: 0x002B6F00
[Token(Token = "0x600C0E5")]
[Address(RVA = "0x2143510", Offset = "0x2142510", VA = "0x182143510")]
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: 0x0600C0E6 RID: 49382 RVA: 0x002B8D6C File Offset: 0x002B6F6C
[Token(Token = "0x600C0E6")]
[Address(RVA = "0x2143710", Offset = "0x2142710", VA = "0x182143710")]
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: 0x17001DEA RID: 7658
// (get) Token: 0x0600C0E7 RID: 49383 RVA: 0x002B8DB4 File Offset: 0x002B6FB4
[Token(Token = "0x17001DEA")]
public ContentInfo ContentInfo
{
[Token(Token = "0x600C0E7")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530")]
get
{
return this.contentInfo;
}
}
// Token: 0x0600C0E8 RID: 49384 RVA: 0x002B8DC8 File Offset: 0x002B6FC8
[Token(Token = "0x600C0E8")]
[Address(RVA = "0x423720", Offset = "0x422720", VA = "0x180423720")]
public byte[] GetEncoded()
{
return this.contentInfo.GetEncoded();
}
// Token: 0x04007A25 RID: 31269
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A25")]
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: 0x02001E0E RID: 7694
[Token(Token = "0x2001E0E")]
public class CmsCompressedDataGenerator
{
// Token: 0x0600C0E9 RID: 49385 RVA: 0x002B8DE8 File Offset: 0x002B6FE8
[Token(Token = "0x600C0E9")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public CmsCompressedDataGenerator()
{
}
// Token: 0x0600C0EA RID: 49386 RVA: 0x002B8DFC File Offset: 0x002B6FFC
[Token(Token = "0x600C0EA")]
[Address(RVA = "0x2142D10", Offset = "0x2141D10", VA = "0x182142D10")]
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: 0x04007A26 RID: 31270
[Token(Token = "0x4007A26")]
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: 0x02001E0F RID: 7695
[Token(Token = "0x2001E0F")]
public class CmsCompressedDataParser : CmsContentInfoParser
{
// Token: 0x0600C0EB RID: 49387 RVA: 0x002B8E60 File Offset: 0x002B7060
[Token(Token = "0x600C0EB")]
[Address(RVA = "0x2143160", Offset = "0x2142160", VA = "0x182143160")]
public CmsCompressedDataParser(byte[] compressedData)
{
int num;
MemoryStream memoryStream = new MemoryStream(compressedData, num != 0);
num = 0;
base..ctor(memoryStream);
}
// Token: 0x0600C0EC RID: 49388 RVA: 0x002B8E80 File Offset: 0x002B7080
[Token(Token = "0x600C0EC")]
[Address(RVA = "0x21431D0", Offset = "0x21421D0", VA = "0x1821431D0")]
public CmsCompressedDataParser(Stream compressedData)
: base(compressedData)
{
}
// Token: 0x0600C0ED RID: 49389 RVA: 0x002B8E94 File Offset: 0x002B7094
[Token(Token = "0x600C0ED")]
[Address(RVA = "0x2142F70", Offset = "0x2141F70", VA = "0x182142F70")]
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: 0x02001E10 RID: 7696
[Token(Token = "0x2001E10")]
public class CmsCompressedDataStreamGenerator
{
// Token: 0x0600C0EE RID: 49390 RVA: 0x002B8EF8 File Offset: 0x002B70F8
[Token(Token = "0x600C0EE")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public CmsCompressedDataStreamGenerator()
{
}
// Token: 0x0600C0EF RID: 49391 RVA: 0x002B8F0C File Offset: 0x002B710C
[Token(Token = "0x600C0EF")]
[Address(RVA = "0x470D10", Offset = "0x46FD10", VA = "0x180470D10")]
public void SetBufferSize(int bufferSize)
{
this._bufferSize = bufferSize;
}
// Token: 0x0600C0F0 RID: 49392 RVA: 0x002B8F20 File Offset: 0x002B7120
[Token(Token = "0x600C0F0")]
[Address(RVA = "0x21431E0", Offset = "0x21421E0", VA = "0x1821431E0")]
public Stream Open(Stream outStream, string compressionOID)
{
string identifier = CmsObjectIdentifiers.Data.identifier;
return this.Open(outStream, identifier, compressionOID);
}
// Token: 0x0600C0F1 RID: 49393 RVA: 0x002B8F48 File Offset: 0x002B7148
[Token(Token = "0x600C0F1")]
[Address(RVA = "0x2143280", Offset = "0x2142280", VA = "0x182143280")]
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: 0x04007A27 RID: 31271
[Token(Token = "0x4007A27")]
public const string ZLib = "1.2.840.113549.1.9.16.3.8";
// Token: 0x04007A28 RID: 31272
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A28")]
private int _bufferSize;
// Token: 0x02001E11 RID: 7697
[Token(Token = "0x2001E11")]
private class CmsCompressedOutputStream : BaseOutputStream
{
// Token: 0x0600C0F2 RID: 49394 RVA: 0x002B8FD4 File Offset: 0x002B71D4
[Token(Token = "0x600C0F2")]
[Address(RVA = "0x2143A20", Offset = "0x2142A20", VA = "0x182143A20")]
internal CmsCompressedOutputStream(ZOutputStream outStream, BerSequenceGenerator sGen, BerSequenceGenerator cGen, BerSequenceGenerator eiGen)
{
this._out = outStream;
this._cGen = cGen;
this._eiGen = 0;
this._sGen = sGen;
}
// Token: 0x0600C0F3 RID: 49395 RVA: 0x002B9004 File Offset: 0x002B7204
[Token(Token = "0x600C0F3")]
[Address(RVA = "0x21410D0", Offset = "0x21400D0", VA = "0x1821410D0", Slot = "30")]
public override void WriteByte(byte b)
{
((IDisposable)this._out).Dispose();
}
// Token: 0x0600C0F4 RID: 49396 RVA: 0x002B9024 File Offset: 0x002B7224
[Token(Token = "0x600C0F4")]
[Address(RVA = "0x2141100", Offset = "0x2140100", VA = "0x182141100", Slot = "29")]
public override void Write(byte[] bytes, int off, int len)
{
int num = this._out.Read(bytes, off, len);
}
// Token: 0x0600C0F5 RID: 49397 RVA: 0x002B9048 File Offset: 0x002B7248
[Token(Token = "0x600C0F5")]
[Address(RVA = "0x2143960", Offset = "0x2142960", VA = "0x182143960", 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: 0x04007A29 RID: 31273
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007A29")]
private ZOutputStream _out;
// Token: 0x04007A2A RID: 31274
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007A2A")]
private BerSequenceGenerator _sGen;
// Token: 0x04007A2B RID: 31275
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007A2B")]
private BerSequenceGenerator _cGen;
// Token: 0x04007A2C RID: 31276
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007A2C")]
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: 0x02001E12 RID: 7698
[Token(Token = "0x2001E12")]
public class CmsContentInfoParser
{
// Token: 0x0600C0F6 RID: 49398 RVA: 0x002B9090 File Offset: 0x002B7290
[Token(Token = "0x600C0F6")]
[Address(RVA = "0x2143AE0", Offset = "0x2142AE0", VA = "0x182143AE0")]
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: 0x0600C0F7 RID: 49399 RVA: 0x002B90DC File Offset: 0x002B72DC
[Token(Token = "0x600C0F7")]
[Address(RVA = "0x2143A80", Offset = "0x2142A80", VA = "0x182143A80")]
public void Close()
{
Platform.Dispose(this.data);
}
// Token: 0x04007A2D RID: 31277
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A2D")]
protected ContentInfoParser contentInfo;
// Token: 0x04007A2E RID: 31278
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007A2E")]
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: 0x02001E13 RID: 7699
[Token(Token = "0x2001E13")]
public class CmsEnvelopedData
{
// Token: 0x0600C0F8 RID: 49400 RVA: 0x002B90F4 File Offset: 0x002B72F4
[Token(Token = "0x600C0F8")]
[Address(RVA = "0x2145DA0", Offset = "0x2144DA0", VA = "0x182145DA0")]
public CmsEnvelopedData(byte[] envelopedData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(envelopedData);
}
// Token: 0x0600C0F9 RID: 49401 RVA: 0x002B9108 File Offset: 0x002B7308
[Token(Token = "0x600C0F9")]
[Address(RVA = "0x2145C30", Offset = "0x2144C30", VA = "0x182145C30")]
public CmsEnvelopedData(Stream envelopedData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(envelopedData);
}
// Token: 0x0600C0FA RID: 49402 RVA: 0x002B911C File Offset: 0x002B731C
[Token(Token = "0x600C0FA")]
[Address(RVA = "0x2145C60", Offset = "0x2144C60", VA = "0x182145C60")]
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: 0x17001DEB RID: 7659
// (get) Token: 0x0600C0FB RID: 49403 RVA: 0x002B91B8 File Offset: 0x002B73B8
[Token(Token = "0x17001DEB")]
public AlgorithmIdentifier EncryptionAlgorithmID
{
[Token(Token = "0x600C0FB")]
[Address(RVA = "0x4157C0", Offset = "0x4147C0", VA = "0x1804157C0")]
get
{
return this.encAlg;
}
}
// Token: 0x17001DEC RID: 7660
// (get) Token: 0x0600C0FC RID: 49404 RVA: 0x002B91CC File Offset: 0x002B73CC
[Token(Token = "0x17001DEC")]
public string EncryptionAlgOid
{
[Token(Token = "0x600C0FC")]
[Address(RVA = "0x21429A0", Offset = "0x21419A0", VA = "0x1821429A0")]
get
{
Asn1Object asn1Object = this.encAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x0600C0FD RID: 49405 RVA: 0x002B91EC File Offset: 0x002B73EC
[Token(Token = "0x600C0FD")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530")]
public RecipientInformationStore GetRecipientInfos()
{
return this.recipientInfoStore;
}
// Token: 0x17001DED RID: 7661
// (get) Token: 0x0600C0FE RID: 49406 RVA: 0x002B9200 File Offset: 0x002B7400
[Token(Token = "0x17001DED")]
public ContentInfo ContentInfo
{
[Token(Token = "0x600C0FE")]
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0")]
get
{
return this.contentInfo;
}
}
// Token: 0x0600C0FF RID: 49407 RVA: 0x002B9214 File Offset: 0x002B7414
[Token(Token = "0x600C0FF")]
[Address(RVA = "0x2145BC0", Offset = "0x2144BC0", VA = "0x182145BC0")]
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: 0x0600C100 RID: 49408 RVA: 0x002B9234 File Offset: 0x002B7434
[Token(Token = "0x600C100")]
[Address(RVA = "0x21426E0", Offset = "0x21416E0", VA = "0x1821426E0")]
public byte[] GetEncoded()
{
return this.contentInfo.GetEncoded();
}
// Token: 0x04007A2F RID: 31279
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A2F")]
internal RecipientInformationStore recipientInfoStore;
// Token: 0x04007A30 RID: 31280
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007A30")]
internal ContentInfo contentInfo;
// Token: 0x04007A31 RID: 31281
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007A31")]
private AlgorithmIdentifier encAlg;
// Token: 0x04007A32 RID: 31282
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007A32")]
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: 0x02001E14 RID: 7700
[Token(Token = "0x2001E14")]
public class CmsEnvelopedDataGenerator : CmsEnvelopedGenerator
{
// Token: 0x0600C101 RID: 49409 RVA: 0x002B9254 File Offset: 0x002B7454
[Token(Token = "0x600C101")]
[Address(RVA = "0x21445F0", Offset = "0x21435F0", VA = "0x1821445F0")]
public CmsEnvelopedDataGenerator()
{
}
// Token: 0x0600C102 RID: 49410 RVA: 0x002B9268 File Offset: 0x002B7468
[Token(Token = "0x600C102")]
[Address(RVA = "0x2144650", Offset = "0x2143650", VA = "0x182144650")]
public CmsEnvelopedDataGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this.recipientInfoGenerators = list;
base..ctor();
this.rand = rand;
}
// Token: 0x0600C103 RID: 49411 RVA: 0x002B9294 File Offset: 0x002B7494
[Token(Token = "0x600C103")]
[Address(RVA = "0x2143EE0", Offset = "0x2142EE0", VA = "0x182143EE0")]
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: 0x0600C104 RID: 49412 RVA: 0x002B93C4 File Offset: 0x002B75C4
[Token(Token = "0x600C104")]
[Address(RVA = "0x2143C80", Offset = "0x2142C80", VA = "0x182143C80")]
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: 0x0600C105 RID: 49413 RVA: 0x002B9404 File Offset: 0x002B7604
[Token(Token = "0x600C105")]
[Address(RVA = "0x2143DB0", Offset = "0x2142DB0", VA = "0x182143DB0")]
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: 0x02001E15 RID: 7701
[Token(Token = "0x2001E15")]
public class CmsEnvelopedDataParser : CmsContentInfoParser
{
// Token: 0x0600C106 RID: 49414 RVA: 0x002B943C File Offset: 0x002B763C
[Token(Token = "0x600C106")]
[Address(RVA = "0x2144BE0", Offset = "0x2143BE0", VA = "0x182144BE0")]
public CmsEnvelopedDataParser(byte[] envelopedData)
{
int num;
MemoryStream memoryStream = new MemoryStream(envelopedData, num != 0);
num = 0;
}
// Token: 0x0600C107 RID: 49415 RVA: 0x002B9454 File Offset: 0x002B7654
[Token(Token = "0x600C107")]
[Address(RVA = "0x2144C50", Offset = "0x2143C50", VA = "0x182144C50")]
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: 0x17001DEE RID: 7662
// (get) Token: 0x0600C108 RID: 49416 RVA: 0x002B9500 File Offset: 0x002B7700
[Token(Token = "0x17001DEE")]
public AlgorithmIdentifier EncryptionAlgorithmID
{
[Token(Token = "0x600C108")]
[Address(RVA = "0x4157E0", Offset = "0x4147E0", VA = "0x1804157E0")]
get
{
return this._encAlg;
}
}
// Token: 0x17001DEF RID: 7663
// (get) Token: 0x0600C109 RID: 49417 RVA: 0x002B9514 File Offset: 0x002B7714
[Token(Token = "0x17001DEF")]
public string EncryptionAlgOid
{
[Token(Token = "0x600C109")]
[Address(RVA = "0x2141A70", Offset = "0x2140A70", VA = "0x182141A70")]
get
{
Asn1Object asn1Object = this._encAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001DF0 RID: 7664
// (get) Token: 0x0600C10A RID: 49418 RVA: 0x002B9534 File Offset: 0x002B7734
[Token(Token = "0x17001DF0")]
public Asn1Object EncryptionAlgParams
{
[Token(Token = "0x600C10A")]
[Address(RVA = "0x2141AB0", Offset = "0x2140AB0", VA = "0x182141AB0")]
get
{
DerObjectIdentifier objectID = this._encAlg.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600C10B RID: 49419 RVA: 0x002B9560 File Offset: 0x002B7760
[Token(Token = "0x600C10B")]
[Address(RVA = "0x4157C0", Offset = "0x4147C0", VA = "0x1804157C0")]
public RecipientInformationStore GetRecipientInfos()
{
return this.recipientInfoStore;
}
// Token: 0x0600C10C RID: 49420 RVA: 0x002B9574 File Offset: 0x002B7774
[Token(Token = "0x600C10C")]
[Address(RVA = "0x2144920", Offset = "0x2143920", VA = "0x182144920")]
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: 0x04007A33 RID: 31283
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007A33")]
internal RecipientInformationStore recipientInfoStore;
// Token: 0x04007A34 RID: 31284
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007A34")]
internal EnvelopedDataParser envelopedData;
// Token: 0x04007A35 RID: 31285
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007A35")]
private AlgorithmIdentifier _encAlg;
// Token: 0x04007A36 RID: 31286
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007A36")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable _unprotectedAttributes;
// Token: 0x04007A37 RID: 31287
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007A37")]
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: 0x02001E16 RID: 7702
[Token(Token = "0x2001E16")]
public class CmsEnvelopedDataStreamGenerator : CmsEnvelopedGenerator
{
// Token: 0x0600C10D RID: 49421 RVA: 0x002B9624 File Offset: 0x002B7824
[Token(Token = "0x600C10D")]
[Address(RVA = "0x2145A40", Offset = "0x2144A40", VA = "0x182145A40")]
public CmsEnvelopedDataStreamGenerator()
{
}
// Token: 0x0600C10E RID: 49422 RVA: 0x002B9638 File Offset: 0x002B7838
[Token(Token = "0x600C10E")]
[Address(RVA = "0x2145AA0", Offset = "0x2144AA0", VA = "0x182145AA0")]
public CmsEnvelopedDataStreamGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this.recipientInfoGenerators = list;
base..ctor();
this.rand = rand;
}
// Token: 0x0600C10F RID: 49423 RVA: 0x002B9664 File Offset: 0x002B7864
[Token(Token = "0x600C10F")]
[Address(RVA = "0x5C17C0", Offset = "0x5C07C0", VA = "0x1805C17C0")]
public void SetBufferSize(int bufferSize)
{
this._bufferSize = bufferSize;
}
// Token: 0x0600C110 RID: 49424 RVA: 0x002B9678 File Offset: 0x002B7878
[Token(Token = "0x600C110")]
[Address(RVA = "0x8A0F80", Offset = "0x89FF80", VA = "0x1808A0F80")]
public void SetBerEncodeRecipients(bool berEncodeRecipientSet)
{
this._berEncodeRecipientSet = berEncodeRecipientSet;
}
// Token: 0x17001DF1 RID: 7665
// (get) Token: 0x0600C111 RID: 49425 RVA: 0x002B968C File Offset: 0x002B788C
[Token(Token = "0x17001DF1")]
private DerInteger Version
{
[Token(Token = "0x600C111")]
[Address(RVA = "0x2145B50", Offset = "0x2144B50", VA = "0x182145B50")]
get
{
if (this._originatorInfo != (ulong)0L || this._unprotectedAttributes == (ulong)0L)
{
}
return new DerInteger(2);
}
}
// Token: 0x0600C112 RID: 49426 RVA: 0x002B96B8 File Offset: 0x002B78B8
[Token(Token = "0x600C112")]
[Address(RVA = "0x21456B0", Offset = "0x21446B0", VA = "0x1821456B0")]
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: 0x0600C113 RID: 49427 RVA: 0x002B976C File Offset: 0x002B796C
[Token(Token = "0x600C113")]
[Address(RVA = "0x2144E80", Offset = "0x2143E80", VA = "0x182144E80")]
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: 0x0600C114 RID: 49428 RVA: 0x002B98B4 File Offset: 0x002B7AB4
[Token(Token = "0x600C114")]
[Address(RVA = "0x21454D0", Offset = "0x21444D0", VA = "0x1821454D0")]
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: 0x0600C115 RID: 49429 RVA: 0x002B98F4 File Offset: 0x002B7AF4
[Token(Token = "0x600C115")]
[Address(RVA = "0x21455C0", Offset = "0x21445C0", VA = "0x1821455C0")]
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: 0x04007A38 RID: 31288
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007A38")]
private object _originatorInfo;
// Token: 0x04007A39 RID: 31289
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007A39")]
private object _unprotectedAttributes;
// Token: 0x04007A3A RID: 31290
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007A3A")]
private int _bufferSize;
// Token: 0x04007A3B RID: 31291
[FieldOffset(Offset = "0x3C")]
[Token(Token = "0x4007A3B")]
private bool _berEncodeRecipientSet;
// Token: 0x02001E17 RID: 7703
[Token(Token = "0x2001E17")]
private class CmsEnvelopedDataOutputStream : BaseOutputStream
{
// Token: 0x0600C116 RID: 49430 RVA: 0x002B992C File Offset: 0x002B7B2C
[Token(Token = "0x600C116")]
[Address(RVA = "0x2141130", Offset = "0x2140130", VA = "0x182141130")]
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: 0x0600C117 RID: 49431 RVA: 0x002B9964 File Offset: 0x002B7B64
[Token(Token = "0x600C117")]
[Address(RVA = "0x21448C0", Offset = "0x21438C0", VA = "0x1821448C0", Slot = "30")]
public override void WriteByte(byte b)
{
((IDisposable)this._out).Dispose();
}
// Token: 0x0600C118 RID: 49432 RVA: 0x002B9984 File Offset: 0x002B7B84
[Token(Token = "0x600C118")]
[Address(RVA = "0x21448F0", Offset = "0x21438F0", VA = "0x1821448F0", Slot = "29")]
public override void Write(byte[] bytes, int off, int len)
{
int num = this._out.Read(bytes, off, len);
}
// Token: 0x0600C119 RID: 49433 RVA: 0x002B99A8 File Offset: 0x002B7BA8
[Token(Token = "0x600C119")]
[Address(RVA = "0x2144700", Offset = "0x2143700", VA = "0x182144700", 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: 0x04007A3C RID: 31292
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007A3C")]
private readonly CmsEnvelopedGenerator _outer;
// Token: 0x04007A3D RID: 31293
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007A3D")]
private readonly CipherStream _out;
// Token: 0x04007A3E RID: 31294
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007A3E")]
private readonly BerSequenceGenerator _cGen;
// Token: 0x04007A3F RID: 31295
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007A3F")]
private readonly BerSequenceGenerator _envGen;
// Token: 0x04007A40 RID: 31296
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x4007A40")]
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: 0x02001E18 RID: 7704
[Token(Token = "0x2001E18")]
public class CmsEnvelopedGenerator
{
// Token: 0x0600C11A RID: 49434 RVA: 0x002B9A30 File Offset: 0x002B7C30
[Token(Token = "0x600C11A")]
[Address(RVA = "0x2146E70", Offset = "0x2145E70", VA = "0x182146E70")]
public CmsEnvelopedGenerator()
{
SecureRandom secureRandom = new SecureRandom();
IList list = Platform.CreateArrayList();
this.recipientInfoGenerators = list;
base..ctor();
this.rand = secureRandom;
}
// Token: 0x0600C11B RID: 49435 RVA: 0x002B9A60 File Offset: 0x002B7C60
[Token(Token = "0x600C11B")]
[Address(RVA = "0x2146E00", Offset = "0x2145E00", VA = "0x182146E00")]
public CmsEnvelopedGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this.recipientInfoGenerators = list;
base..ctor();
this.rand = rand;
}
// Token: 0x17001DF2 RID: 7666
// (get) Token: 0x0600C11C RID: 49436 RVA: 0x002B9A8C File Offset: 0x002B7C8C
// (set) Token: 0x0600C11D RID: 49437 RVA: 0x002B9AA0 File Offset: 0x002B7CA0
[Token(Token = "0x17001DF2")]
public CmsAttributeTableGenerator UnprotectedAttributeGenerator
{
[Token(Token = "0x600C11C")]
[Address(RVA = "0x4157C0", Offset = "0x4147C0", VA = "0x1804157C0")]
get
{
return this.unprotectedAttributeGenerator;
}
[Token(Token = "0x600C11D")]
[Address(RVA = "0x415810", Offset = "0x414810", VA = "0x180415810")]
set
{
this.unprotectedAttributeGenerator = value;
}
}
// Token: 0x0600C11E RID: 49438 RVA: 0x002B9AB4 File Offset: 0x002B7CB4
[Token(Token = "0x600C11E")]
[Address(RVA = "0x2146420", Offset = "0x2145420", VA = "0x182146420")]
public void AddKeyTransRecipient(X509Certificate cert)
{
new KeyTransRecipientInfoGenerator().RecipientCert = cert;
IList list = this.recipientInfoGenerators;
throw new NullReferenceException();
}
// Token: 0x0600C11F RID: 49439 RVA: 0x002B9AD8 File Offset: 0x002B7CD8
[Token(Token = "0x600C11F")]
[Address(RVA = "0x2146360", Offset = "0x2145360", VA = "0x182146360")]
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: 0x0600C120 RID: 49440 RVA: 0x002B9B0C File Offset: 0x002B7D0C
[Token(Token = "0x600C120")]
[Address(RVA = "0x2145DD0", Offset = "0x2144DD0", VA = "0x182145DD0")]
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: 0x0600C121 RID: 49441 RVA: 0x002B9B54 File Offset: 0x002B7D54
[Token(Token = "0x600C121")]
[Address(RVA = "0x2145ED0", Offset = "0x2144ED0", VA = "0x182145ED0")]
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: 0x0600C122 RID: 49442 RVA: 0x002B9B88 File Offset: 0x002B7D88
[Token(Token = "0x600C122")]
[Address(RVA = "0x21464B0", Offset = "0x21454B0", VA = "0x1821464B0")]
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: 0x0600C123 RID: 49443 RVA: 0x002B9BF0 File Offset: 0x002B7DF0
[Token(Token = "0x600C123")]
[Address(RVA = "0x2145F90", Offset = "0x2144F90", VA = "0x182145F90")]
public void AddKeyAgreementRecipient(string agreementAlgorithm, AsymmetricKeyParameter senderPrivateKey, AsymmetricKeyParameter senderPublicKey, X509Certificate recipientCert, string cekWrapAlgorithm)
{
/*
An exception occurred when decompiling this method (0600C123)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsEnvelopedGenerator::AddKeyAgreementRecipient(System.String,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter,BestHTTP.SecureProtocol.Org.BouncyCastle.X509.X509Certificate,System.String)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_5A:
stloc:ArgumentException(var_6_69, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Expected public key"), ldstr:string("senderPublicKey")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C124 RID: 49444 RVA: 0x002B9C68 File Offset: 0x002B7E68
[Token(Token = "0x600C124")]
[Address(RVA = "0x21461B0", Offset = "0x21451B0", VA = "0x1821461B0")]
public void AddKeyAgreementRecipients(string agreementAlgorithm, AsymmetricKeyParameter senderPrivateKey, AsymmetricKeyParameter senderPublicKey, ICollection recipientCerts, string cekWrapAlgorithm)
{
/*
An exception occurred when decompiling this method (0600C124)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsEnvelopedGenerator::AddKeyAgreementRecipients(System.String,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter,System.Collections.ICollection,System.String)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_4A:
stloc:ArgumentException(var_5_59, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Expected public key"), ldstr:string("senderPublicKey")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C125 RID: 49445 RVA: 0x002B9CD0 File Offset: 0x002B7ED0
[Token(Token = "0x600C125")]
[Address(RVA = "0x2146810", Offset = "0x2145810", VA = "0x182146810", 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: 0x0600C126 RID: 49446 RVA: 0x002B9D00 File Offset: 0x002B7F00
[Token(Token = "0x600C126")]
[Address(RVA = "0x2146640", Offset = "0x2145640", VA = "0x182146640", 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: 0x0600C127 RID: 49447 RVA: 0x002B9D80 File Offset: 0x002B7F80
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600C127")]
[Address(RVA = "0x2146930", Offset = "0x2145930", VA = "0x182146930")]
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: 0x04007A41 RID: 31297
[Token(Token = "0x4007A41")]
internal static readonly short[] rc2Table;
// Token: 0x04007A42 RID: 31298
[Token(Token = "0x4007A42")]
public static readonly string DesEde3Cbc;
// Token: 0x04007A43 RID: 31299
[Token(Token = "0x4007A43")]
public static readonly string RC2Cbc;
// Token: 0x04007A44 RID: 31300
[Token(Token = "0x4007A44")]
public const string IdeaCbc = "1.3.6.1.4.1.188.7.1.1.2";
// Token: 0x04007A45 RID: 31301
[Token(Token = "0x4007A45")]
public const string Cast5Cbc = "1.2.840.113533.7.66.10";
// Token: 0x04007A46 RID: 31302
[Token(Token = "0x4007A46")]
public static readonly string Aes128Cbc;
// Token: 0x04007A47 RID: 31303
[Token(Token = "0x4007A47")]
public static readonly string Aes192Cbc;
// Token: 0x04007A48 RID: 31304
[Token(Token = "0x4007A48")]
public static readonly string Aes256Cbc;
// Token: 0x04007A49 RID: 31305
[Token(Token = "0x4007A49")]
public static readonly string Camellia128Cbc;
// Token: 0x04007A4A RID: 31306
[Token(Token = "0x4007A4A")]
public static readonly string Camellia192Cbc;
// Token: 0x04007A4B RID: 31307
[Token(Token = "0x4007A4B")]
public static readonly string Camellia256Cbc;
// Token: 0x04007A4C RID: 31308
[Token(Token = "0x4007A4C")]
public static readonly string SeedCbc;
// Token: 0x04007A4D RID: 31309
[Token(Token = "0x4007A4D")]
public static readonly string DesEde3Wrap;
// Token: 0x04007A4E RID: 31310
[Token(Token = "0x4007A4E")]
public static readonly string Aes128Wrap;
// Token: 0x04007A4F RID: 31311
[Token(Token = "0x4007A4F")]
public static readonly string Aes192Wrap;
// Token: 0x04007A50 RID: 31312
[Token(Token = "0x4007A50")]
public static readonly string Aes256Wrap;
// Token: 0x04007A51 RID: 31313
[Token(Token = "0x4007A51")]
public static readonly string Camellia128Wrap;
// Token: 0x04007A52 RID: 31314
[Token(Token = "0x4007A52")]
public static readonly string Camellia192Wrap;
// Token: 0x04007A53 RID: 31315
[Token(Token = "0x4007A53")]
public static readonly string Camellia256Wrap;
// Token: 0x04007A54 RID: 31316
[Token(Token = "0x4007A54")]
public static readonly string SeedWrap;
// Token: 0x04007A55 RID: 31317
[Token(Token = "0x4007A55")]
public static readonly string ECDHSha1Kdf;
// Token: 0x04007A56 RID: 31318
[Token(Token = "0x4007A56")]
public static readonly string ECMqvSha1Kdf;
// Token: 0x04007A57 RID: 31319
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A57")]
internal readonly IList recipientInfoGenerators;
// Token: 0x04007A58 RID: 31320
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007A58")]
internal readonly SecureRandom rand;
// Token: 0x04007A59 RID: 31321
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007A59")]
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: 0x02001E19 RID: 7705
[Token(Token = "0x2001E19")]
internal class CmsEnvelopedHelper
{
// Token: 0x0600C128 RID: 49448 RVA: 0x002B9ECC File Offset: 0x002B80CC
[Token(Token = "0x600C128")]
[Address(RVA = "0x2147840", Offset = "0x2146840", VA = "0x182147840")]
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: 0x0600C129 RID: 49449 RVA: 0x002B9F3C File Offset: 0x002B813C
[Token(Token = "0x600C129")]
[Address(RVA = "0x21471E0", Offset = "0x21461E0", VA = "0x1821471E0")]
private string GetAsymmetricEncryptionAlgName(string encryptionAlgOid)
{
bool flag = PkcsObjectIdentifiers.RsaEncryption.identifier.Equals(encryptionAlgOid);
return encryptionAlgOid;
}
// Token: 0x0600C12A RID: 49450 RVA: 0x002B9F64 File Offset: 0x002B8164
[Token(Token = "0x600C12A")]
[Address(RVA = "0x2147030", Offset = "0x2146030", VA = "0x182147030")]
internal IBufferedCipher CreateAsymmetricCipher(string encryptionOid)
{
string asymmetricEncryptionAlgName = this.GetAsymmetricEncryptionAlgName(encryptionOid);
if (!asymmetricEncryptionAlgName.Equals(encryptionOid))
{
return CipherUtilities.GetCipher(asymmetricEncryptionAlgName);
}
return CipherUtilities.GetCipher(encryptionOid);
}
// Token: 0x0600C12B RID: 49451 RVA: 0x002B9F98 File Offset: 0x002B8198
[Token(Token = "0x600C12B")]
[Address(RVA = "0x2147120", Offset = "0x2146120", VA = "0x182147120")]
internal IWrapper CreateWrapper(string encryptionOid)
{
IWrapper wrapper = WrapperUtilities.GetWrapper(encryptionOid);
string text;
return WrapperUtilities.GetWrapper(text);
}
// Token: 0x0600C12C RID: 49452 RVA: 0x002B9FB4 File Offset: 0x002B81B4
[Token(Token = "0x600C12C")]
[Address(RVA = "0x21473C0", Offset = "0x21463C0", VA = "0x1821473C0")]
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: 0x0600C12D RID: 49453 RVA: 0x002B9FEC File Offset: 0x002B81EC
[Token(Token = "0x600C12D")]
[Address(RVA = "0x2147270", Offset = "0x2146270", VA = "0x182147270")]
internal int GetKeySize(string oid)
{
IDictionary keySizes = CmsEnvelopedHelper.KeySizes;
IDictionary keySizes2 = CmsEnvelopedHelper.KeySizes;
CmsEnvelopedHelper instance = CmsEnvelopedHelper.Instance;
throw new NullReferenceException();
}
// Token: 0x0600C12E RID: 49454 RVA: 0x002BA02C File Offset: 0x002B822C
[Token(Token = "0x600C12E")]
[Address(RVA = "0x2146F10", Offset = "0x2145F10", VA = "0x182146F10")]
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: 0x0600C12F RID: 49455 RVA: 0x002BA068 File Offset: 0x002B8268
[Token(Token = "0x600C12F")]
[Address(RVA = "0x2147500", Offset = "0x2146500", VA = "0x182147500")]
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: 0x0600C130 RID: 49456 RVA: 0x002BA0B4 File Offset: 0x002B82B4
[Token(Token = "0x600C130")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public CmsEnvelopedHelper()
{
}
// Token: 0x04007A5A RID: 31322
[Token(Token = "0x4007A5A")]
internal static readonly CmsEnvelopedHelper Instance = new CmsEnvelopedHelper();
// Token: 0x04007A5B RID: 31323
[Token(Token = "0x4007A5B")]
private static readonly IDictionary KeySizes;
// Token: 0x04007A5C RID: 31324
[Token(Token = "0x4007A5C")]
private static readonly IDictionary BaseCipherNames;
// Token: 0x02001E1A RID: 7706
[Token(Token = "0x2001E1A")]
internal class CmsAuthenticatedSecureReadable : CmsSecureReadable
{
// Token: 0x0600C131 RID: 49457 RVA: 0x002BA0C8 File Offset: 0x002B82C8
[Token(Token = "0x600C131")]
[Address(RVA = "0x2142CD0", Offset = "0x2141CD0", VA = "0x182142CD0")]
internal CmsAuthenticatedSecureReadable(AlgorithmIdentifier algorithm, CmsReadable readable)
{
this.algorithm = algorithm;
this.readable = readable;
}
// Token: 0x17001DF3 RID: 7667
// (get) Token: 0x0600C132 RID: 49458 RVA: 0x002BA0EC File Offset: 0x002B82EC
[Token(Token = "0x17001DF3")]
public AlgorithmIdentifier Algorithm
{
[Token(Token = "0x600C132")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530", Slot = "4")]
get
{
return this.algorithm;
}
}
// Token: 0x17001DF4 RID: 7668
// (get) Token: 0x0600C133 RID: 49459 RVA: 0x002BA100 File Offset: 0x002B8300
[Token(Token = "0x17001DF4")]
public object CryptoObject
{
[Token(Token = "0x600C133")]
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0", Slot = "5")]
get
{
/*
An exception occurred when decompiling this method (0600C133)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Object BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsEnvelopedHelper/CmsAuthenticatedSecureReadable::get_CryptoObject()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:IMac(var_0_06, ldfld:IMac(CmsAuthenticatedSecureReadable::mac, ldloc:CmsAuthenticatedSecureReadable(this)))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
}
// Token: 0x0600C134 RID: 49460 RVA: 0x002BA114 File Offset: 0x002B8314
[Token(Token = "0x600C134")]
[Address(RVA = "0x2142A90", Offset = "0x2141A90", VA = "0x182142A90", 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: 0x04007A5D RID: 31325
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A5D")]
private AlgorithmIdentifier algorithm;
// Token: 0x04007A5E RID: 31326
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007A5E")]
private IMac mac;
// Token: 0x04007A5F RID: 31327
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007A5F")]
private CmsReadable readable;
}
// Token: 0x02001E1B RID: 7707
[Token(Token = "0x2001E1B")]
internal class CmsEnvelopedSecureReadable : CmsSecureReadable
{
// Token: 0x0600C135 RID: 49461 RVA: 0x002BA164 File Offset: 0x002B8364
[Token(Token = "0x600C135")]
[Address(RVA = "0x2142CD0", Offset = "0x2141CD0", VA = "0x182142CD0")]
internal CmsEnvelopedSecureReadable(AlgorithmIdentifier algorithm, CmsReadable readable)
{
this.algorithm = algorithm;
this.readable = readable;
}
// Token: 0x17001DF5 RID: 7669
// (get) Token: 0x0600C136 RID: 49462 RVA: 0x002BA188 File Offset: 0x002B8388
[Token(Token = "0x17001DF5")]
public AlgorithmIdentifier Algorithm
{
[Token(Token = "0x600C136")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530", Slot = "4")]
get
{
return this.algorithm;
}
}
// Token: 0x17001DF6 RID: 7670
// (get) Token: 0x0600C137 RID: 49463 RVA: 0x002BA19C File Offset: 0x002B839C
[Token(Token = "0x17001DF6")]
public object CryptoObject
{
[Token(Token = "0x600C137")]
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0", Slot = "5")]
get
{
/*
An exception occurred when decompiling this method (0600C137)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Object BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsEnvelopedHelper/CmsEnvelopedSecureReadable::get_CryptoObject()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:IBufferedCipher(var_0_06, ldfld:IBufferedCipher(CmsEnvelopedSecureReadable::cipher, ldloc:CmsEnvelopedSecureReadable(this)))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
}
// Token: 0x0600C138 RID: 49464 RVA: 0x002BA1B0 File Offset: 0x002B83B0
[Token(Token = "0x600C138")]
[Address(RVA = "0x2147BC0", Offset = "0x2146BC0", VA = "0x182147BC0", 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: 0x04007A60 RID: 31328
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A60")]
private AlgorithmIdentifier algorithm;
// Token: 0x04007A61 RID: 31329
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007A61")]
private IBufferedCipher cipher;
// Token: 0x04007A62 RID: 31330
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007A62")]
private CmsReadable readable;
}
}
}
@@ -0,0 +1,34 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001E1C RID: 7708
[Token(Token = "0x2001E1C")]
[Serializable]
public class CmsException : Exception
{
// Token: 0x0600C139 RID: 49465 RVA: 0x002BA280 File Offset: 0x002B8480
[Token(Token = "0x600C139")]
[Address(RVA = "0x2140300", Offset = "0x213F300", VA = "0x182140300")]
public CmsException()
{
}
// Token: 0x0600C13A RID: 49466 RVA: 0x002BA294 File Offset: 0x002B8494
[Token(Token = "0x600C13A")]
[Address(RVA = "0x21403E0", Offset = "0x213F3E0", VA = "0x1821403E0")]
public CmsException(string msg)
: base(msg)
{
}
// Token: 0x0600C13B RID: 49467 RVA: 0x002BA2A8 File Offset: 0x002B84A8
[Token(Token = "0x600C13B")]
[Address(RVA = "0x2140360", Offset = "0x213F360", VA = "0x182140360")]
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: 0x02001E1D RID: 7709
[Token(Token = "0x2001E1D")]
public abstract class CmsPbeKey : ICipherParameters
{
// Token: 0x0600C13C RID: 49468 RVA: 0x002BA2C0 File Offset: 0x002B84C0
[Token(Token = "0x600C13C")]
[Address(RVA = "0x21482F0", Offset = "0x21472F0", VA = "0x1821482F0")]
[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: 0x0600C13D RID: 49469 RVA: 0x002BA304 File Offset: 0x002B8504
[Token(Token = "0x600C13D")]
[Address(RVA = "0x21482A0", Offset = "0x21472A0", VA = "0x1821482A0")]
[Obsolete]
public CmsPbeKey(string password, AlgorithmIdentifier keyDerivationAlgorithm)
{
char[] array = password.ToCharArray();
}
// Token: 0x0600C13E RID: 49470 RVA: 0x002BA320 File Offset: 0x002B8520
[Token(Token = "0x600C13E")]
[Address(RVA = "0x21483E0", Offset = "0x21473E0", VA = "0x1821483E0")]
public CmsPbeKey(char[] password, byte[] salt, int iterationCount)
{
byte[] array = Arrays.Clone(salt);
this.iterationCount = iterationCount;
this.salt = array;
}
// Token: 0x0600C13F RID: 49471 RVA: 0x002BA350 File Offset: 0x002B8550
[Token(Token = "0x600C13F")]
[Address(RVA = "0x21480A0", Offset = "0x21470A0", VA = "0x1821480A0")]
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: 0x0600C140 RID: 49472 RVA: 0x002BA3B4 File Offset: 0x002B85B4
[Token(Token = "0x600C140")]
[Address(RVA = "0x2147FB0", Offset = "0x2146FB0", VA = "0x182147FB0", 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: 0x17001DF7 RID: 7671
// (get) Token: 0x0600C141 RID: 49473 RVA: 0x002BA3EC File Offset: 0x002B85EC
[Token(Token = "0x17001DF7")]
[Obsolete]
public string Password
{
[Token(Token = "0x600C141")]
[Address(RVA = "0x2148520", Offset = "0x2147520", VA = "0x182148520")]
get
{
char[] array = this.password;
string text;
return text;
}
}
// Token: 0x17001DF8 RID: 7672
// (get) Token: 0x0600C142 RID: 49474 RVA: 0x002BA404 File Offset: 0x002B8604
[Token(Token = "0x17001DF8")]
public byte[] Salt
{
[Token(Token = "0x600C142")]
[Address(RVA = "0x2148040", Offset = "0x2147040", VA = "0x182148040")]
get
{
return Arrays.Clone(this.salt);
}
}
// Token: 0x0600C143 RID: 49475 RVA: 0x002BA41C File Offset: 0x002B861C
[Token(Token = "0x600C143")]
[Address(RVA = "0x2148040", Offset = "0x2147040", VA = "0x182148040")]
[Obsolete]
public byte[] GetSalt()
{
return Arrays.Clone(this.salt);
}
// Token: 0x17001DF9 RID: 7673
// (get) Token: 0x0600C144 RID: 49476 RVA: 0x002BA434 File Offset: 0x002B8634
[Token(Token = "0x17001DF9")]
public int IterationCount
{
[Token(Token = "0x600C144")]
[Address(RVA = "0x470B70", Offset = "0x46FB70", VA = "0x180470B70")]
get
{
return this.iterationCount;
}
}
// Token: 0x17001DFA RID: 7674
// (get) Token: 0x0600C145 RID: 49477 RVA: 0x002BA448 File Offset: 0x002B8648
[Token(Token = "0x17001DFA")]
public string Algorithm
{
[Token(Token = "0x600C145")]
[Address(RVA = "0x21484C0", Offset = "0x21474C0", VA = "0x1821484C0")]
get
{
return "PKCS5S2";
}
}
// Token: 0x17001DFB RID: 7675
// (get) Token: 0x0600C146 RID: 49478 RVA: 0x002BA45C File Offset: 0x002B865C
[Token(Token = "0x17001DFB")]
public string Format
{
[Token(Token = "0x600C146")]
[Address(RVA = "0x21484F0", Offset = "0x21474F0", VA = "0x1821484F0")]
get
{
return "RAW";
}
}
// Token: 0x0600C147 RID: 49479 RVA: 0x002BA470 File Offset: 0x002B8670
[Token(Token = "0x600C147")]
[Address(RVA = "0x4242C0", Offset = "0x4232C0", VA = "0x1804242C0")]
public byte[] GetEncoded()
{
}
// Token: 0x0600C148 RID: 49480
[Token(Token = "0x600C148")]
[Address(Slot = "4")]
internal abstract KeyParameter GetEncoded(string algorithmOid);
// Token: 0x04007A63 RID: 31331
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A63")]
internal readonly char[] password;
// Token: 0x04007A64 RID: 31332
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007A64")]
internal readonly byte[] salt;
// Token: 0x04007A65 RID: 31333
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007A65")]
internal readonly int iterationCount;
}
}
@@ -0,0 +1,22 @@
using System;
using System.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001E1E RID: 7710
[Token(Token = "0x2001E1E")]
public interface CmsProcessable
{
// Token: 0x0600C149 RID: 49481
[Token(Token = "0x600C149")]
[Address(Slot = "0")]
void Write(Stream outStream);
// Token: 0x0600C14A RID: 49482
[Token(Token = "0x600C14A")]
[Address(Slot = "1")]
[Obsolete]
object GetContent();
}
}
@@ -0,0 +1,70 @@
using System;
using System.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001E1F RID: 7711
[Token(Token = "0x2001E1F")]
public class CmsProcessableByteArray : CmsProcessable, CmsReadable
{
// Token: 0x0600C14B RID: 49483 RVA: 0x002BA480 File Offset: 0x002B8680
[Token(Token = "0x600C14B")]
[Address(RVA = "0x493D90", Offset = "0x492D90", VA = "0x180493D90")]
public CmsProcessableByteArray(byte[] bytes)
{
this.bytes = bytes;
}
// Token: 0x0600C14C RID: 49484 RVA: 0x002BA49C File Offset: 0x002B869C
[Token(Token = "0x600C14C")]
[Address(RVA = "0x2148550", Offset = "0x2147550", VA = "0x182148550", Slot = "7")]
public virtual Stream GetInputStream()
{
/*
An exception occurred when decompiling this method (0600C14C)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.IO.Stream BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsProcessableByteArray::GetInputStream()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:MemoryStream(var_0_0C, newobj:MemoryStream(MemoryStream::.ctor, ldfld:uint8[](CmsProcessableByteArray::bytes, ldloc:CmsProcessableByteArray(this)), ldloc:int32[exp:bool](var_1)))
stloc:int32(var_1, ldc.i4:int32(0))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C14D RID: 49485 RVA: 0x002BA4B8 File Offset: 0x002B86B8
[Token(Token = "0x600C14D")]
[Address(RVA = "0x21485B0", Offset = "0x21475B0", VA = "0x1821485B0", Slot = "8")]
public virtual void Write(Stream zOut)
{
byte[] array = this.bytes;
int num = zOut.ReadByte();
}
// Token: 0x0600C14E RID: 49486 RVA: 0x002BA4DC File Offset: 0x002B86DC
[Token(Token = "0x600C14E")]
[Address(RVA = "0x2148530", Offset = "0x2147530", VA = "0x182148530", Slot = "9")]
[Obsolete]
public virtual object GetContent()
{
byte[] array = this.bytes;
throw new NullReferenceException();
}
// Token: 0x04007A66 RID: 31334
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A66")]
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: 0x02001E20 RID: 7712
[Token(Token = "0x2001E20")]
public class CmsProcessableFile : CmsProcessable, CmsReadable
{
// Token: 0x0600C14F RID: 49487 RVA: 0x002BA4F8 File Offset: 0x002B86F8
[Token(Token = "0x600C14F")]
[Address(RVA = "0x2148720", Offset = "0x2147720", VA = "0x182148720")]
public CmsProcessableFile(FileInfo file)
{
this._file = file;
this._bufSize = (int)((ulong)32768L);
}
// Token: 0x0600C150 RID: 49488 RVA: 0x002BA520 File Offset: 0x002B8720
[Token(Token = "0x600C150")]
[Address(RVA = "0x52CBA0", Offset = "0x52BBA0", VA = "0x18052CBA0")]
public CmsProcessableFile(FileInfo file, int bufSize)
{
this._file = file;
this._bufSize = bufSize;
}
// Token: 0x0600C151 RID: 49489 RVA: 0x002BA544 File Offset: 0x002B8744
[Token(Token = "0x600C151")]
[Address(RVA = "0x21485F0", Offset = "0x21475F0", VA = "0x1821485F0", Slot = "7")]
public virtual Stream GetInputStream()
{
FileInfo file = this._file;
int bufSize = this._bufSize;
throw new NullReferenceException();
}
// Token: 0x0600C152 RID: 49490 RVA: 0x002BA564 File Offset: 0x002B8764
[Token(Token = "0x600C152")]
[Address(RVA = "0x2148690", Offset = "0x2147690", VA = "0x182148690", Slot = "8")]
public virtual void Write(Stream zOut)
{
Stream inputStream = this.GetInputStream();
Streams.PipeAll(inputStream, zOut);
Platform.Dispose(inputStream);
}
// Token: 0x0600C153 RID: 49491 RVA: 0x002BA588 File Offset: 0x002B8788
[Token(Token = "0x600C153")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530", Slot = "9")]
[Obsolete]
public virtual object GetContent()
{
/*
An exception occurred when decompiling this method (0600C153)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Object BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsProcessableFile::GetContent()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:FileInfo(var_0_06, ldfld:FileInfo(CmsProcessableFile::_file, ldloc:CmsProcessableFile(this)))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x04007A67 RID: 31335
[Token(Token = "0x4007A67")]
private const int DefaultBufSize = 32768;
// Token: 0x04007A68 RID: 31336
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A68")]
private readonly FileInfo _file;
// Token: 0x04007A69 RID: 31337
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007A69")]
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: 0x02001E21 RID: 7713
[Token(Token = "0x2001E21")]
public class CmsProcessableInputStream : CmsProcessable, CmsReadable
{
// Token: 0x0600C154 RID: 49492 RVA: 0x002BA59C File Offset: 0x002B879C
[Token(Token = "0x600C154")]
[Address(RVA = "0x493D90", Offset = "0x492D90", VA = "0x180493D90")]
public CmsProcessableInputStream(Stream input)
{
this.input = input;
}
// Token: 0x0600C155 RID: 49493 RVA: 0x002BA5B8 File Offset: 0x002B87B8
[Token(Token = "0x600C155")]
[Address(RVA = "0x2148830", Offset = "0x2147830", VA = "0x182148830", Slot = "7")]
public virtual Stream GetInputStream()
{
object content = this.GetContent();
return this.input;
}
// Token: 0x0600C156 RID: 49494 RVA: 0x002BA5D4 File Offset: 0x002B87D4
[Token(Token = "0x600C156")]
[Address(RVA = "0x2148860", Offset = "0x2147860", VA = "0x182148860", Slot = "8")]
public virtual void Write(Stream output)
{
object content = this.GetContent();
Streams.PipeAll(this.input, output);
Platform.Dispose(this.input);
}
// Token: 0x0600C157 RID: 49495 RVA: 0x002BA600 File Offset: 0x002B8800
[Token(Token = "0x600C157")]
[Address(RVA = "0x6818B0", Offset = "0x6808B0", VA = "0x1806818B0", Slot = "9")]
[Obsolete]
public virtual object GetContent()
{
return ((CmsProcessable)this).GetContent();
}
// Token: 0x0600C158 RID: 49496 RVA: 0x002BA614 File Offset: 0x002B8814
[Token(Token = "0x600C158")]
[Address(RVA = "0x2148750", Offset = "0x2147750", VA = "0x182148750", Slot = "10")]
protected virtual void CheckSingleUsage()
{
/*
An exception occurred when decompiling this method (0600C158)
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 1663
*/;
}
// Token: 0x04007A6A RID: 31338
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A6A")]
private readonly Stream input;
// Token: 0x04007A6B RID: 31339
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007A6B")]
private bool used;
}
}
@@ -0,0 +1,16 @@
using System;
using System.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001E22 RID: 7714
[Token(Token = "0x2001E22")]
public interface CmsReadable
{
// Token: 0x0600C159 RID: 49497
[Token(Token = "0x600C159")]
[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: 0x02001E23 RID: 7715
[Token(Token = "0x2001E23")]
internal interface CmsSecureReadable
{
// Token: 0x17001DFC RID: 7676
// (get) Token: 0x0600C15A RID: 49498
[Token(Token = "0x17001DFC")]
AlgorithmIdentifier Algorithm
{
[Token(Token = "0x600C15A")]
[Address(Slot = "0")]
get;
}
// Token: 0x17001DFD RID: 7677
// (get) Token: 0x0600C15B RID: 49499
[Token(Token = "0x17001DFD")]
object CryptoObject
{
[Token(Token = "0x600C15B")]
[Address(Slot = "1")]
get;
}
// Token: 0x0600C15C RID: 49500
[Token(Token = "0x600C15C")]
[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: 0x02001E24 RID: 7716
[Token(Token = "0x2001E24")]
public class CmsSignedData
{
// Token: 0x0600C15D RID: 49501 RVA: 0x002BA648 File Offset: 0x002B8848
[Token(Token = "0x600C15D")]
[Address(RVA = "0x214CD20", Offset = "0x214BD20", VA = "0x18214CD20")]
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: 0x0600C15E RID: 49502 RVA: 0x002BA69C File Offset: 0x002B889C
[Token(Token = "0x600C15E")]
[Address(RVA = "0x214CD70", Offset = "0x214BD70", VA = "0x18214CD70")]
public CmsSignedData(byte[] sigBlock)
{
int num;
MemoryStream memoryStream = new MemoryStream(sigBlock, num != 0);
num = 0;
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(memoryStream);
}
// Token: 0x0600C15F RID: 49503 RVA: 0x002BA6BC File Offset: 0x002B88BC
[Token(Token = "0x600C15F")]
[Address(RVA = "0x214CBF0", Offset = "0x214BBF0", VA = "0x18214CBF0")]
public CmsSignedData(CmsProcessable signedContent, byte[] sigBlock)
{
int num;
MemoryStream memoryStream = new MemoryStream(sigBlock, num != 0);
num = 0;
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(memoryStream);
}
// Token: 0x0600C160 RID: 49504 RVA: 0x002BA6DC File Offset: 0x002B88DC
[Token(Token = "0x600C160")]
[Address(RVA = "0x214CC80", Offset = "0x214BC80", VA = "0x18214CC80")]
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: 0x0600C161 RID: 49505 RVA: 0x002BA720 File Offset: 0x002B8920
[Token(Token = "0x600C161")]
[Address(RVA = "0x214CA60", Offset = "0x214BA60", VA = "0x18214CA60")]
public CmsSignedData(CmsProcessable signedContent, Stream sigData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(sigData);
}
// Token: 0x0600C162 RID: 49506 RVA: 0x002BA734 File Offset: 0x002B8934
[Token(Token = "0x600C162")]
[Address(RVA = "0x214CAA0", Offset = "0x214BAA0", VA = "0x18214CAA0")]
public CmsSignedData(Stream sigData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(sigData);
}
// Token: 0x0600C163 RID: 49507 RVA: 0x002BA748 File Offset: 0x002B8948
[Token(Token = "0x600C163")]
[Address(RVA = "0x214CAD0", Offset = "0x214BAD0", VA = "0x18214CAD0")]
public CmsSignedData(CmsProcessable signedContent, ContentInfo sigData)
{
this.signedContent = signedContent;
this.contentInfo = sigData;
SignedData instance = SignedData.GetInstance(sigData.content);
this.signedData = instance;
}
// Token: 0x0600C164 RID: 49508 RVA: 0x002BA784 File Offset: 0x002B8984
[Token(Token = "0x600C164")]
[Address(RVA = "0x214CB60", Offset = "0x214BB60", VA = "0x18214CB60")]
public CmsSignedData(IDictionary hashes, ContentInfo sigData)
{
this.hashes = hashes;
this.contentInfo = sigData;
SignedData instance = SignedData.GetInstance(sigData.content);
this.signedData = instance;
}
// Token: 0x0600C165 RID: 49509 RVA: 0x002BA7C0 File Offset: 0x002B89C0
[Token(Token = "0x600C165")]
[Address(RVA = "0x214CDF0", Offset = "0x214BDF0", VA = "0x18214CDF0")]
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: 0x17001DFE RID: 7678
// (get) Token: 0x0600C166 RID: 49510 RVA: 0x002BA818 File Offset: 0x002B8A18
[Token(Token = "0x17001DFE")]
public int Version
{
[Token(Token = "0x600C166")]
[Address(RVA = "0x214CFC0", Offset = "0x214BFC0", VA = "0x18214CFC0")]
get
{
return this.signedData.version.Value.IntValue;
}
}
// Token: 0x0600C167 RID: 49511 RVA: 0x002BA840 File Offset: 0x002B8A40
[Token(Token = "0x600C167")]
[Address(RVA = "0x214BC90", Offset = "0x214AC90", VA = "0x18214BC90")]
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: 0x0600C168 RID: 49512 RVA: 0x002BA958 File Offset: 0x002B8B58
[Token(Token = "0x600C168")]
[Address(RVA = "0x214BA90", Offset = "0x214AA90", VA = "0x18214BA90")]
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: 0x0600C169 RID: 49513 RVA: 0x002BA99C File Offset: 0x002B8B9C
[Token(Token = "0x600C169")]
[Address(RVA = "0x214BB30", Offset = "0x214AB30", VA = "0x18214BB30")]
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: 0x0600C16A RID: 49514 RVA: 0x002BA9E0 File Offset: 0x002B8BE0
[Token(Token = "0x600C16A")]
[Address(RVA = "0x214BBD0", Offset = "0x214ABD0", VA = "0x18214BBD0")]
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: 0x17001DFF RID: 7679
// (get) Token: 0x0600C16B RID: 49515 RVA: 0x002BAA24 File Offset: 0x002B8C24
[Token(Token = "0x17001DFF")]
[Obsolete]
public string SignedContentTypeOid
{
[Token(Token = "0x600C16B")]
[Address(RVA = "0x214CF60", Offset = "0x214BF60", VA = "0x18214CF60")]
get
{
return this.signedData.contentInfo.contentType.identifier;
}
}
// Token: 0x17001E00 RID: 7680
// (get) Token: 0x0600C16C RID: 49516 RVA: 0x002BAA4C File Offset: 0x002B8C4C
[Token(Token = "0x17001E00")]
public DerObjectIdentifier SignedContentType
{
[Token(Token = "0x600C16C")]
[Address(RVA = "0x214CF90", Offset = "0x214BF90", VA = "0x18214CF90")]
get
{
return this.signedData.contentInfo.contentType;
}
}
// Token: 0x17001E01 RID: 7681
// (get) Token: 0x0600C16D RID: 49517 RVA: 0x002BAA70 File Offset: 0x002B8C70
[Token(Token = "0x17001E01")]
public CmsProcessable SignedContent
{
[Token(Token = "0x600C16D")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530")]
get
{
return this.signedContent;
}
}
// Token: 0x17001E02 RID: 7682
// (get) Token: 0x0600C16E RID: 49518 RVA: 0x002BAA84 File Offset: 0x002B8C84
[Token(Token = "0x17001E02")]
public ContentInfo ContentInfo
{
[Token(Token = "0x600C16E")]
[Address(RVA = "0x4157C0", Offset = "0x4147C0", VA = "0x1804157C0")]
get
{
return this.contentInfo;
}
}
// Token: 0x0600C16F RID: 49519 RVA: 0x002BAA98 File Offset: 0x002B8C98
[Token(Token = "0x600C16F")]
[Address(RVA = "0x214BC70", Offset = "0x214AC70", VA = "0x18214BC70")]
public byte[] GetEncoded()
{
return this.contentInfo.GetEncoded();
}
// Token: 0x0600C170 RID: 49520 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600C170")]
[Address(RVA = "0x214C2A0", Offset = "0x214B2A0", VA = "0x18214C2A0")]
public static CmsSignedData ReplaceSigners(CmsSignedData signedData, SignerInformationStore signerInformationStore)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600C171 RID: 49521 RVA: 0x002BAAB8 File Offset: 0x002B8CB8
[Token(Token = "0x600C171")]
[Address(RVA = "0x214C010", Offset = "0x214B010", VA = "0x18214C010")]
public static CmsSignedData ReplaceCertificatesAndCrls(CmsSignedData signedData, IX509Store x509Certs, IX509Store x509Crls, IX509Store x509AttrCerts)
{
/*
An exception occurred when decompiling this method (0600C171)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedData BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedData::ReplaceCertificatesAndCrls(BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedData,BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store.IX509Store,BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store.IX509Store,BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store.IX509Store)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_B5:
stloc:Exception(var_16_BF, call:Exception(Platform::CreateNotImplementedException, ldstr:string("Currently can't replace attribute certificates")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x04007A6C RID: 31340
[Token(Token = "0x4007A6C")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x04007A6D RID: 31341
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A6D")]
private readonly CmsProcessable signedContent;
// Token: 0x04007A6E RID: 31342
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007A6E")]
private SignedData signedData;
// Token: 0x04007A6F RID: 31343
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007A6F")]
private ContentInfo contentInfo;
// Token: 0x04007A70 RID: 31344
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007A70")]
private SignerInformationStore signerInfoStore;
// Token: 0x04007A71 RID: 31345
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007A71")]
private IX509Store attrCertStore;
// Token: 0x04007A72 RID: 31346
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007A72")]
private IX509Store certificateStore;
// Token: 0x04007A73 RID: 31347
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007A73")]
private IX509Store crlStore;
// Token: 0x04007A74 RID: 31348
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007A74")]
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: 0x02001E25 RID: 7717
[Token(Token = "0x2001E25")]
public class CmsSignedDataGenerator : CmsSignedGenerator
{
// Token: 0x0600C173 RID: 49523 RVA: 0x002BABA0 File Offset: 0x002B8DA0
[Token(Token = "0x600C173")]
[Address(RVA = "0x214A2E0", Offset = "0x21492E0", VA = "0x18214A2E0")]
public CmsSignedDataGenerator()
{
IList list = Platform.CreateArrayList();
this.signerInfs = list;
base..ctor();
}
// Token: 0x0600C174 RID: 49524 RVA: 0x002BABC4 File Offset: 0x002B8DC4
[Token(Token = "0x600C174")]
[Address(RVA = "0x214A250", Offset = "0x2149250", VA = "0x18214A250")]
public CmsSignedDataGenerator(SecureRandom rand)
{
IList list = Platform.CreateArrayList();
this.signerInfs = list;
base..ctor(rand);
}
// Token: 0x0600C175 RID: 49525 RVA: 0x002BABE8 File Offset: 0x002B8DE8
[Token(Token = "0x600C175")]
[Address(RVA = "0x2148B10", Offset = "0x2147B10", VA = "0x182148B10")]
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: 0x0600C176 RID: 49526 RVA: 0x002BAC24 File Offset: 0x002B8E24
[Token(Token = "0x600C176")]
[Address(RVA = "0x21490E0", Offset = "0x21480E0", VA = "0x1821490E0")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOID, string digestOID)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
}
// Token: 0x0600C177 RID: 49527 RVA: 0x002BAC40 File Offset: 0x002B8E40
[Token(Token = "0x600C177")]
[Address(RVA = "0x21489D0", Offset = "0x21479D0", VA = "0x1821489D0")]
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: 0x0600C178 RID: 49528 RVA: 0x002BAC7C File Offset: 0x002B8E7C
[Token(Token = "0x600C178")]
[Address(RVA = "0x21491C0", Offset = "0x21481C0", VA = "0x1821491C0")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOID, string digestOID)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
}
// Token: 0x0600C179 RID: 49529 RVA: 0x002BAC98 File Offset: 0x002B8E98
[Token(Token = "0x600C179")]
[Address(RVA = "0x2148E90", Offset = "0x2147E90", VA = "0x182148E90")]
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: 0x0600C17A RID: 49530 RVA: 0x002BACC0 File Offset: 0x002B8EC0
[Token(Token = "0x600C17A")]
[Address(RVA = "0x2148D80", Offset = "0x2147D80", VA = "0x182148D80")]
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: 0x0600C17B RID: 49531 RVA: 0x002BACD4 File Offset: 0x002B8ED4
[Token(Token = "0x600C17B")]
[Address(RVA = "0x21492A0", Offset = "0x21482A0", VA = "0x1821492A0")]
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: 0x0600C17C RID: 49532 RVA: 0x002BACFC File Offset: 0x002B8EFC
[Token(Token = "0x600C17C")]
[Address(RVA = "0x2149430", Offset = "0x2148430", VA = "0x182149430")]
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: 0x0600C17D RID: 49533 RVA: 0x002BAD10 File Offset: 0x002B8F10
[Token(Token = "0x600C17D")]
[Address(RVA = "0x2148C50", Offset = "0x2147C50", VA = "0x182148C50")]
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: 0x0600C17E RID: 49534 RVA: 0x002BAD3C File Offset: 0x002B8F3C
[Token(Token = "0x600C17E")]
[Address(RVA = "0x2149020", Offset = "0x2148020", VA = "0x182149020")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOID, string digestOID, CmsAttributeTableGenerator signedAttrGen, CmsAttributeTableGenerator unsignedAttrGen)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
}
// Token: 0x0600C17F RID: 49535 RVA: 0x002BAD54 File Offset: 0x002B8F54
[Token(Token = "0x600C17F")]
[Address(RVA = "0x2149540", Offset = "0x2148540", VA = "0x182149540")]
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: 0x0600C180 RID: 49536 RVA: 0x002BAD80 File Offset: 0x002B8F80
[Token(Token = "0x600C180")]
[Address(RVA = "0x2149670", Offset = "0x2148670", VA = "0x182149670")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOID, string digestOID, CmsAttributeTableGenerator signedAttrGen, CmsAttributeTableGenerator unsignedAttrGen)
{
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
}
// Token: 0x0600C181 RID: 49537 RVA: 0x002BAD98 File Offset: 0x002B8F98
[Token(Token = "0x600C181")]
[Address(RVA = "0x21488F0", Offset = "0x21478F0", VA = "0x1821488F0")]
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: 0x0600C182 RID: 49538 RVA: 0x002BADE0 File Offset: 0x002B8FE0
[Token(Token = "0x600C182")]
[Address(RVA = "0x214A360", Offset = "0x2149360", VA = "0x18214A360")]
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: 0x0600C183 RID: 49539 RVA: 0x002BAE60 File Offset: 0x002B9060
[Token(Token = "0x600C183")]
[Address(RVA = "0x21497D0", Offset = "0x21487D0", VA = "0x1821497D0")]
public CmsSignedData Generate(CmsProcessable content)
{
int num = 0;
string data = CmsSignedGenerator.Data;
return this.Generate(data, content, num != 0);
}
// Token: 0x0600C184 RID: 49540 RVA: 0x002BAE80 File Offset: 0x002B9080
[Token(Token = "0x600C184")]
[Address(RVA = "0x2149850", Offset = "0x2148850", VA = "0x182149850")]
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: 0x0600C185 RID: 49541 RVA: 0x002BB03C File Offset: 0x002B923C
[Token(Token = "0x600C185")]
[Address(RVA = "0x214A150", Offset = "0x2149150", VA = "0x18214A150")]
public CmsSignedData Generate(CmsProcessable content, bool encapsulate)
{
string data = CmsSignedGenerator.Data;
return this.Generate(data, content, encapsulate);
}
// Token: 0x0600C186 RID: 49542 RVA: 0x002BB058 File Offset: 0x002B9258
[Token(Token = "0x600C186")]
[Address(RVA = "0x2149730", Offset = "0x2148730", VA = "0x182149730")]
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: 0x04007A75 RID: 31349
[Token(Token = "0x4007A75")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x04007A76 RID: 31350
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007A76")]
private readonly IList signerInfs;
// Token: 0x02001E26 RID: 7718
[Token(Token = "0x2001E26")]
private class SignerInf
{
// Token: 0x0600C188 RID: 49544 RVA: 0x002BB0A8 File Offset: 0x002B92A8
[Token(Token = "0x600C188")]
[Address(RVA = "0x2150B30", Offset = "0x214FB30", VA = "0x182150B30")]
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: 0x0600C189 RID: 49545 RVA: 0x002BB120 File Offset: 0x002B9320
[Token(Token = "0x600C189")]
[Address(RVA = "0x2150C90", Offset = "0x214FC90", VA = "0x182150C90")]
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: 0x17001E03 RID: 7683
// (get) Token: 0x0600C18A RID: 49546 RVA: 0x002BB1A8 File Offset: 0x002B93A8
[Token(Token = "0x17001E03")]
internal AlgorithmIdentifier DigestAlgorithmID
{
[Token(Token = "0x600C18A")]
[Address(RVA = "0x2150EB0", Offset = "0x214FEB0", VA = "0x182150EB0")]
get
{
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(this.digestOID);
DerNull instance = DerNull.Instance;
return new AlgorithmIdentifier(derObjectIdentifier, instance);
}
}
// Token: 0x17001E04 RID: 7684
// (get) Token: 0x0600C18B RID: 49547 RVA: 0x002BB1D0 File Offset: 0x002B93D0
[Token(Token = "0x17001E04")]
internal CmsAttributeTableGenerator SignedAttributes
{
[Token(Token = "0x600C18B")]
[Address(RVA = "0x41CEF0", Offset = "0x41BEF0", VA = "0x18041CEF0")]
get
{
return this.sAttr;
}
}
// Token: 0x17001E05 RID: 7685
// (get) Token: 0x0600C18C RID: 49548 RVA: 0x002BB1E4 File Offset: 0x002B93E4
[Token(Token = "0x17001E05")]
internal CmsAttributeTableGenerator UnsignedAttributes
{
[Token(Token = "0x600C18C")]
[Address(RVA = "0x417680", Offset = "0x416680", VA = "0x180417680")]
get
{
return this.unsAttr;
}
}
// Token: 0x0600C18D RID: 49549 RVA: 0x002BB1F8 File Offset: 0x002B93F8
[Token(Token = "0x600C18D")]
[Address(RVA = "0x2150390", Offset = "0x214F390", VA = "0x182150390")]
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: 0x04007A77 RID: 31351
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A77")]
private readonly CmsSignedGenerator outer;
// Token: 0x04007A78 RID: 31352
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007A78")]
private readonly ISignatureFactory sigCalc;
// Token: 0x04007A79 RID: 31353
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007A79")]
private readonly SignerIdentifier signerIdentifier;
// Token: 0x04007A7A RID: 31354
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007A7A")]
private readonly string digestOID;
// Token: 0x04007A7B RID: 31355
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007A7B")]
private readonly string encOID;
// Token: 0x04007A7C RID: 31356
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007A7C")]
private readonly CmsAttributeTableGenerator sAttr;
// Token: 0x04007A7D RID: 31357
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007A7D")]
private readonly CmsAttributeTableGenerator unsAttr;
// Token: 0x04007A7E RID: 31358
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007A7E")]
private readonly BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable baseSignedTable;
}
}
}
@@ -0,0 +1,485 @@
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: 0x02001E27 RID: 7719
[Token(Token = "0x2001E27")]
public class CmsSignedDataParser : CmsContentInfoParser
{
// Token: 0x0600C18E RID: 49550 RVA: 0x002BB398 File Offset: 0x002B9598
[Token(Token = "0x600C18E")]
[Address(RVA = "0x214B980", Offset = "0x214A980", VA = "0x18214B980")]
public CmsSignedDataParser(byte[] sigBlock)
{
int num;
MemoryStream memoryStream = new MemoryStream(sigBlock, num != 0);
num = 0;
}
// Token: 0x0600C18F RID: 49551 RVA: 0x002BB3B4 File Offset: 0x002B95B4
[Token(Token = "0x600C18F")]
[Address(RVA = "0x214B4C0", Offset = "0x214A4C0", VA = "0x18214B4C0")]
public CmsSignedDataParser(CmsTypedStream signedContent, byte[] sigBlock)
{
int num;
MemoryStream memoryStream = new MemoryStream(sigBlock, num != 0);
num = 0;
}
// Token: 0x0600C190 RID: 49552 RVA: 0x002BB3CC File Offset: 0x002B95CC
[Token(Token = "0x600C190")]
[Address(RVA = "0x214B970", Offset = "0x214A970", VA = "0x18214B970")]
public CmsSignedDataParser(Stream sigData)
{
}
// Token: 0x0600C191 RID: 49553 RVA: 0x002BB3DC File Offset: 0x002B95DC
[Token(Token = "0x600C191")]
[Address(RVA = "0x214B540", Offset = "0x214A540", VA = "0x18214B540")]
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: 0x17001E06 RID: 7686
// (get) Token: 0x0600C192 RID: 49554 RVA: 0x002BB540 File Offset: 0x002B9740
[Token(Token = "0x17001E06")]
public int Version
{
[Token(Token = "0x600C192")]
[Address(RVA = "0x214BA50", Offset = "0x214AA50", VA = "0x18214BA50")]
get
{
return this._signedData._version.Value.IntValue;
}
}
// Token: 0x17001E07 RID: 7687
// (get) Token: 0x0600C193 RID: 49555 RVA: 0x002BB568 File Offset: 0x002B9768
[Token(Token = "0x17001E07")]
public ISet DigestOids
{
[Token(Token = "0x600C193")]
[Address(RVA = "0x214B9F0", Offset = "0x214A9F0", VA = "0x18214B9F0")]
get
{
/*
An exception occurred when decompiling this method (0600C193)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections.ISet BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedDataParser::get_DigestOids()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:HashSet(var_0_0B, newobj:HashSet(HashSet::.ctor, ldfld:ISet[exp:IEnumerable](CmsSignedDataParser::_digestOids, ldloc:CmsSignedDataParser(this))))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
}
// Token: 0x0600C194 RID: 49556 RVA: 0x002BB580 File Offset: 0x002B9780
[Token(Token = "0x600C194")]
[Address(RVA = "0x214A9A0", Offset = "0x21499A0", VA = "0x18214A9A0")]
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: 0x0600C195 RID: 49557 RVA: 0x002BB680 File Offset: 0x002B9880
[Token(Token = "0x600C195")]
[Address(RVA = "0x214A560", Offset = "0x2149560", VA = "0x18214A560")]
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: 0x0600C196 RID: 49558 RVA: 0x002BB6C4 File Offset: 0x002B98C4
[Token(Token = "0x600C196")]
[Address(RVA = "0x214A600", Offset = "0x2149600", VA = "0x18214A600")]
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: 0x0600C197 RID: 49559 RVA: 0x002BB708 File Offset: 0x002B9908
[Token(Token = "0x600C197")]
[Address(RVA = "0x214A6A0", Offset = "0x21496A0", VA = "0x18214A6A0")]
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: 0x0600C198 RID: 49560 RVA: 0x002BB74C File Offset: 0x002B994C
[Token(Token = "0x600C198")]
[Address(RVA = "0x214AE00", Offset = "0x2149E00", VA = "0x18214AE00")]
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: 0x17001E08 RID: 7688
// (get) Token: 0x0600C199 RID: 49561 RVA: 0x002BB7A0 File Offset: 0x002B99A0
[Token(Token = "0x17001E08")]
public DerObjectIdentifier SignedContentType
{
[Token(Token = "0x600C199")]
[Address(RVA = "0x4157D0", Offset = "0x4147D0", VA = "0x1804157D0")]
get
{
return this._signedContentType;
}
}
// Token: 0x0600C19A RID: 49562 RVA: 0x002BB7B4 File Offset: 0x002B99B4
[Token(Token = "0x600C19A")]
[Address(RVA = "0x214A740", Offset = "0x2149740", VA = "0x18214A740")]
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: 0x0600C19B RID: 49563 RVA: 0x002BB838 File Offset: 0x002B9A38
[Token(Token = "0x600C19B")]
[Address(RVA = "0x214B160", Offset = "0x214A160", VA = "0x18214B160")]
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;
Stream stream = cmsSignedDataStreamGenerator.Open(outStr, identifier, flag);
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: 0x0600C19C RID: 49564 RVA: 0x002BB964 File Offset: 0x002B9B64
[Token(Token = "0x600C19C")]
[Address(RVA = "0x214AF80", Offset = "0x2149F80", VA = "0x18214AF80")]
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: 0x0600C19D RID: 49565 RVA: 0x002BB9F4 File Offset: 0x002B9BF4
[Token(Token = "0x600C19D")]
[Address(RVA = "0x214A500", Offset = "0x2149500", VA = "0x18214A500")]
private static Asn1Set GetAsn1Set(Asn1SetParser asn1SetParser)
{
if (asn1SetParser == 0)
{
}
return Asn1Set.GetInstance(0);
}
// Token: 0x04007A7F RID: 31359
[Token(Token = "0x4007A7F")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x04007A80 RID: 31360
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007A80")]
private SignedDataParser _signedData;
// Token: 0x04007A81 RID: 31361
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007A81")]
private DerObjectIdentifier _signedContentType;
// Token: 0x04007A82 RID: 31362
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007A82")]
private CmsTypedStream _signedContent;
// Token: 0x04007A83 RID: 31363
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007A83")]
private IDictionary _digests;
// Token: 0x04007A84 RID: 31364
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007A84")]
private ISet _digestOids;
// Token: 0x04007A85 RID: 31365
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007A85")]
private SignerInformationStore _signerInfoStore;
// Token: 0x04007A86 RID: 31366
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x4007A86")]
private Asn1Set _certSet;
// Token: 0x04007A87 RID: 31367
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x4007A87")]
private Asn1Set _crlSet;
// Token: 0x04007A88 RID: 31368
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x4007A88")]
private bool _isCertCrlParsed;
// Token: 0x04007A89 RID: 31369
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x4007A89")]
private IX509Store _attributeStore;
// Token: 0x04007A8A RID: 31370
[FieldOffset(Offset = "0x70")]
[Token(Token = "0x4007A8A")]
private IX509Store _certificateStore;
// Token: 0x04007A8B RID: 31371
[FieldOffset(Offset = "0x78")]
[Token(Token = "0x4007A8B")]
private IX509Store _crlStore;
}
}
@@ -0,0 +1,943 @@
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.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.Utilities.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001E28 RID: 7720
[Token(Token = "0x2001E28")]
public class CmsSignedDataStreamGenerator : CmsSignedGenerator
{
// Token: 0x0600C19F RID: 49567 RVA: 0x002BBA28 File Offset: 0x002B9C28
[Token(Token = "0x600C19F")]
[Address(RVA = "0x2923F00", Offset = "0x2922F00", VA = "0x182923F00")]
public CmsSignedDataStreamGenerator()
{
IList list = Platform.CreateArrayList();
this._signerInfs = list;
HashSet hashSet = new HashSet();
this._messageDigestOids = hashSet;
IDictionary dictionary = Platform.CreateHashtable();
this._messageDigests = dictionary;
IDictionary dictionary2 = Platform.CreateHashtable();
this._messageHashes = dictionary2;
SecureRandom secureRandom = new SecureRandom();
base..ctor(secureRandom);
}
// Token: 0x0600C1A0 RID: 49568 RVA: 0x002BBA84 File Offset: 0x002B9C84
[Token(Token = "0x600C1A0")]
[Address(RVA = "0x2923FF0", Offset = "0x2922FF0", VA = "0x182923FF0")]
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: 0x0600C1A1 RID: 49569 RVA: 0x002BBAD8 File Offset: 0x002B9CD8
[Token(Token = "0x600C1A1")]
[Address(RVA = "0xED62D0", Offset = "0xED52D0", VA = "0x180ED62D0")]
public void SetBufferSize(int bufferSize)
{
this._bufferSize = bufferSize;
}
// Token: 0x0600C1A2 RID: 49570 RVA: 0x002BBAEC File Offset: 0x002B9CEC
[Token(Token = "0x600C1A2")]
[Address(RVA = "0x2921BF0", Offset = "0x2920BF0", VA = "0x182921BF0")]
public void AddDigests(params string[] digestOids)
{
this.AddDigests(digestOids);
}
// Token: 0x0600C1A3 RID: 49571 RVA: 0x002BBB00 File Offset: 0x002B9D00
[Token(Token = "0x600C1A3")]
[Address(RVA = "0x2921C00", Offset = "0x2920C00", VA = "0x182921C00")]
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: 0x0600C1A4 RID: 49572 RVA: 0x002BBB44 File Offset: 0x002B9D44
[Token(Token = "0x600C1A4")]
[Address(RVA = "0x2922400", Offset = "0x2921400", VA = "0x182922400")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOid)
{
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
IDictionary dictionary = Platform.CreateHashtable();
defaultSignedAttributeTableGenerator.table = dictionary;
int num = 0;
this.AddSigner(privateKey, cert, digestOid, defaultSignedAttributeTableGenerator, num);
}
// Token: 0x0600C1A5 RID: 49573 RVA: 0x002BBB74 File Offset: 0x002B9D74
[Token(Token = "0x600C1A5")]
[Address(RVA = "0x2921E00", Offset = "0x2920E00", VA = "0x182921E00")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid)
{
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
IDictionary dictionary = Platform.CreateHashtable();
defaultSignedAttributeTableGenerator.table = dictionary;
}
// Token: 0x0600C1A6 RID: 49574 RVA: 0x002BBB98 File Offset: 0x002B9D98
[Token(Token = "0x600C1A6")]
[Address(RVA = "0x2921FC0", Offset = "0x2920FC0", VA = "0x182921FC0")]
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)
{
int num = 0;
int num2 = 0;
SimpleAttributeTableGenerator simpleAttributeTableGenerator;
simpleAttributeTableGenerator.FieldGetter(num2, num, digestOid);
simpleAttributeTableGenerator.attributes = 0;
}
// Token: 0x0600C1A7 RID: 49575 RVA: 0x002BBBBC File Offset: 0x002B9DBC
[Token(Token = "0x600C1A7")]
[Address(RVA = "0x2922330", Offset = "0x2921330", VA = "0x182922330")]
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)
{
int num = 0;
int num2 = 0;
SimpleAttributeTableGenerator simpleAttributeTableGenerator;
simpleAttributeTableGenerator.FieldGetter(num2, num, encryptionOid);
simpleAttributeTableGenerator.attributes = 0;
}
// Token: 0x0600C1A8 RID: 49576 RVA: 0x002BBBE0 File Offset: 0x002B9DE0
[Token(Token = "0x600C1A8")]
[Address(RVA = "0x2921EF0", Offset = "0x2920EF0", VA = "0x182921EF0")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
string encOid = CmsSignedDataStreamGenerator.Helper.GetEncOid(privateKey, digestOid);
}
// Token: 0x0600C1A9 RID: 49577 RVA: 0x002BBC00 File Offset: 0x002B9E00
[Token(Token = "0x600C1A9")]
[Address(RVA = "0x29226A0", Offset = "0x29216A0", VA = "0x1829226A0")]
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
DateTime notAfter = cert.NotAfter;
Asn1Object asn1Object;
TbsCertificateStructure instance = TbsCertificateStructure.GetInstance(asn1Object);
DerInteger serialNumber = instance.serialNumber;
X509Name issuer = instance.issuer;
BigInteger value = serialNumber.Value;
SignerIdentifier signerIdentifier = new SignerIdentifier(new IssuerAndSerialNumber(issuer, value));
}
// Token: 0x0600C1AA RID: 49578 RVA: 0x002BBC48 File Offset: 0x002B9E48
[Token(Token = "0x600C1AA")]
[Address(RVA = "0x2922250", Offset = "0x2921250", VA = "0x182922250")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOid)
{
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
IDictionary dictionary = Platform.CreateHashtable();
defaultSignedAttributeTableGenerator.table = dictionary;
int num = 0;
this.AddSigner(privateKey, subjectKeyID, digestOid, defaultSignedAttributeTableGenerator, num);
}
// Token: 0x0600C1AB RID: 49579 RVA: 0x002BBC78 File Offset: 0x002B9E78
[Token(Token = "0x600C1AB")]
[Address(RVA = "0x29224E0", Offset = "0x29214E0", VA = "0x1829224E0")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOid, string digestOid)
{
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
IDictionary dictionary = Platform.CreateHashtable();
defaultSignedAttributeTableGenerator.table = dictionary;
}
// Token: 0x0600C1AC RID: 49580 RVA: 0x002BBC9C File Offset: 0x002B9E9C
[Token(Token = "0x600C1AC")]
[Address(RVA = "0x2922180", Offset = "0x2921180", VA = "0x182922180")]
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)
{
int num = 0;
int num2 = 0;
SimpleAttributeTableGenerator simpleAttributeTableGenerator;
simpleAttributeTableGenerator.FieldGetter(num2, num, digestOid);
simpleAttributeTableGenerator.attributes = 0;
}
// Token: 0x0600C1AD RID: 49581 RVA: 0x002BBCC0 File Offset: 0x002B9EC0
[Token(Token = "0x600C1AD")]
[Address(RVA = "0x29225D0", Offset = "0x29215D0", VA = "0x1829225D0")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
string encOid = CmsSignedDataStreamGenerator.Helper.GetEncOid(privateKey, digestOid);
}
// Token: 0x0600C1AE RID: 49582 RVA: 0x002BBCE0 File Offset: 0x002B9EE0
[Token(Token = "0x600C1AE")]
[Address(RVA = "0x2922090", Offset = "0x2921090", VA = "0x182922090")]
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
SignerIdentifier signerIdentifier = new SignerIdentifier(new DerOctetString(subjectKeyID));
}
// Token: 0x0600C1AF RID: 49583 RVA: 0x002BBCFC File Offset: 0x002B9EFC
[Token(Token = "0x600C1AF")]
[Address(RVA = "0x29231A0", Offset = "0x29221A0", VA = "0x1829231A0")]
private void DoAddSigner(AsymmetricKeyParameter privateKey, SignerIdentifier signerIdentifier, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
{
IList signerInfs = this._signerInfs;
CmsSignedDataStreamGenerator.DigestAndSignerInfoGeneratorHolder digestAndSignerInfoGeneratorHolder;
CmsSignedDataStreamGenerator.SignerInfoGeneratorImpl signerInfoGeneratorImpl;
digestAndSignerInfoGeneratorHolder.signerInf = signerInfoGeneratorImpl;
digestAndSignerInfoGeneratorHolder.digestOID = 0;
throw new NullReferenceException();
}
// Token: 0x0600C1B0 RID: 49584 RVA: 0x002BBD24 File Offset: 0x002B9F24
[Token(Token = "0x600C1B0")]
[Address(RVA = "0x2921DB0", Offset = "0x2920DB0", VA = "0x182921DB0", Slot = "6")]
internal override void AddSignerCallback(SignerInformation si)
{
Asn1Object asn1Object = si.digestAlgorithm.ToAsn1Object();
}
// Token: 0x0600C1B1 RID: 49585 RVA: 0x002BBD44 File Offset: 0x002B9F44
[Token(Token = "0x600C1B1")]
[Address(RVA = "0x2923620", Offset = "0x2922620", VA = "0x182923620")]
public Stream Open(Stream outStream)
{
int num = 0;
int num2 = 0;
string data = CmsSignedGenerator.Data;
return this.Open(outStream, data, num2 != 0, num);
}
// Token: 0x0600C1B2 RID: 49586 RVA: 0x002BBD68 File Offset: 0x002B9F68
[Token(Token = "0x600C1B2")]
[Address(RVA = "0x2923580", Offset = "0x2922580", VA = "0x182923580")]
public Stream Open(Stream outStream, bool encapsulate)
{
int num = 0;
string data = CmsSignedGenerator.Data;
return this.Open(outStream, data, encapsulate, num);
}
// Token: 0x0600C1B3 RID: 49587 RVA: 0x002BBD88 File Offset: 0x002B9F88
[Token(Token = "0x600C1B3")]
[Address(RVA = "0x29234E0", Offset = "0x29224E0", VA = "0x1829234E0")]
public Stream Open(Stream outStream, bool encapsulate, Stream dataOutputStream)
{
string data = CmsSignedGenerator.Data;
return this.Open(outStream, data, encapsulate, dataOutputStream);
}
// Token: 0x0600C1B4 RID: 49588 RVA: 0x002BBDA8 File Offset: 0x002B9FA8
[Token(Token = "0x600C1B4")]
[Address(RVA = "0x2923DC0", Offset = "0x2922DC0", VA = "0x182923DC0")]
public Stream Open(Stream outStream, string signedContentType, bool encapsulate)
{
int num = 0;
return this.Open(outStream, signedContentType, encapsulate, num);
}
// Token: 0x0600C1B5 RID: 49589 RVA: 0x002BBDC4 File Offset: 0x002B9FC4
[Token(Token = "0x600C1B5")]
[Address(RVA = "0x29236B0", Offset = "0x29226B0", VA = "0x1829236B0")]
public Stream Open(Stream outStream, string signedContentType, bool encapsulate, Stream dataOutputStream)
{
int num;
Asn1EncodableVector asn1EncodableVector;
for (;;)
{
num = 0;
if (outStream == 0)
{
goto IL_11A;
}
if (outStream.CanSeek)
{
if (outStream != 0 && !outStream.CanSeek)
{
goto IL_126;
}
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;
}
}
}
DerNull instance;
if (asn1EncodableVector == 0 || asn1EncodableVector != 0)
{
Asn1Encodable[] array = new Asn1Encodable[1];
DerObjectIdentifier derObjectIdentifier2 = new DerObjectIdentifier(num);
instance = DerNull.Instance;
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(derObjectIdentifier2, instance);
throw new ArrayTypeMismatchException();
}
throw new NullReferenceException();
Block_5:
byte[] encoded = new DerSet(asn1EncodableVector).GetEncoded();
Asn1Object asn1Object = instance.ToAsn1Object();
Asn1Object asn1Object2 = instance.ToAsn1Object();
BerSequenceGenerator berSequenceGenerator2;
string text3 = berSequenceGenerator2.ToString();
int num2 = 0;
CmsSignedDataStreamGenerator.CmsSignedDataOutputStream cmsSignedDataOutputStream;
cmsSignedDataOutputStream.outer = asn1EncodableVector;
Stream stream;
cmsSignedDataOutputStream._out = stream;
DerObjectIdentifier derObjectIdentifier3 = new DerObjectIdentifier(num2);
cmsSignedDataOutputStream._contentOID = derObjectIdentifier3;
cmsSignedDataOutputStream._sGen = derObjectIdentifier3;
cmsSignedDataOutputStream._eiGen = berSequenceGenerator2;
IL_11A:
ArgumentNullException ex2 = new ArgumentNullException("outStream");
IL_126:
ArgumentException ex3 = new ArgumentException("Expected writeable stream", "dataOutputStream");
throw new IndexOutOfRangeException();
}
// Token: 0x0600C1B6 RID: 49590 RVA: 0x002BBF20 File Offset: 0x002BA120
[Token(Token = "0x600C1B6")]
[Address(RVA = "0x2923DE0", Offset = "0x2922DE0", VA = "0x182923DE0")]
private void RegisterDigestOid(string digestOid)
{
ISet messageDigestOids = this._messageDigestOids;
if (!this._messageDigestsLocked)
{
return;
}
throw new NullReferenceException();
}
// Token: 0x0600C1B7 RID: 49591 RVA: 0x002BBF50 File Offset: 0x002BA150
[Token(Token = "0x600C1B7")]
[Address(RVA = "0x2923000", Offset = "0x2922000", VA = "0x182923000")]
private void ConfigureDigest(string digestOid)
{
/*
An exception occurred when decompiling this method (0600C1B7)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedDataStreamGenerator::ConfigureDigest(System.String)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_45:
stloc:InvalidOperationException(var_4_4F, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Cannot configure new digests after the data stream is opened")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C1B8 RID: 49592 RVA: 0x002BBFB0 File Offset: 0x002BA1B0
[Token(Token = "0x600C1B8")]
[Address(RVA = "0x29232B0", Offset = "0x29222B0", VA = "0x1829232B0")]
internal void Generate(Stream outStream, string eContentType, bool encapsulate, Stream dataOutputStream, CmsProcessable content)
{
}
// Token: 0x0600C1B9 RID: 49593 RVA: 0x002BBFC0 File Offset: 0x002BA1C0
[Token(Token = "0x600C1B9")]
[Address(RVA = "0x29229B0", Offset = "0x29219B0", VA = "0x1829229B0")]
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: 0x0600C1BA RID: 49594 RVA: 0x002BC040 File Offset: 0x002BA240
[Token(Token = "0x600C1BA")]
[Address(RVA = "0x2922DB0", Offset = "0x2921DB0", VA = "0x182922DB0")]
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: 0x0600C1BB RID: 49595 RVA: 0x002BC0A0 File Offset: 0x002BA2A0
[Token(Token = "0x600C1BB")]
[Address(RVA = "0x2922800", Offset = "0x2921800", VA = "0x182922800")]
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: 0x0600C1BC RID: 49596 RVA: 0x002BC0CC File Offset: 0x002BA2CC
[Token(Token = "0x600C1BC")]
[Address(RVA = "0x2923370", Offset = "0x2922370", VA = "0x182923370")]
private static Stream GetSafeOutputStream(Stream s)
{
if (s == 0)
{
NullOutputStream nullOutputStream = new NullOutputStream();
}
return s;
}
// Token: 0x0600C1BD RID: 49597 RVA: 0x002BC0E4 File Offset: 0x002BA2E4
[Token(Token = "0x600C1BD")]
[Address(RVA = "0x29233C0", Offset = "0x29223C0", VA = "0x1829233C0")]
private static Stream GetSafeTeeOutputStream(Stream s1, Stream s2)
{
/*
An exception occurred when decompiling this method (0600C1BD)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.IO.Stream BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedDataStreamGenerator::GetSafeTeeOutputStream(System.IO.Stream,System.IO.Stream)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_2:
stloc:NullOutputStream(var_1_1B, newobj:NullOutputStream(NullOutputStream::.ctor))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x04007A8C RID: 31372
[Token(Token = "0x4007A8C")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x04007A8D RID: 31373
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007A8D")]
private readonly IList _signerInfs;
// Token: 0x04007A8E RID: 31374
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007A8E")]
private readonly ISet _messageDigestOids;
// Token: 0x04007A8F RID: 31375
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x4007A8F")]
private readonly IDictionary _messageDigests;
// Token: 0x04007A90 RID: 31376
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x4007A90")]
private readonly IDictionary _messageHashes;
// Token: 0x04007A91 RID: 31377
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x4007A91")]
private bool _messageDigestsLocked;
// Token: 0x04007A92 RID: 31378
[FieldOffset(Offset = "0x64")]
[Token(Token = "0x4007A92")]
private int _bufferSize;
// Token: 0x02001E29 RID: 7721
[Token(Token = "0x2001E29")]
private class DigestAndSignerInfoGeneratorHolder
{
// Token: 0x0600C1BF RID: 49599 RVA: 0x002BC124 File Offset: 0x002BA324
[Token(Token = "0x600C1BF")]
[Address(RVA = "0x417DD0", Offset = "0x416DD0", VA = "0x180417DD0")]
internal DigestAndSignerInfoGeneratorHolder(ISignerInfoGenerator signerInf, string digestOID)
{
this.signerInf = signerInf;
this.digestOID = digestOID;
}
// Token: 0x17001E09 RID: 7689
// (get) Token: 0x0600C1C0 RID: 49600 RVA: 0x002BC148 File Offset: 0x002BA348
[Token(Token = "0x17001E09")]
internal AlgorithmIdentifier DigestAlgorithm
{
[Token(Token = "0x600C1C0")]
[Address(RVA = "0x292C4B0", Offset = "0x292B4B0", VA = "0x18292C4B0")]
get
{
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(this.digestOID);
DerNull instance = DerNull.Instance;
return new AlgorithmIdentifier(derObjectIdentifier, instance);
}
}
// Token: 0x04007A93 RID: 31379
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A93")]
internal readonly ISignerInfoGenerator signerInf;
// Token: 0x04007A94 RID: 31380
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007A94")]
internal readonly string digestOID;
}
// Token: 0x02001E2A RID: 7722
[Token(Token = "0x2001E2A")]
private class SignerInfoGeneratorImpl : ISignerInfoGenerator
{
// Token: 0x0600C1C1 RID: 49601 RVA: 0x002BC170 File Offset: 0x002BA370
[Token(Token = "0x600C1C1")]
[Address(RVA = "0x29356F0", Offset = "0x29346F0", VA = "0x1829356F0")]
internal SignerInfoGeneratorImpl(CmsSignedDataStreamGenerator outer, AsymmetricKeyParameter key, SignerIdentifier signerIdentifier, string digestOID, string encOID, CmsAttributeTableGenerator sAttr, CmsAttributeTableGenerator unsAttr)
{
/*
An exception occurred when decompiling this method (0600C1C1)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedDataStreamGenerator/SignerInfoGeneratorImpl::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedDataStreamGenerator,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter,BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.SignerIdentifier,System.String,System.String,BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsAttributeTableGenerator,BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsAttributeTableGenerator)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_E3:
stloc:SignatureException(var_12_EA, newobj:SignatureException(SignatureException::.ctor, ldloc:string(var_11)))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C1C2 RID: 49602 RVA: 0x002BC268 File Offset: 0x002BA468
[Token(Token = "0x600C1C2")]
[Address(RVA = "0x29350B0", Offset = "0x29340B0", VA = "0x1829350B0", 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: 0x04007A95 RID: 31381
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007A95")]
private readonly CmsSignedDataStreamGenerator outer;
// Token: 0x04007A96 RID: 31382
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007A96")]
private readonly SignerIdentifier _signerIdentifier;
// Token: 0x04007A97 RID: 31383
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007A97")]
private readonly string _digestOID;
// Token: 0x04007A98 RID: 31384
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007A98")]
private readonly string _encOID;
// Token: 0x04007A99 RID: 31385
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007A99")]
private readonly CmsAttributeTableGenerator _sAttr;
// Token: 0x04007A9A RID: 31386
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007A9A")]
private readonly CmsAttributeTableGenerator _unsAttr;
// Token: 0x04007A9B RID: 31387
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007A9B")]
private readonly string _encName;
// Token: 0x04007A9C RID: 31388
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007A9C")]
private readonly ISigner _sig;
}
// Token: 0x02001E2B RID: 7723
[Token(Token = "0x2001E2B")]
private class CmsSignedDataOutputStream : BaseOutputStream
{
// Token: 0x0600C1C3 RID: 49603 RVA: 0x002BC40C File Offset: 0x002BA60C
[Token(Token = "0x600C1C3")]
[Address(RVA = "0x2921B50", Offset = "0x2920B50", VA = "0x182921B50")]
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: 0x0600C1C4 RID: 49604 RVA: 0x002BC450 File Offset: 0x002BA650
[Token(Token = "0x600C1C4")]
[Address(RVA = "0x21448C0", Offset = "0x21438C0", VA = "0x1821448C0", Slot = "30")]
public override void WriteByte(byte b)
{
bool canRead = this._out.CanRead;
}
// Token: 0x0600C1C5 RID: 49605 RVA: 0x002BC470 File Offset: 0x002BA670
[Token(Token = "0x600C1C5")]
[Address(RVA = "0x21448F0", Offset = "0x21438F0", VA = "0x1821448F0", Slot = "29")]
public override void Write(byte[] bytes, int off, int len)
{
bool canRead = this._out.CanRead;
}
// Token: 0x0600C1C6 RID: 49606 RVA: 0x002BC490 File Offset: 0x002BA690
[Token(Token = "0x600C1C6")]
[Address(RVA = "0x2921060", Offset = "0x2920060", VA = "0x182921060", Slot = "15")]
public override void Close()
{
this.DoClose();
base.Close();
}
// Token: 0x0600C1C7 RID: 49607 RVA: 0x002BC4AC File Offset: 0x002BA6AC
[Token(Token = "0x600C1C7")]
[Address(RVA = "0x2921080", Offset = "0x2920080", VA = "0x182921080")]
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: 0x0600C1C8 RID: 49608 RVA: 0x002BC6F4 File Offset: 0x002BA8F4
[Token(Token = "0x600C1C8")]
[Address(RVA = "0x2921AD0", Offset = "0x2920AD0", VA = "0x182921AD0")]
private static void WriteToGenerator(Asn1Generator ag, Asn1Encodable ae)
{
byte[] encoded = ae.GetEncoded();
}
// Token: 0x04007A9D RID: 31389
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007A9D")]
private readonly CmsSignedDataStreamGenerator outer;
// Token: 0x04007A9E RID: 31390
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007A9E")]
private Stream _out;
// Token: 0x04007A9F RID: 31391
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007A9F")]
private DerObjectIdentifier _contentOID;
// Token: 0x04007AA0 RID: 31392
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007AA0")]
private BerSequenceGenerator _sGen;
// Token: 0x04007AA1 RID: 31393
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x4007AA1")]
private BerSequenceGenerator _sigGen;
// Token: 0x04007AA2 RID: 31394
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x4007AA2")]
private BerSequenceGenerator _eiGen;
}
}
}
@@ -0,0 +1,379 @@
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: 0x02001E2D RID: 7725
[Token(Token = "0x2001E2D")]
public class CmsSignedGenerator
{
// Token: 0x0600C1CD RID: 49613 RVA: 0x002BCA9C File Offset: 0x002BAC9C
[Token(Token = "0x600C1CD")]
[Address(RVA = "0x2924FA0", Offset = "0x2923FA0", VA = "0x182924FA0")]
protected CmsSignedGenerator()
{
SecureRandom secureRandom = new SecureRandom();
}
// Token: 0x0600C1CE RID: 49614 RVA: 0x002BCAB0 File Offset: 0x002BACB0
[Token(Token = "0x600C1CE")]
[Address(RVA = "0x2924F10", Offset = "0x2923F10", VA = "0x182924F10")]
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: 0x0600C1CF RID: 49615 RVA: 0x002BCB14 File Offset: 0x002BAD14
[Token(Token = "0x600C1CF")]
[Address(RVA = "0x29247B0", Offset = "0x29237B0", VA = "0x1829247B0", Slot = "4")]
protected internal virtual IDictionary GetBaseParameters(DerObjectIdentifier contentType, AlgorithmIdentifier digAlgId, byte[] hash)
{
IDictionary dictionary = Platform.CreateHashtable();
if (contentType != 0)
{
}
return dictionary;
}
// Token: 0x0600C1D0 RID: 49616 RVA: 0x002BCB34 File Offset: 0x002BAD34
[Token(Token = "0x600C1D0")]
[Address(RVA = "0x2924740", Offset = "0x2923740", VA = "0x182924740", Slot = "5")]
protected internal virtual Asn1Set GetAttributeSet(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attr)
{
/*
An exception occurred when decompiling this method (0600C1D0)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Asn1Set BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedGenerator::GetAttributeSet(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_06:
stloc:DerSet(var_1_11, newobj:DerSet(DerSet::.ctor, call:Asn1EncodableVector(AttributeTable::ToAsn1EncodableVector, ldloc:AttributeTable(attr))))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C1D1 RID: 49617 RVA: 0x002BCB54 File Offset: 0x002BAD54
[Token(Token = "0x600C1D1")]
[Address(RVA = "0x2924410", Offset = "0x2923410", VA = "0x182924410")]
public void AddCertificates(IX509Store certStore)
{
IList certs = this._certs;
IList certificatesFromStore = CmsUtilities.GetCertificatesFromStore(certStore);
CollectionUtilities.AddRange(certs, certificatesFromStore);
}
// Token: 0x0600C1D2 RID: 49618 RVA: 0x002BCB78 File Offset: 0x002BAD78
[Token(Token = "0x600C1D2")]
[Address(RVA = "0x2924440", Offset = "0x2923440", VA = "0x182924440")]
public void AddCrls(IX509Store crlStore)
{
IList crls = this._crls;
IList crlsFromStore = CmsUtilities.GetCrlsFromStore(crlStore);
CollectionUtilities.AddRange(crls, crlsFromStore);
}
// Token: 0x0600C1D3 RID: 49619 RVA: 0x002BCB9C File Offset: 0x002BAD9C
[Token(Token = "0x600C1D3")]
[Address(RVA = "0x29240C0", Offset = "0x29230C0", VA = "0x1829240C0")]
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: 0x0600C1D4 RID: 49620 RVA: 0x002BCC48 File Offset: 0x002BAE48
[Token(Token = "0x600C1D4")]
[Address(RVA = "0x2924470", Offset = "0x2923470", VA = "0x182924470")]
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: 0x0600C1D5 RID: 49621 RVA: 0x002BCCBC File Offset: 0x002BAEBC
[Token(Token = "0x600C1D5")]
[Address(RVA = "0x2924900", Offset = "0x2923900", VA = "0x182924900")]
public IDictionary GetGeneratedDigests()
{
return Platform.CreateHashtable(this._digests);
}
// Token: 0x17001E0A RID: 7690
// (get) Token: 0x0600C1D6 RID: 49622 RVA: 0x002BCCD4 File Offset: 0x002BAED4
// (set) Token: 0x0600C1D7 RID: 49623 RVA: 0x002BCCE8 File Offset: 0x002BAEE8
[Token(Token = "0x17001E0A")]
public bool UseDerForCerts
{
[Token(Token = "0x600C1D6")]
[Address(RVA = "0x5AB2E0", Offset = "0x5AA2E0", VA = "0x1805AB2E0")]
get
{
return this._useDerForCerts;
}
[Token(Token = "0x600C1D7")]
[Address(RVA = "0x5AB400", Offset = "0x5AA400", VA = "0x1805AB400")]
set
{
this._useDerForCerts = value;
}
}
// Token: 0x17001E0B RID: 7691
// (get) Token: 0x0600C1D8 RID: 49624 RVA: 0x002BCCFC File Offset: 0x002BAEFC
// (set) Token: 0x0600C1D9 RID: 49625 RVA: 0x002BCD10 File Offset: 0x002BAF10
[Token(Token = "0x17001E0B")]
public bool UseDerForCrls
{
[Token(Token = "0x600C1D8")]
[Address(RVA = "0x8920D0", Offset = "0x8910D0", VA = "0x1808920D0")]
get
{
return this._useDerForCrls;
}
[Token(Token = "0x600C1D9")]
[Address(RVA = "0xCA2F10", Offset = "0xCA1F10", VA = "0x180CA2F10")]
set
{
this._useDerForCrls = value;
}
}
// Token: 0x0600C1DA RID: 49626 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600C1DA")]
[Address(RVA = "0x4242D0", Offset = "0x4232D0", VA = "0x1804242D0", Slot = "6")]
internal virtual void AddSignerCallback(SignerInformation si)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600C1DB RID: 49627 RVA: 0x002BCD24 File Offset: 0x002BAF24
[Token(Token = "0x600C1DB")]
[Address(RVA = "0x2924960", Offset = "0x2923960", VA = "0x182924960")]
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: 0x0600C1DC RID: 49628 RVA: 0x002BCD6C File Offset: 0x002BAF6C
[Token(Token = "0x600C1DC")]
[Address(RVA = "0x2924A50", Offset = "0x2923A50", VA = "0x182924A50")]
internal static SignerIdentifier GetSignerIdentifier(byte[] subjectKeyIdentifier)
{
return new SignerIdentifier(new DerOctetString(subjectKeyIdentifier));
}
// Token: 0x04007AA5 RID: 31397
[Token(Token = "0x4007AA5")]
public static readonly string Data = CmsObjectIdentifiers.Data.identifier;
// Token: 0x04007AA6 RID: 31398
[Token(Token = "0x4007AA6")]
public static readonly string DigestSha1 = OiwObjectIdentifiers.IdSha1.identifier;
// Token: 0x04007AA7 RID: 31399
[Token(Token = "0x4007AA7")]
public static readonly string DigestSha224 = NistObjectIdentifiers.IdSha224.identifier;
// Token: 0x04007AA8 RID: 31400
[Token(Token = "0x4007AA8")]
public static readonly string DigestSha256 = NistObjectIdentifiers.IdSha256.identifier;
// Token: 0x04007AA9 RID: 31401
[Token(Token = "0x4007AA9")]
public static readonly string DigestSha384 = NistObjectIdentifiers.IdSha384.identifier;
// Token: 0x04007AAA RID: 31402
[Token(Token = "0x4007AAA")]
public static readonly string DigestSha512 = NistObjectIdentifiers.IdSha512.identifier;
// Token: 0x04007AAB RID: 31403
[Token(Token = "0x4007AAB")]
public static readonly string DigestMD5 = PkcsObjectIdentifiers.MD5.identifier;
// Token: 0x04007AAC RID: 31404
[Token(Token = "0x4007AAC")]
public static readonly string DigestGost3411 = CryptoProObjectIdentifiers.GostR3411.identifier;
// Token: 0x04007AAD RID: 31405
[Token(Token = "0x4007AAD")]
public static readonly string DigestRipeMD128 = TeleTrusTObjectIdentifiers.RipeMD128.identifier;
// Token: 0x04007AAE RID: 31406
[Token(Token = "0x4007AAE")]
public static readonly string DigestRipeMD160 = TeleTrusTObjectIdentifiers.RipeMD160.identifier;
// Token: 0x04007AAF RID: 31407
[Token(Token = "0x4007AAF")]
public static readonly string DigestRipeMD256 = TeleTrusTObjectIdentifiers.RipeMD256.identifier;
// Token: 0x04007AB0 RID: 31408
[Token(Token = "0x4007AB0")]
public static readonly string EncryptionRsa = PkcsObjectIdentifiers.RsaEncryption.identifier;
// Token: 0x04007AB1 RID: 31409
[Token(Token = "0x4007AB1")]
public static readonly string EncryptionDsa = X9ObjectIdentifiers.IdDsaWithSha1.identifier;
// Token: 0x04007AB2 RID: 31410
[Token(Token = "0x4007AB2")]
public static readonly string EncryptionECDsa = X9ObjectIdentifiers.ECDsaWithSha1.identifier;
// Token: 0x04007AB3 RID: 31411
[Token(Token = "0x4007AB3")]
public static readonly string EncryptionRsaPss = PkcsObjectIdentifiers.IdRsassaPss.identifier;
// Token: 0x04007AB4 RID: 31412
[Token(Token = "0x4007AB4")]
public static readonly string EncryptionGost3410 = CryptoProObjectIdentifiers.GostR3410x94.identifier;
// Token: 0x04007AB5 RID: 31413
[Token(Token = "0x4007AB5")]
public static readonly string EncryptionECGost3410 = CryptoProObjectIdentifiers.GostR3410x2001.identifier;
// Token: 0x04007AB6 RID: 31414
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007AB6")]
internal IList _certs;
// Token: 0x04007AB7 RID: 31415
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007AB7")]
internal IList _crls;
// Token: 0x04007AB8 RID: 31416
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007AB8")]
internal IList _signers;
// Token: 0x04007AB9 RID: 31417
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007AB9")]
internal IDictionary _digests;
// Token: 0x04007ABA RID: 31418
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007ABA")]
internal bool _useDerForCerts;
// Token: 0x04007ABB RID: 31419
[FieldOffset(Offset = "0x31")]
[Token(Token = "0x4007ABB")]
internal bool _useDerForCrls;
// Token: 0x04007ABC RID: 31420
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007ABC")]
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: 0x02001E2E RID: 7726
[Token(Token = "0x2001E2E")]
internal class CmsSignedHelper
{
// Token: 0x0600C1DE RID: 49630 RVA: 0x002BCE98 File Offset: 0x002BB098
[Token(Token = "0x600C1DE")]
[Address(RVA = "0x2925470", Offset = "0x2924470", VA = "0x182925470")]
private static void AddEntries(DerObjectIdentifier oid, string digest, string encryption)
{
IDictionary dictionary = CmsSignedHelper.digestAlgs;
IDictionary dictionary2 = CmsSignedHelper.encryptionAlgs;
}
// Token: 0x0600C1DF RID: 49631 RVA: 0x002BCEB8 File Offset: 0x002BB0B8
[Token(Token = "0x600C1DF")]
[Address(RVA = "0x2926760", Offset = "0x2925760", VA = "0x182926760")]
static CmsSignedHelper()
{
/*
An exception occurred when decompiling this method (0600C1DF)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedHelper::.cctor()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_4D1:
stelem:string([mscorlib]System.String, ldloc:string[](var_77_4C7), ldc.i4:int32(0), ldstr:string("SHA-512"))
stloc:ISet(var_78_4E3, ldsfld:ISet(CmsSignedHelper::noParams))
stloc:ISet(var_79_4EA, ldsfld:ISet(CmsSignedHelper::noParams))
stloc:ISet(var_80_4F1, ldsfld:ISet(CmsSignedHelper::noParams))
stloc:ISet(var_81_4F8, ldsfld:ISet(CmsSignedHelper::noParams))
stloc:ISet(var_82_4FF, ldsfld:ISet(CmsSignedHelper::noParams))
stloc:ISet(var_83_506, ldsfld:ISet(CmsSignedHelper::noParams))
stloc:IDictionary(var_84_50D, ldsfld:IDictionary(CmsSignedHelper::ecAlgorithms))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C1E0 RID: 49632 RVA: 0x002BD3D4 File Offset: 0x002BB5D4
[Token(Token = "0x600C1E0")]
[Address(RVA = "0x2925BA0", Offset = "0x2924BA0", VA = "0x182925BA0")]
internal string GetDigestAlgName(string digestAlgOid)
{
IDictionary dictionary = CmsSignedHelper.digestAlgs;
return digestAlgOid;
}
// Token: 0x0600C1E1 RID: 49633 RVA: 0x002BD3F0 File Offset: 0x002BB5F0
[Token(Token = "0x600C1E1")]
[Address(RVA = "0x2925E60", Offset = "0x2924E60", VA = "0x182925E60")]
internal AlgorithmIdentifier GetEncAlgorithmIdentifier(DerObjectIdentifier encOid, Asn1Encodable sigX509Parameters)
{
ISet set = CmsSignedHelper.noParams;
return new AlgorithmIdentifier(encOid, sigX509Parameters);
}
// Token: 0x0600C1E2 RID: 49634 RVA: 0x002BD418 File Offset: 0x002BB618
[Token(Token = "0x600C1E2")]
[Address(RVA = "0x2925C50", Offset = "0x2924C50", VA = "0x182925C50")]
internal string[] GetDigestAliases(string algName)
{
IDictionary dictionary = CmsSignedHelper.digestAliases;
throw new NullReferenceException();
}
// Token: 0x0600C1E3 RID: 49635 RVA: 0x002BD430 File Offset: 0x002BB630
[Token(Token = "0x600C1E3")]
[Address(RVA = "0x2926650", Offset = "0x2925650", VA = "0x182926650")]
internal string GetEncryptionAlgName(string encryptionAlgOid)
{
IDictionary dictionary = CmsSignedHelper.encryptionAlgs;
return encryptionAlgOid;
}
// Token: 0x0600C1E4 RID: 49636 RVA: 0x002BD44C File Offset: 0x002BB64C
[Token(Token = "0x600C1E4")]
[Address(RVA = "0x2925D50", Offset = "0x2924D50", VA = "0x182925D50")]
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: 0x0600C1E5 RID: 49637 RVA: 0x002BD480 File Offset: 0x002BB680
[Token(Token = "0x600C1E5")]
[Address(RVA = "0x2926700", Offset = "0x2925700", VA = "0x182926700")]
internal ISigner GetSignatureInstance(string algorithm)
{
return SignerUtilities.GetSigner(algorithm);
}
// Token: 0x0600C1E6 RID: 49638 RVA: 0x002BD494 File Offset: 0x002BB694
[Token(Token = "0x600C1E6")]
[Address(RVA = "0x2925550", Offset = "0x2924550", VA = "0x182925550")]
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: 0x0600C1E7 RID: 49639 RVA: 0x002BD534 File Offset: 0x002BB734
[Token(Token = "0x600C1E7")]
[Address(RVA = "0x2925880", Offset = "0x2924880", VA = "0x182925880")]
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: 0x0600C1E8 RID: 49640 RVA: 0x002BD580 File Offset: 0x002BB780
[Token(Token = "0x600C1E8")]
[Address(RVA = "0x29259A0", Offset = "0x29249A0", VA = "0x1829259A0")]
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: 0x0600C1E9 RID: 49641 RVA: 0x002BD5CC File Offset: 0x002BB7CC
[Token(Token = "0x600C1E9")]
[Address(RVA = "0x2925000", Offset = "0x2924000", VA = "0x182925000")]
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: 0x0600C1EA RID: 49642 RVA: 0x002BD624 File Offset: 0x002BB824
[Token(Token = "0x600C1EA")]
[Address(RVA = "0x2925250", Offset = "0x2924250", VA = "0x182925250")]
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: 0x0600C1EB RID: 49643 RVA: 0x002BD678 File Offset: 0x002BB878
[Token(Token = "0x600C1EB")]
[Address(RVA = "0x2925AC0", Offset = "0x2924AC0", VA = "0x182925AC0")]
internal AlgorithmIdentifier FixAlgID(AlgorithmIdentifier algId)
{
if (algId.ObjectID != 0)
{
return algId;
}
Asn1Object asn1Object = algId.ToAsn1Object();
AlgorithmIdentifier algorithmIdentifier;
return algorithmIdentifier;
}
// Token: 0x0600C1EC RID: 49644 RVA: 0x002BD6A0 File Offset: 0x002BB8A0
[Token(Token = "0x600C1EC")]
[Address(RVA = "0x2925F50", Offset = "0x2924F50", VA = "0x182925F50")]
internal string GetEncOid(AsymmetricKeyParameter key, string digestOID)
{
/*
An exception occurred when decompiling this method (0600C1EC)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.String BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedHelper::GetEncOid(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter,System.String)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_E8:
stloc:ArgumentException(var_21_F2, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Unknown algorithm in CmsSignedGenerator.GetEncOid")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C1ED RID: 49645 RVA: 0x002BD7A0 File Offset: 0x002BB9A0
[Token(Token = "0x600C1ED")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public CmsSignedHelper()
{
}
// Token: 0x04007ABD RID: 31421
[Token(Token = "0x4007ABD")]
internal static readonly CmsSignedHelper Instance;
// Token: 0x04007ABE RID: 31422
[Token(Token = "0x4007ABE")]
private static readonly string EncryptionECDsaWithSha1;
// Token: 0x04007ABF RID: 31423
[Token(Token = "0x4007ABF")]
private static readonly string EncryptionECDsaWithSha224;
// Token: 0x04007AC0 RID: 31424
[Token(Token = "0x4007AC0")]
private static readonly string EncryptionECDsaWithSha256;
// Token: 0x04007AC1 RID: 31425
[Token(Token = "0x4007AC1")]
private static readonly string EncryptionECDsaWithSha384;
// Token: 0x04007AC2 RID: 31426
[Token(Token = "0x4007AC2")]
private static readonly string EncryptionECDsaWithSha512;
// Token: 0x04007AC3 RID: 31427
[Token(Token = "0x4007AC3")]
private static readonly IDictionary encryptionAlgs;
// Token: 0x04007AC4 RID: 31428
[Token(Token = "0x4007AC4")]
private static readonly IDictionary digestAlgs;
// Token: 0x04007AC5 RID: 31429
[Token(Token = "0x4007AC5")]
private static readonly IDictionary digestAliases;
// Token: 0x04007AC6 RID: 31430
[Token(Token = "0x4007AC6")]
private static readonly ISet noParams;
// Token: 0x04007AC7 RID: 31431
[Token(Token = "0x4007AC7")]
private static readonly IDictionary ecAlgorithms;
}
}
@@ -0,0 +1,35 @@
using System;
using System.IO;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001E2F RID: 7727
[Token(Token = "0x2001E2F")]
[Serializable]
public class CmsStreamException : IOException
{
// Token: 0x0600C1EE RID: 49646 RVA: 0x002BD7B4 File Offset: 0x002BB9B4
[Token(Token = "0x600C1EE")]
[Address(RVA = "0x4F0D50", Offset = "0x4EFD50", VA = "0x1804F0D50")]
public CmsStreamException()
{
}
// Token: 0x0600C1EF RID: 49647 RVA: 0x002BD7C8 File Offset: 0x002BB9C8
[Token(Token = "0x600C1EF")]
[Address(RVA = "0x4F0D40", Offset = "0x4EFD40", VA = "0x1804F0D40")]
public CmsStreamException(string name)
: base(name)
{
}
// Token: 0x0600C1F0 RID: 49648 RVA: 0x002BD7DC File Offset: 0x002BB9DC
[Token(Token = "0x600C1F0")]
[Address(RVA = "0x4A7900", Offset = "0x4A6900", VA = "0x1804A7900")]
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: 0x02001E30 RID: 7728
[Token(Token = "0x2001E30")]
public class CmsTypedStream
{
// Token: 0x0600C1F1 RID: 49649 RVA: 0x002BD7F4 File Offset: 0x002BB9F4
[Token(Token = "0x600C1F1")]
[Address(RVA = "0x2927DE0", Offset = "0x2926DE0", VA = "0x182927DE0")]
public CmsTypedStream(Stream inStream)
{
string identifier = PkcsObjectIdentifiers.Data.identifier;
}
// Token: 0x0600C1F2 RID: 49650 RVA: 0x002BD814 File Offset: 0x002BBA14
[Token(Token = "0x600C1F2")]
[Address(RVA = "0x2927D20", Offset = "0x2926D20", VA = "0x182927D20")]
public CmsTypedStream(string oid, Stream inStream)
{
}
// Token: 0x0600C1F3 RID: 49651 RVA: 0x002BD824 File Offset: 0x002BBA24
[Token(Token = "0x600C1F3")]
[Address(RVA = "0x2927D40", Offset = "0x2926D40", VA = "0x182927D40")]
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: 0x17001E0C RID: 7692
// (get) Token: 0x0600C1F4 RID: 49652 RVA: 0x002BD854 File Offset: 0x002BBA54
[Token(Token = "0x17001E0C")]
public string ContentType
{
[Token(Token = "0x600C1F4")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530")]
get
{
return this._oid;
}
}
// Token: 0x17001E0D RID: 7693
// (get) Token: 0x0600C1F5 RID: 49653 RVA: 0x002BD868 File Offset: 0x002BBA68
[Token(Token = "0x17001E0D")]
public Stream ContentStream
{
[Token(Token = "0x600C1F5")]
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0")]
get
{
return this._in;
}
}
// Token: 0x0600C1F6 RID: 49654 RVA: 0x002BD87C File Offset: 0x002BBA7C
[Token(Token = "0x600C1F6")]
[Address(RVA = "0x2927CC0", Offset = "0x2926CC0", VA = "0x182927CC0")]
public void Drain()
{
Streams.Drain(this._in);
Platform.Dispose(this._in);
}
// Token: 0x04007AC8 RID: 31432
[Token(Token = "0x4007AC8")]
private const int BufferSize = 32768;
// Token: 0x04007AC9 RID: 31433
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007AC9")]
private readonly string _oid;
// Token: 0x04007ACA RID: 31434
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007ACA")]
private readonly Stream _in;
// Token: 0x02001E31 RID: 7729
[Token(Token = "0x2001E31")]
private class FullReaderStream : FilterStream
{
// Token: 0x0600C1F7 RID: 49655 RVA: 0x002BD8A0 File Offset: 0x002BBAA0
[Token(Token = "0x600C1F7")]
[Address(RVA = "0x23AF250", Offset = "0x23AE250", VA = "0x1823AF250")]
internal FullReaderStream(Stream input)
: base(input)
{
}
// Token: 0x0600C1F8 RID: 49656 RVA: 0x002BD8B4 File Offset: 0x002BBAB4
[Token(Token = "0x600C1F8")]
[Address(RVA = "0x292DAF0", Offset = "0x292CAF0", VA = "0x18292DAF0", 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: 0x02001E32 RID: 7730
[Token(Token = "0x2001E32")]
internal class CmsUtilities
{
// Token: 0x17001E0E RID: 7694
// (get) Token: 0x0600C1F9 RID: 49657 RVA: 0x002BD8D0 File Offset: 0x002BBAD0
[Token(Token = "0x17001E0E")]
internal static int MaximumMemory
{
[Token(Token = "0x600C1F9")]
[Address(RVA = "0x2928DC0", Offset = "0x2927DC0", VA = "0x182928DC0")]
get
{
return int.MaxValue;
}
}
// Token: 0x0600C1FA RID: 49658 RVA: 0x002BD8E4 File Offset: 0x002BBAE4
[Token(Token = "0x600C1FA")]
[Address(RVA = "0x2928BD0", Offset = "0x2927BD0", VA = "0x182928BD0")]
internal static ContentInfo ReadContentInfo(byte[] input)
{
return CmsUtilities.ReadContentInfo(new Asn1InputStream(input));
}
// Token: 0x0600C1FB RID: 49659 RVA: 0x002BD8FC File Offset: 0x002BBAFC
[Token(Token = "0x600C1FB")]
[Address(RVA = "0x2928C30", Offset = "0x2927C30", VA = "0x182928C30")]
internal static ContentInfo ReadContentInfo(Stream input)
{
return CmsUtilities.ReadContentInfo(new Asn1InputStream(input, int.MaxValue));
}
// Token: 0x0600C1FC RID: 49660 RVA: 0x002BD91C File Offset: 0x002BBB1C
[Token(Token = "0x600C1FC")]
[Address(RVA = "0x2928C90", Offset = "0x2927C90", VA = "0x182928C90")]
private static ContentInfo ReadContentInfo(Asn1InputStream aIn)
{
return ContentInfo.GetInstance(aIn.ReadObject());
}
// Token: 0x0600C1FD RID: 49661 RVA: 0x002BD93C File Offset: 0x002BBB3C
[Token(Token = "0x600C1FD")]
[Address(RVA = "0x2928DA0", Offset = "0x2927DA0", VA = "0x182928DA0")]
public static byte[] StreamToByteArray(Stream inStream)
{
return Streams.ReadAll(inStream);
}
// Token: 0x0600C1FE RID: 49662 RVA: 0x002BD950 File Offset: 0x002BBB50
[Token(Token = "0x600C1FE")]
[Address(RVA = "0x2928DB0", Offset = "0x2927DB0", VA = "0x182928DB0")]
public static byte[] StreamToByteArray(Stream inStream, int limit)
{
return Streams.ReadAllLimited(inStream, limit);
}
// Token: 0x0600C1FF RID: 49663 RVA: 0x002BD964 File Offset: 0x002BBB64
[Token(Token = "0x600C1FF")]
[Address(RVA = "0x2928480", Offset = "0x2927480", VA = "0x182928480")]
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: 0x0600C200 RID: 49664 RVA: 0x002BD9E4 File Offset: 0x002BBBE4
[Token(Token = "0x600C200")]
[Address(RVA = "0x29287B0", Offset = "0x29277B0", VA = "0x1829287B0")]
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: 0x0600C201 RID: 49665 RVA: 0x002BDA64 File Offset: 0x002BBC64
[Token(Token = "0x600C201")]
[Address(RVA = "0x2927F20", Offset = "0x2926F20", VA = "0x182927F20")]
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: 0x0600C202 RID: 49666 RVA: 0x002BDAE8 File Offset: 0x002BBCE8
[Token(Token = "0x600C202")]
[Address(RVA = "0x29281D0", Offset = "0x29271D0", VA = "0x1829281D0")]
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: 0x0600C203 RID: 49667 RVA: 0x002BDB6C File Offset: 0x002BBD6C
[Token(Token = "0x600C203")]
[Address(RVA = "0x2927E80", Offset = "0x2926E80", VA = "0x182927E80")]
internal static Stream CreateBerOctetOutputStream(Stream s, int tagNo, bool isExplicit, int bufferSize)
{
return new BerOctetStringGenerator(s, tagNo, isExplicit).GetOctetOutputStream(bufferSize);
}
// Token: 0x0600C204 RID: 49668 RVA: 0x002BDB90 File Offset: 0x002BBD90
[Token(Token = "0x600C204")]
[Address(RVA = "0x2928B90", Offset = "0x2927B90", VA = "0x182928B90")]
internal static TbsCertificateStructure GetTbsCertificateStructure(X509Certificate cert)
{
DateTime notAfter = cert.NotAfter;
Asn1Object asn1Object;
return TbsCertificateStructure.GetInstance(asn1Object);
}
// Token: 0x0600C205 RID: 49669 RVA: 0x002BDBB0 File Offset: 0x002BBDB0
[Token(Token = "0x600C205")]
[Address(RVA = "0x2928AE0", Offset = "0x2927AE0", VA = "0x182928AE0")]
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: 0x0600C206 RID: 49670 RVA: 0x002BDBF4 File Offset: 0x002BBDF4
[Token(Token = "0x600C206")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
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: 0x02001E33 RID: 7731
[Token(Token = "0x2001E33")]
internal class CounterSignatureDigestCalculator : IDigestCalculator
{
// Token: 0x0600C207 RID: 49671 RVA: 0x002BDC08 File Offset: 0x002BBE08
[Token(Token = "0x600C207")]
[Address(RVA = "0x417DD0", Offset = "0x416DD0", VA = "0x180417DD0")]
internal CounterSignatureDigestCalculator(string alg, byte[] data)
{
this.alg = alg;
this.data = data;
}
// Token: 0x0600C208 RID: 49672 RVA: 0x002BDC2C File Offset: 0x002BBE2C
[Token(Token = "0x600C208")]
[Address(RVA = "0x2928DD0", Offset = "0x2927DD0", VA = "0x182928DD0", 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: 0x04007ACB RID: 31435
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007ACB")]
private readonly string alg;
// Token: 0x04007ACC RID: 31436
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007ACC")]
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: 0x02001E34 RID: 7732
[Token(Token = "0x2001E34")]
public class DefaultAuthenticatedAttributeTableGenerator : CmsAttributeTableGenerator
{
// Token: 0x0600C209 RID: 49673 RVA: 0x002BDC64 File Offset: 0x002BBE64
[Token(Token = "0x600C209")]
[Address(RVA = "0x292A9A0", Offset = "0x29299A0", VA = "0x18292A9A0")]
public DefaultAuthenticatedAttributeTableGenerator()
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
}
// Token: 0x0600C20A RID: 49674 RVA: 0x002BDC88 File Offset: 0x002BBE88
[Token(Token = "0x600C20A")]
[Address(RVA = "0x292A910", Offset = "0x2929910", VA = "0x18292A910")]
public DefaultAuthenticatedAttributeTableGenerator(AttributeTable attributeTable)
{
if (attributeTable == 0)
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
return;
}
IDictionary dictionary2 = attributeTable.ToDictionary();
this.table = dictionary2;
}
// Token: 0x0600C20B RID: 49675 RVA: 0x002BDCC0 File Offset: 0x002BBEC0
[Token(Token = "0x600C20B")]
[Address(RVA = "0x292A520", Offset = "0x2929520", VA = "0x18292A520", 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: 0x0600C20C RID: 49676 RVA: 0x002BDD34 File Offset: 0x002BBF34
[Token(Token = "0x600C20C")]
[Address(RVA = "0x292A8A0", Offset = "0x29298A0", VA = "0x18292A8A0", Slot = "6")]
public virtual AttributeTable GetAttributes(IDictionary parameters)
{
AttributeTable attributes = this.GetAttributes(parameters);
AttributeTable attributeTable;
return attributeTable;
}
// Token: 0x04007ACD RID: 31437
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007ACD")]
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: 0x02001E2C RID: 7724
[Token(Token = "0x2001E2C")]
public class DefaultDigestAlgorithmIdentifierFinder
{
// Token: 0x0600C1C9 RID: 49609 RVA: 0x002BC710 File Offset: 0x002BA910
[Token(Token = "0x600C1C9")]
[Address(RVA = "0x292AA00", Offset = "0x2929A00", VA = "0x18292AA00")]
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: 0x0600C1CA RID: 49610 RVA: 0x002BCA08 File Offset: 0x002BAC08
[Token(Token = "0x600C1CA")]
[Address(RVA = "0x292BAA0", Offset = "0x292AAA0", VA = "0x18292BAA0")]
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: 0x0600C1CB RID: 49611 RVA: 0x002BCA64 File Offset: 0x002BAC64
[Token(Token = "0x600C1CB")]
[Address(RVA = "0x292BCE0", Offset = "0x292ACE0", VA = "0x18292BCE0")]
public AlgorithmIdentifier find(string digAlgName)
{
IDictionary dictionary = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
IDictionary dictionary2 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
AlgorithmIdentifier algorithmIdentifier;
return algorithmIdentifier;
}
// Token: 0x0600C1CC RID: 49612 RVA: 0x002BCA88 File Offset: 0x002BAC88
[Token(Token = "0x600C1CC")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public DefaultDigestAlgorithmIdentifierFinder()
{
}
// Token: 0x04007AA3 RID: 31395
[Token(Token = "0x4007AA3")]
private static readonly IDictionary digestOids;
// Token: 0x04007AA4 RID: 31396
[Token(Token = "0x4007AA4")]
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: 0x02001E35 RID: 7733
[Token(Token = "0x2001E35")]
public class DefaultSignedAttributeTableGenerator : CmsAttributeTableGenerator
{
// Token: 0x0600C20D RID: 49677 RVA: 0x002BDD4C File Offset: 0x002BBF4C
[Token(Token = "0x600C20D")]
[Address(RVA = "0x292C3D0", Offset = "0x292B3D0", VA = "0x18292C3D0")]
public DefaultSignedAttributeTableGenerator()
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
}
// Token: 0x0600C20E RID: 49678 RVA: 0x002BDD70 File Offset: 0x002BBF70
[Token(Token = "0x600C20E")]
[Address(RVA = "0x292C340", Offset = "0x292B340", VA = "0x18292C340")]
public DefaultSignedAttributeTableGenerator(AttributeTable attributeTable)
{
if (attributeTable == 0)
{
IDictionary dictionary = Platform.CreateHashtable();
this.table = dictionary;
return;
}
IDictionary dictionary2 = attributeTable.ToDictionary();
this.table = dictionary2;
}
// Token: 0x0600C20F RID: 49679 RVA: 0x002BDDA8 File Offset: 0x002BBFA8
[Token(Token = "0x600C20F")]
[Address(RVA = "0x292C430", Offset = "0x292B430", VA = "0x18292C430", Slot = "5")]
protected virtual Hashtable createStandardAttributeTable(IDictionary parameters)
{
Hashtable hashtable = new Hashtable(this.table);
this.DoCreateStandardAttributeTable(parameters, hashtable);
return hashtable;
}
// Token: 0x0600C210 RID: 49680 RVA: 0x002BDDCC File Offset: 0x002BBFCC
[Token(Token = "0x600C210")]
[Address(RVA = "0x292BE20", Offset = "0x292AE20", VA = "0x18292BE20")]
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: 0x0600C211 RID: 49681 RVA: 0x002BDE58 File Offset: 0x002BC058
[Token(Token = "0x600C211")]
[Address(RVA = "0x292C2D0", Offset = "0x292B2D0", VA = "0x18292C2D0", Slot = "6")]
public virtual AttributeTable GetAttributes(IDictionary parameters)
{
AttributeTable attributes = this.GetAttributes(parameters);
AttributeTable attributeTable;
return attributeTable;
}
// Token: 0x04007ACE RID: 31438
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007ACE")]
private readonly IDictionary table;
}
}
@@ -0,0 +1,15 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001E36 RID: 7734
[Token(Token = "0x2001E36")]
internal interface IDigestCalculator
{
// Token: 0x0600C212 RID: 49682
[Token(Token = "0x600C212")]
[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: 0x02001E49 RID: 7753
[Token(Token = "0x2001E49")]
internal interface ISignerInfoGenerator
{
// Token: 0x0600C26E RID: 49774
[Token(Token = "0x600C26E")]
[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: 0x02001E37 RID: 7735
[Token(Token = "0x2001E37")]
internal class KekRecipientInfoGenerator : RecipientInfoGenerator
{
// Token: 0x0600C213 RID: 49683 RVA: 0x002BDE70 File Offset: 0x002BC070
[Token(Token = "0x600C213")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
internal KekRecipientInfoGenerator()
{
}
// Token: 0x17001E0F RID: 7695
// (set) Token: 0x0600C214 RID: 49684 RVA: 0x002BDE84 File Offset: 0x002BC084
[Token(Token = "0x17001E0F")]
internal KekIdentifier KekIdentifier
{
[Token(Token = "0x600C214")]
[Address(RVA = "0x415810", Offset = "0x414810", VA = "0x180415810")]
set
{
this.kekIdentifier = value;
}
}
// Token: 0x17001E10 RID: 7696
// (set) Token: 0x0600C215 RID: 49685 RVA: 0x002BDE98 File Offset: 0x002BC098
[Token(Token = "0x17001E10")]
internal KeyParameter KeyEncryptionKey
{
[Token(Token = "0x600C215")]
[Address(RVA = "0x292F9B0", Offset = "0x292E9B0", VA = "0x18292F9B0")]
set
{
string text = this.keyEncryptionKeyOID;
this.keyEncryptionKey = value;
AlgorithmIdentifier algorithmIdentifier = KekRecipientInfoGenerator.DetermineKeyEncAlg(text, value);
this.keyEncryptionAlgorithm = algorithmIdentifier;
}
}
// Token: 0x17001E11 RID: 7697
// (set) Token: 0x0600C216 RID: 49686 RVA: 0x002BDEC4 File Offset: 0x002BC0C4
[Token(Token = "0x17001E11")]
internal string KeyEncryptionKeyOID
{
[Token(Token = "0x600C216")]
[Address(RVA = "0x4157F0", Offset = "0x4147F0", VA = "0x1804157F0")]
set
{
this.keyEncryptionKeyOID = value;
}
}
// Token: 0x0600C217 RID: 49687 RVA: 0x002BDED8 File Offset: 0x002BC0D8
[Token(Token = "0x600C217")]
[Address(RVA = "0x292F770", Offset = "0x292E770", VA = "0x18292F770", 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: 0x0600C218 RID: 49688 RVA: 0x002BDF40 File Offset: 0x002BC140
[Token(Token = "0x600C218")]
[Address(RVA = "0x292F200", Offset = "0x292E200", VA = "0x18292F200")]
private static AlgorithmIdentifier DetermineKeyEncAlg(string algorithm, KeyParameter key)
{
/*
An exception occurred when decompiling this method (0600C218)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.AlgorithmIdentifier BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.KekRecipientInfoGenerator::DetermineKeyEncAlg(System.String,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.KeyParameter)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_F3:
stloc:ArgumentException(var_8_FD, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("illegal keysize in AES")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x04007ACF RID: 31439
[Token(Token = "0x4007ACF")]
private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance;
// Token: 0x04007AD0 RID: 31440
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007AD0")]
private KeyParameter keyEncryptionKey;
// Token: 0x04007AD1 RID: 31441
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007AD1")]
private string keyEncryptionKeyOID;
// Token: 0x04007AD2 RID: 31442
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007AD2")]
private KekIdentifier kekIdentifier;
// Token: 0x04007AD3 RID: 31443
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007AD3")]
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: 0x02001E38 RID: 7736
[Token(Token = "0x2001E38")]
public class KekRecipientInformation : RecipientInformation
{
// Token: 0x0600C21A RID: 49690 RVA: 0x002BE064 File Offset: 0x002BC264
[Token(Token = "0x600C21A")]
[Address(RVA = "0x292FC40", Offset = "0x292EC40", VA = "0x18292FC40")]
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: 0x0600C21B RID: 49691 RVA: 0x002BE0B4 File Offset: 0x002BC2B4
[Token(Token = "0x600C21B")]
[Address(RVA = "0x292FA30", Offset = "0x292EA30", VA = "0x18292FA30", 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: 0x04007AD4 RID: 31444
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007AD4")]
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: 0x02001E39 RID: 7737
[Token(Token = "0x2001E39")]
internal class KeyAgreeRecipientInfoGenerator : RecipientInfoGenerator
{
// Token: 0x0600C21C RID: 49692 RVA: 0x002BE138 File Offset: 0x002BC338
[Token(Token = "0x600C21C")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
internal KeyAgreeRecipientInfoGenerator()
{
}
// Token: 0x17001E12 RID: 7698
// (set) Token: 0x0600C21D RID: 49693 RVA: 0x002BE14C File Offset: 0x002BC34C
[Token(Token = "0x17001E12")]
internal DerObjectIdentifier KeyAgreementOID
{
[Token(Token = "0x600C21D")]
[Address(RVA = "0x415800", Offset = "0x414800", VA = "0x180415800")]
set
{
this.keyAgreementOID = value;
}
}
// Token: 0x17001E13 RID: 7699
// (set) Token: 0x0600C21E RID: 49694 RVA: 0x002BE160 File Offset: 0x002BC360
[Token(Token = "0x17001E13")]
internal DerObjectIdentifier KeyEncryptionOID
{
[Token(Token = "0x600C21E")]
[Address(RVA = "0x4157F0", Offset = "0x4147F0", VA = "0x1804157F0")]
set
{
this.keyEncryptionOID = value;
}
}
// Token: 0x17001E14 RID: 7700
// (set) Token: 0x0600C21F RID: 49695 RVA: 0x002BE174 File Offset: 0x002BC374
[Token(Token = "0x17001E14")]
internal ICollection RecipientCerts
{
[Token(Token = "0x600C21F")]
[Address(RVA = "0x2930BF0", Offset = "0x292FBF0", VA = "0x182930BF0")]
set
{
IList list = Platform.CreateArrayList(value);
this.recipientCerts = list;
}
}
// Token: 0x17001E15 RID: 7701
// (set) Token: 0x0600C220 RID: 49696 RVA: 0x002BE190 File Offset: 0x002BC390
[Token(Token = "0x17001E15")]
internal AsymmetricCipherKeyPair SenderKeyPair
{
[Token(Token = "0x600C220")]
[Address(RVA = "0x415820", Offset = "0x414820", VA = "0x180415820")]
set
{
this.senderKeyPair = value;
}
}
// Token: 0x0600C221 RID: 49697 RVA: 0x002BE1A4 File Offset: 0x002BC3A4
[Token(Token = "0x600C221")]
[Address(RVA = "0x292FE60", Offset = "0x292EE60", VA = "0x18292FE60", 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: 0x0600C222 RID: 49698 RVA: 0x002BE428 File Offset: 0x002BC628
[Token(Token = "0x600C222")]
[Address(RVA = "0x292FD40", Offset = "0x292ED40", VA = "0x18292FD40")]
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: 0x04007AD5 RID: 31445
[Token(Token = "0x4007AD5")]
private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance;
// Token: 0x04007AD6 RID: 31446
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007AD6")]
private DerObjectIdentifier keyAgreementOID;
// Token: 0x04007AD7 RID: 31447
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007AD7")]
private DerObjectIdentifier keyEncryptionOID;
// Token: 0x04007AD8 RID: 31448
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007AD8")]
private IList recipientCerts;
// Token: 0x04007AD9 RID: 31449
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007AD9")]
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: 0x02001E3A RID: 7738
[Token(Token = "0x2001E3A")]
public class KeyAgreeRecipientInformation : RecipientInformation
{
// Token: 0x0600C224 RID: 49700 RVA: 0x002BE47C File Offset: 0x002BC67C
[Token(Token = "0x600C224")]
[Address(RVA = "0x29317C0", Offset = "0x29307C0", VA = "0x1829317C0")]
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: 0x0600C225 RID: 49701 RVA: 0x002BE560 File Offset: 0x002BC760
[Token(Token = "0x600C225")]
[Address(RVA = "0x2931CA0", Offset = "0x2930CA0", VA = "0x182931CA0")]
internal KeyAgreeRecipientInformation(KeyAgreeRecipientInfo info, RecipientID rid, Asn1OctetString encryptedKey, CmsSecureReadable secureReadable)
{
this.rid = rid;
this.encryptedKey = encryptedKey;
this.info = info;
}
// Token: 0x0600C226 RID: 49702 RVA: 0x002BE588 File Offset: 0x002BC788
[Token(Token = "0x600C226")]
[Address(RVA = "0x2931260", Offset = "0x2930260", VA = "0x182931260")]
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: 0x0600C227 RID: 49703 RVA: 0x002BE638 File Offset: 0x002BC838
[Token(Token = "0x600C227")]
[Address(RVA = "0x29311A0", Offset = "0x29301A0", VA = "0x1829311A0")]
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: 0x0600C228 RID: 49704 RVA: 0x002BE66C File Offset: 0x002BC86C
[Token(Token = "0x600C228")]
[Address(RVA = "0x2931140", Offset = "0x2930140", VA = "0x182931140")]
private AsymmetricKeyParameter GetPublicKeyFromOriginatorID(OriginatorID origID)
{
/*
An exception occurred when decompiling this method (0600C228)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.KeyAgreeRecipientInformation::GetPublicKeyFromOriginatorID(BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.OriginatorID)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:CmsException(var_0_0A, newobj:CmsException(CmsException::.ctor, ldstr:string("No support for 'originator' as IssuerAndSerialNumber or SubjectKeyIdentifier")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C229 RID: 49705 RVA: 0x002BE684 File Offset: 0x002BC884
[Token(Token = "0x600C229")]
[Address(RVA = "0x2930C60", Offset = "0x292FC60", VA = "0x182930C60")]
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: 0x0600C22A RID: 49706 RVA: 0x002BE71C File Offset: 0x002BC91C
[Token(Token = "0x600C22A")]
[Address(RVA = "0x2931B70", Offset = "0x2930B70", VA = "0x182931B70")]
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: 0x0600C22B RID: 49707 RVA: 0x002BE754 File Offset: 0x002BC954
[Token(Token = "0x600C22B")]
[Address(RVA = "0x29313C0", Offset = "0x29303C0", VA = "0x1829313C0")]
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: 0x0600C22C RID: 49708 RVA: 0x002BE8C0 File Offset: 0x002BCAC0
[Token(Token = "0x600C22C")]
[Address(RVA = "0x2930FE0", Offset = "0x292FFE0", VA = "0x182930FE0", Slot = "4")]
public override CmsTypedStream GetContentStream(ICipherParameters key)
{
/*
An exception occurred when decompiling this method (0600C22C)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsTypedStream BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.KeyAgreeRecipientInformation::GetContentStream(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_18:
stloc:ArgumentException(var_3_27, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("KeyAgreement requires asymmetric key"), ldstr:string("key")))
stloc:ArgumentException(var_4_37, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Expected private key"), ldstr:string("key")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x04007ADA RID: 31450
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007ADA")]
private KeyAgreeRecipientInfo info;
// Token: 0x04007ADB RID: 31451
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007ADB")]
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: 0x02001E3B RID: 7739
[Token(Token = "0x2001E3B")]
internal class KeyTransRecipientInfoGenerator : RecipientInfoGenerator
{
// Token: 0x0600C22D RID: 49709 RVA: 0x002BE908 File Offset: 0x002BCB08
[Token(Token = "0x600C22D")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
internal KeyTransRecipientInfoGenerator()
{
}
// Token: 0x17001E16 RID: 7702
// (set) Token: 0x0600C22E RID: 49710 RVA: 0x002BE91C File Offset: 0x002BCB1C
[Token(Token = "0x17001E16")]
internal X509Certificate RecipientCert
{
[Token(Token = "0x600C22E")]
[Address(RVA = "0x2931FD0", Offset = "0x2930FD0", VA = "0x182931FD0")]
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: 0x17001E17 RID: 7703
// (set) Token: 0x0600C22F RID: 49711 RVA: 0x002BE960 File Offset: 0x002BCB60
[Token(Token = "0x17001E17")]
internal AsymmetricKeyParameter RecipientPublicKey
{
[Token(Token = "0x600C22F")]
[Address(RVA = "0x2932050", Offset = "0x2931050", VA = "0x182932050")]
set
{
this.recipientPublicKey = value;
SubjectPublicKeyInfo subjectPublicKeyInfo = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(this.recipientPublicKey);
this.info = subjectPublicKeyInfo;
}
}
// Token: 0x17001E18 RID: 7704
// (set) Token: 0x0600C230 RID: 49712 RVA: 0x002BE994 File Offset: 0x002BCB94
[Token(Token = "0x17001E18")]
internal Asn1OctetString SubjectKeyIdentifier
{
[Token(Token = "0x600C230")]
[Address(RVA = "0x415810", Offset = "0x414810", VA = "0x180415810")]
set
{
this.subjectKeyIdentifier = value;
}
}
// Token: 0x0600C231 RID: 49713 RVA: 0x002BE9A8 File Offset: 0x002BCBA8
[Token(Token = "0x600C231")]
[Address(RVA = "0x2931D00", Offset = "0x2930D00", VA = "0x182931D00", 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: 0x04007ADC RID: 31452
[Token(Token = "0x4007ADC")]
private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance;
// Token: 0x04007ADD RID: 31453
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007ADD")]
private TbsCertificateStructure recipientTbsCert;
// Token: 0x04007ADE RID: 31454
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007ADE")]
private AsymmetricKeyParameter recipientPublicKey;
// Token: 0x04007ADF RID: 31455
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007ADF")]
private Asn1OctetString subjectKeyIdentifier;
// Token: 0x04007AE0 RID: 31456
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007AE0")]
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: 0x02001E3C RID: 7740
[Token(Token = "0x2001E3C")]
public class KeyTransRecipientInformation : RecipientInformation
{
// Token: 0x0600C233 RID: 49715 RVA: 0x002BEA58 File Offset: 0x002BCC58
[Token(Token = "0x600C233")]
[Address(RVA = "0x29324B0", Offset = "0x29314B0", VA = "0x1829324B0")]
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: 0x0600C234 RID: 49716 RVA: 0x002BEB30 File Offset: 0x002BCD30
[Token(Token = "0x600C234")]
[Address(RVA = "0x2932120", Offset = "0x2931120", VA = "0x182932120")]
private string GetExchangeEncryptionAlgorithmName(DerObjectIdentifier oid)
{
DerObjectIdentifier rsaEncryption = PkcsObjectIdentifiers.RsaEncryption;
return oid.identifier;
}
// Token: 0x0600C235 RID: 49717 RVA: 0x002BEB58 File Offset: 0x002BCD58
[Token(Token = "0x600C235")]
[Address(RVA = "0x29321C0", Offset = "0x29311C0", VA = "0x1829321C0")]
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: 0x0600C236 RID: 49718 RVA: 0x002BEBAC File Offset: 0x002BCDAC
[Token(Token = "0x600C236")]
[Address(RVA = "0x29320F0", Offset = "0x29310F0", VA = "0x1829320F0", Slot = "4")]
public override CmsTypedStream GetContentStream(ICipherParameters key)
{
KeyParameter keyParameter = this.UnwrapKey(key);
return base.GetContentFromSessionKey(keyParameter);
}
// Token: 0x04007AE1 RID: 31457
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007AE1")]
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: 0x02001E3D RID: 7741
[Token(Token = "0x2001E3D")]
public class OriginatorID : X509CertStoreSelector
{
// Token: 0x0600C237 RID: 49719 RVA: 0x002BEBC8 File Offset: 0x002BCDC8
[Token(Token = "0x600C237")]
[Address(RVA = "0x2932770", Offset = "0x2931770", VA = "0x182932770", Slot = "2")]
public override int GetHashCode()
{
/*
An exception occurred when decompiling this method (0600C237)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.OriginatorID::GetHashCode()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_1:
callvirt:void(object::Finalize, ldloc:X509Name[exp:object](var_2_23))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C238 RID: 49720 RVA: 0x002BEC04 File Offset: 0x002BCE04
[Token(Token = "0x600C238")]
[Address(RVA = "0x2932650", Offset = "0x2931650", VA = "0x182932650", 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: 0x0600C239 RID: 49721 RVA: 0x002BEC48 File Offset: 0x002BCE48
[Token(Token = "0x600C239")]
[Address(RVA = "0x2932820", Offset = "0x2931820", VA = "0x182932820")]
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: 0x02001E3E RID: 7742
[Token(Token = "0x2001E3E")]
public class OriginatorInfoGenerator
{
// Token: 0x0600C23A RID: 49722 RVA: 0x002BEC5C File Offset: 0x002BCE5C
[Token(Token = "0x600C23A")]
[Address(RVA = "0x29328C0", Offset = "0x29318C0", VA = "0x1829328C0")]
public OriginatorInfoGenerator(X509Certificate origCert)
{
IList list = Platform.CreateArrayList(1);
this.origCerts = list;
this.origCrls = (ulong)0L;
throw new NullReferenceException();
}
// Token: 0x0600C23B RID: 49723 RVA: 0x002BEC8C File Offset: 0x002BCE8C
[Token(Token = "0x600C23B")]
[Address(RVA = "0x29329F0", Offset = "0x29319F0", VA = "0x1829329F0")]
public OriginatorInfoGenerator(IX509Store origCerts)
{
IList certificatesFromStore = CmsUtilities.GetCertificatesFromStore(origCerts);
this.origCerts = certificatesFromStore;
this.origCrls = (ulong)0L;
}
// Token: 0x0600C23C RID: 49724 RVA: 0x002BECB8 File Offset: 0x002BCEB8
[Token(Token = "0x600C23C")]
[Address(RVA = "0x2932980", Offset = "0x2931980", VA = "0x182932980")]
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: 0x0600C23D RID: 49725 RVA: 0x002BECF4 File Offset: 0x002BCEF4
[Token(Token = "0x600C23D")]
[Address(RVA = "0x2932830", Offset = "0x2931830", VA = "0x182932830", 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: 0x04007AE2 RID: 31458
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007AE2")]
private readonly IList origCerts;
// Token: 0x04007AE3 RID: 31459
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007AE3")]
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: 0x02001E3F RID: 7743
[Token(Token = "0x2001E3F")]
public class OriginatorInformation
{
// Token: 0x0600C23E RID: 49726 RVA: 0x002BED28 File Offset: 0x002BCF28
[Token(Token = "0x600C23E")]
[Address(RVA = "0x493D90", Offset = "0x492D90", VA = "0x180493D90")]
internal OriginatorInformation(OriginatorInfo originatorInfo)
{
this.originatorInfo = originatorInfo;
}
// Token: 0x0600C23F RID: 49727 RVA: 0x002BED44 File Offset: 0x002BCF44
[Token(Token = "0x600C23F")]
[Address(RVA = "0x2932A30", Offset = "0x2931A30", VA = "0x182932A30", 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: 0x0600C240 RID: 49728 RVA: 0x002BEDE0 File Offset: 0x002BCFE0
[Token(Token = "0x600C240")]
[Address(RVA = "0x2932DC0", Offset = "0x2931DC0", VA = "0x182932DC0", 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: 0x0600C241 RID: 49729 RVA: 0x002BEE7C File Offset: 0x002BD07C
[Token(Token = "0x600C241")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530", Slot = "6")]
public virtual OriginatorInfo ToAsn1Structure()
{
return this.originatorInfo;
}
// Token: 0x04007AE4 RID: 31460
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007AE4")]
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: 0x02001E42 RID: 7746
[Token(Token = "0x2001E42")]
internal class PasswordRecipientInfoGenerator : RecipientInfoGenerator
{
// Token: 0x0600C24C RID: 49740 RVA: 0x002BF008 File Offset: 0x002BD208
[Token(Token = "0x600C24C")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
internal PasswordRecipientInfoGenerator()
{
}
// Token: 0x17001E19 RID: 7705
// (set) Token: 0x0600C24D RID: 49741 RVA: 0x002BF01C File Offset: 0x002BD21C
[Token(Token = "0x17001E19")]
internal AlgorithmIdentifier KeyDerivationAlgorithm
{
[Token(Token = "0x600C24D")]
[Address(RVA = "0x415800", Offset = "0x414800", VA = "0x180415800")]
set
{
this.keyDerivationAlgorithm = value;
}
}
// Token: 0x17001E1A RID: 7706
// (set) Token: 0x0600C24E RID: 49742 RVA: 0x002BF030 File Offset: 0x002BD230
[Token(Token = "0x17001E1A")]
internal KeyParameter KeyEncryptionKey
{
[Token(Token = "0x600C24E")]
[Address(RVA = "0x4157F0", Offset = "0x4147F0", VA = "0x1804157F0")]
set
{
this.keyEncryptionKey = value;
}
}
// Token: 0x17001E1B RID: 7707
// (set) Token: 0x0600C24F RID: 49743 RVA: 0x002BF044 File Offset: 0x002BD244
[Token(Token = "0x17001E1B")]
internal string KeyEncryptionKeyOID
{
[Token(Token = "0x600C24F")]
[Address(RVA = "0x415810", Offset = "0x414810", VA = "0x180415810")]
set
{
this.keyEncryptionKeyOID = value;
}
}
// Token: 0x0600C250 RID: 49744 RVA: 0x002BF058 File Offset: 0x002BD258
[Token(Token = "0x600C250")]
[Address(RVA = "0x2933150", Offset = "0x2932150", VA = "0x182933150", 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: 0x04007AE5 RID: 31461
[Token(Token = "0x4007AE5")]
private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance;
// Token: 0x04007AE6 RID: 31462
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007AE6")]
private AlgorithmIdentifier keyDerivationAlgorithm;
// Token: 0x04007AE7 RID: 31463
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007AE7")]
private KeyParameter keyEncryptionKey;
// Token: 0x04007AE8 RID: 31464
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007AE8")]
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: 0x02001E43 RID: 7747
[Token(Token = "0x2001E43")]
public class PasswordRecipientInformation : RecipientInformation
{
// Token: 0x0600C252 RID: 49746 RVA: 0x002BF150 File Offset: 0x002BD350
[Token(Token = "0x600C252")]
[Address(RVA = "0x29339C0", Offset = "0x29329C0", VA = "0x1829339C0")]
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: 0x17001E1C RID: 7708
// (get) Token: 0x0600C253 RID: 49747 RVA: 0x002BF188 File Offset: 0x002BD388
[Token(Token = "0x17001E1C")]
public virtual AlgorithmIdentifier KeyDerivationAlgorithm
{
[Token(Token = "0x600C253")]
[Address(RVA = "0xADAD30", Offset = "0xAD9D30", VA = "0x180ADAD30", Slot = "5")]
get
{
return this.info.keyDerivationAlgorithm;
}
}
// Token: 0x0600C254 RID: 49748 RVA: 0x002BF1A8 File Offset: 0x002BD3A8
[Token(Token = "0x600C254")]
[Address(RVA = "0x2933590", Offset = "0x2932590", VA = "0x182933590", 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: 0x04007AE9 RID: 31465
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007AE9")]
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: 0x02001E40 RID: 7744
[Token(Token = "0x2001E40")]
public class Pkcs5Scheme2PbeKey : CmsPbeKey
{
// Token: 0x0600C242 RID: 49730 RVA: 0x002BEE90 File Offset: 0x002BD090
[Token(Token = "0x600C242")]
[Address(RVA = "0x2933BA0", Offset = "0x2932BA0", VA = "0x182933BA0")]
[Obsolete]
public Pkcs5Scheme2PbeKey(string password, byte[] salt, int iterationCount)
{
char[] array = password.ToCharArray();
base..ctor(array, salt, iterationCount);
}
// Token: 0x0600C243 RID: 49731 RVA: 0x002BEEB4 File Offset: 0x002BD0B4
[Token(Token = "0x600C243")]
[Address(RVA = "0x21482A0", Offset = "0x21472A0", VA = "0x1821482A0")]
[Obsolete]
public Pkcs5Scheme2PbeKey(string password, AlgorithmIdentifier keyDerivationAlgorithm)
{
char[] array = password.ToCharArray();
base..ctor(array, keyDerivationAlgorithm);
}
// Token: 0x0600C244 RID: 49732 RVA: 0x002BEED8 File Offset: 0x002BD0D8
[Token(Token = "0x600C244")]
[Address(RVA = "0x2933C00", Offset = "0x2932C00", VA = "0x182933C00")]
public Pkcs5Scheme2PbeKey(char[] password, byte[] salt, int iterationCount)
: base(password, salt, iterationCount)
{
}
// Token: 0x0600C245 RID: 49733 RVA: 0x002BEEF0 File Offset: 0x002BD0F0
[Token(Token = "0x600C245")]
[Address(RVA = "0x2933C10", Offset = "0x2932C10", VA = "0x182933C10")]
public Pkcs5Scheme2PbeKey(char[] password, AlgorithmIdentifier keyDerivationAlgorithm)
: base(password, keyDerivationAlgorithm)
{
}
// Token: 0x0600C246 RID: 49734 RVA: 0x002BEF08 File Offset: 0x002BD108
[Token(Token = "0x600C246")]
[Address(RVA = "0x2933A50", Offset = "0x2932A50", VA = "0x182933A50", 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: 0x02001E41 RID: 7745
[Token(Token = "0x2001E41")]
public class Pkcs5Scheme2Utf8PbeKey : CmsPbeKey
{
// Token: 0x0600C247 RID: 49735 RVA: 0x002BEF4C File Offset: 0x002BD14C
[Token(Token = "0x600C247")]
[Address(RVA = "0x2933BA0", Offset = "0x2932BA0", VA = "0x182933BA0")]
[Obsolete]
public Pkcs5Scheme2Utf8PbeKey(string password, byte[] salt, int iterationCount)
{
char[] array = password.ToCharArray();
base..ctor(array, salt, iterationCount);
}
// Token: 0x0600C248 RID: 49736 RVA: 0x002BEF70 File Offset: 0x002BD170
[Token(Token = "0x600C248")]
[Address(RVA = "0x21482A0", Offset = "0x21472A0", VA = "0x1821482A0")]
[Obsolete]
public Pkcs5Scheme2Utf8PbeKey(string password, AlgorithmIdentifier keyDerivationAlgorithm)
{
char[] array = password.ToCharArray();
base..ctor(array, keyDerivationAlgorithm);
}
// Token: 0x0600C249 RID: 49737 RVA: 0x002BEF94 File Offset: 0x002BD194
[Token(Token = "0x600C249")]
[Address(RVA = "0x2933C00", Offset = "0x2932C00", VA = "0x182933C00")]
public Pkcs5Scheme2Utf8PbeKey(char[] password, byte[] salt, int iterationCount)
: base(password, salt, iterationCount)
{
}
// Token: 0x0600C24A RID: 49738 RVA: 0x002BEFAC File Offset: 0x002BD1AC
[Token(Token = "0x600C24A")]
[Address(RVA = "0x2933C10", Offset = "0x2932C10", VA = "0x182933C10")]
public Pkcs5Scheme2Utf8PbeKey(char[] password, AlgorithmIdentifier keyDerivationAlgorithm)
: base(password, keyDerivationAlgorithm)
{
}
// Token: 0x0600C24B RID: 49739 RVA: 0x002BEFC4 File Offset: 0x002BD1C4
[Token(Token = "0x600C24B")]
[Address(RVA = "0x2933C20", Offset = "0x2932C20", VA = "0x182933C20", 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: 0x02001E44 RID: 7748
[Token(Token = "0x2001E44")]
public class RecipientID : X509CertStoreSelector
{
// Token: 0x17001E1D RID: 7709
// (get) Token: 0x0600C255 RID: 49749 RVA: 0x002BF28C File Offset: 0x002BD48C
// (set) Token: 0x0600C256 RID: 49750 RVA: 0x002BF2A4 File Offset: 0x002BD4A4
[Token(Token = "0x17001E1D")]
public byte[] KeyIdentifier
{
[Token(Token = "0x600C255")]
[Address(RVA = "0x2933FB0", Offset = "0x2932FB0", VA = "0x182933FB0")]
get
{
return Arrays.Clone(this.keyIdentifier);
}
[Token(Token = "0x600C256")]
[Address(RVA = "0x2934010", Offset = "0x2933010", VA = "0x182934010")]
set
{
byte[] array = Arrays.Clone(value);
this.keyIdentifier = array;
}
}
// Token: 0x0600C257 RID: 49751 RVA: 0x002BF2C0 File Offset: 0x002BD4C0
[Token(Token = "0x600C257")]
[Address(RVA = "0x2933EE0", Offset = "0x2932EE0", VA = "0x182933EE0", 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: 0x0600C258 RID: 49752 RVA: 0x002BF30C File Offset: 0x002BD50C
[Token(Token = "0x600C258")]
[Address(RVA = "0x2933D70", Offset = "0x2932D70", VA = "0x182933D70", 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: 0x0600C259 RID: 49753 RVA: 0x002BF360 File Offset: 0x002BD560
[Token(Token = "0x600C259")]
[Address(RVA = "0x2932820", Offset = "0x2931820", VA = "0x182932820")]
public RecipientID()
{
}
// Token: 0x04007AEA RID: 31466
[FieldOffset(Offset = "0x88")]
[Token(Token = "0x4007AEA")]
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: 0x02001E45 RID: 7749
[Token(Token = "0x2001E45")]
internal interface RecipientInfoGenerator
{
// Token: 0x0600C25A RID: 49754
[Token(Token = "0x600C25A")]
[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: 0x02001E46 RID: 7750
[Token(Token = "0x2001E46")]
public abstract class RecipientInformation
{
// Token: 0x0600C25B RID: 49755 RVA: 0x002BF374 File Offset: 0x002BD574
[Token(Token = "0x600C25B")]
[Address(RVA = "0x2934AC0", Offset = "0x2933AC0", VA = "0x182934AC0")]
internal RecipientInformation(AlgorithmIdentifier keyEncAlg, CmsSecureReadable secureReadable)
{
RecipientID recipientID = new RecipientID();
this.rid = recipientID;
base..ctor();
this.keyEncAlg = keyEncAlg;
this.secureReadable = secureReadable;
}
// Token: 0x0600C25C RID: 49756 RVA: 0x002BF3A4 File Offset: 0x002BD5A4
[Token(Token = "0x600C25C")]
[Address(RVA = "0x29345D0", Offset = "0x29335D0", VA = "0x1829345D0")]
internal string GetContentAlgorithmName()
{
CmsSecureReadable cmsSecureReadable = this.secureReadable;
int num = 0;
num += num;
num++;
throw new NullReferenceException();
}
// Token: 0x17001E1E RID: 7710
// (get) Token: 0x0600C25D RID: 49757 RVA: 0x002BF3CC File Offset: 0x002BD5CC
[Token(Token = "0x17001E1E")]
public RecipientID RecipientID
{
[Token(Token = "0x600C25D")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530")]
get
{
return this.rid;
}
}
// Token: 0x17001E1F RID: 7711
// (get) Token: 0x0600C25E RID: 49758 RVA: 0x002BF3E0 File Offset: 0x002BD5E0
[Token(Token = "0x17001E1F")]
public AlgorithmIdentifier KeyEncryptionAlgorithmID
{
[Token(Token = "0x600C25E")]
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0")]
get
{
return this.keyEncAlg;
}
}
// Token: 0x17001E20 RID: 7712
// (get) Token: 0x0600C25F RID: 49759 RVA: 0x002BF3F4 File Offset: 0x002BD5F4
[Token(Token = "0x17001E20")]
public string KeyEncryptionAlgOid
{
[Token(Token = "0x600C25F")]
[Address(RVA = "0x2934B40", Offset = "0x2933B40", VA = "0x182934B40")]
get
{
Asn1Object asn1Object = this.keyEncAlg.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001E21 RID: 7713
// (get) Token: 0x0600C260 RID: 49760 RVA: 0x002BF414 File Offset: 0x002BD614
[Token(Token = "0x17001E21")]
public Asn1Object KeyEncryptionAlgParams
{
[Token(Token = "0x600C260")]
[Address(RVA = "0x2934B80", Offset = "0x2933B80", VA = "0x182934B80")]
get
{
DerObjectIdentifier objectID = this.keyEncAlg.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600C261 RID: 49761 RVA: 0x002BF440 File Offset: 0x002BD640
[Token(Token = "0x600C261")]
[Address(RVA = "0x29346A0", Offset = "0x29336A0", VA = "0x1829346A0")]
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: 0x0600C262 RID: 49762 RVA: 0x002BF4B0 File Offset: 0x002BD6B0
[Token(Token = "0x600C262")]
[Address(RVA = "0x29348E0", Offset = "0x29338E0", VA = "0x1829348E0")]
public byte[] GetContent(ICipherParameters key)
{
string text = this.ToString();
byte[] array;
return array;
}
// Token: 0x0600C263 RID: 49763 RVA: 0x002BF4E0 File Offset: 0x002BD6E0
[Token(Token = "0x600C263")]
[Address(RVA = "0x29349B0", Offset = "0x29339B0", VA = "0x1829349B0")]
public byte[] GetMac()
{
if (this.resultMac == (ulong)0L)
{
CmsSecureReadable cmsSecureReadable = this.secureReadable;
byte[] array;
this.resultMac = array;
}
return Arrays.Clone(this.resultMac);
}
// Token: 0x0600C264 RID: 49764
[Token(Token = "0x600C264")]
[Address(Slot = "4")]
public abstract CmsTypedStream GetContentStream(ICipherParameters key);
// Token: 0x04007AEB RID: 31467
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007AEB")]
internal RecipientID rid;
// Token: 0x04007AEC RID: 31468
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007AEC")]
internal AlgorithmIdentifier keyEncAlg;
// Token: 0x04007AED RID: 31469
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007AED")]
internal CmsSecureReadable secureReadable;
// Token: 0x04007AEE RID: 31470
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007AEE")]
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: 0x02001E47 RID: 7751
[Token(Token = "0x2001E47")]
public class RecipientInformationStore
{
// Token: 0x0600C265 RID: 49765 RVA: 0x002BF518 File Offset: 0x002BD718
[Token(Token = "0x600C265")]
[Address(RVA = "0x29342C0", Offset = "0x29332C0", VA = "0x1829342C0")]
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: 0x17001E22 RID: 7714
[Token(Token = "0x17001E22")]
public RecipientInformation this[RecipientID selector]
{
[Token(Token = "0x600C266")]
[Address(RVA = "0x2934080", Offset = "0x2933080", VA = "0x182934080")]
get
{
IDictionary dictionary;
do
{
dictionary = this.table;
}
while (dictionary == 0);
throw new NullReferenceException();
}
}
// Token: 0x0600C267 RID: 49767 RVA: 0x002BF5C4 File Offset: 0x002BD7C4
[Token(Token = "0x600C267")]
[Address(RVA = "0x2934080", Offset = "0x2933080", VA = "0x182934080")]
public RecipientInformation GetFirstRecipient(RecipientID selector)
{
IDictionary dictionary;
do
{
dictionary = this.table;
}
while (dictionary == 0);
throw new NullReferenceException();
}
// Token: 0x17001E23 RID: 7715
// (get) Token: 0x0600C268 RID: 49768 RVA: 0x002BF5E8 File Offset: 0x002BD7E8
[Token(Token = "0x17001E23")]
public int Count
{
[Token(Token = "0x600C268")]
[Address(RVA = "0x2934580", Offset = "0x2933580", VA = "0x182934580")]
get
{
IList list = this.all;
throw new NullReferenceException();
}
}
// Token: 0x0600C269 RID: 49769 RVA: 0x002BF604 File Offset: 0x002BD804
[Token(Token = "0x600C269")]
[Address(RVA = "0x2934260", Offset = "0x2933260", VA = "0x182934260")]
public ICollection GetRecipients()
{
/*
An exception occurred when decompiling this method (0600C269)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Collections.ICollection BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.RecipientInformationStore::GetRecipients()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:IList(var_0_0B, call:IList(Platform::CreateArrayList, ldfld:IList[exp:ICollection](RecipientInformationStore::all, ldloc:RecipientInformationStore(this))))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C26A RID: 49770 RVA: 0x002BF61C File Offset: 0x002BD81C
[Token(Token = "0x600C26A")]
[Address(RVA = "0x2934170", Offset = "0x2933170", VA = "0x182934170")]
public ICollection GetRecipients(RecipientID selector)
{
IDictionary dictionary = this.table;
IList list = Platform.CreateArrayList();
throw new NullReferenceException();
}
// Token: 0x04007AEF RID: 31471
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007AEF")]
private readonly IList all;
// Token: 0x04007AF0 RID: 31472
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007AF0")]
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: 0x02001E48 RID: 7752
[Token(Token = "0x2001E48")]
public class SignerID : X509CertStoreSelector
{
// Token: 0x0600C26B RID: 49771 RVA: 0x002BF640 File Offset: 0x002BD840
[Token(Token = "0x600C26B")]
[Address(RVA = "0x2934CF0", Offset = "0x2933CF0", VA = "0x182934CF0", Slot = "2")]
public override int GetHashCode()
{
/*
An exception occurred when decompiling this method (0600C26B)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerID::GetHashCode()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_1:
callvirt:void(object::Finalize, ldloc:X509Name[exp:object](var_2_23))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C26C RID: 49772 RVA: 0x002BF67C File Offset: 0x002BD87C
[Token(Token = "0x600C26C")]
[Address(RVA = "0x2934BD0", Offset = "0x2933BD0", VA = "0x182934BD0", 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: 0x0600C26D RID: 49773 RVA: 0x002BF6C0 File Offset: 0x002BD8C0
[Token(Token = "0x600C26D")]
[Address(RVA = "0x2932820", Offset = "0x2931820", VA = "0x182932820")]
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: 0x02001E4A RID: 7754
[Token(Token = "0x2001E4A")]
public class SignerInfoGenerator
{
// Token: 0x0600C26F RID: 49775 RVA: 0x002BF6D4 File Offset: 0x002BD8D4
[Token(Token = "0x600C26F")]
[Address(RVA = "0x2935B50", Offset = "0x2934B50", VA = "0x182935B50")]
internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory signerFactory)
{
}
// Token: 0x0600C270 RID: 49776 RVA: 0x002BF6E4 File Offset: 0x002BD8E4
[Token(Token = "0x600C270")]
[Address(RVA = "0x2935A10", Offset = "0x2934A10", VA = "0x182935A10")]
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: 0x0600C271 RID: 49777 RVA: 0x002BF738 File Offset: 0x002BD938
[Token(Token = "0x600C271")]
[Address(RVA = "0x2935AF0", Offset = "0x2934AF0", VA = "0x182935AF0")]
internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory contentSigner, CmsAttributeTableGenerator signedGen, CmsAttributeTableGenerator unsignedGen)
{
this.sigId = sigId;
this.signedGen = signedGen;
this.unsignedGen = 0;
this.contentSigner = contentSigner;
}
// Token: 0x0600C272 RID: 49778 RVA: 0x002BF768 File Offset: 0x002BD968
[Token(Token = "0x600C272")]
[Address(RVA = "0x415800", Offset = "0x414800", VA = "0x180415800")]
internal void setAssociatedCertificate(X509Certificate certificate)
{
this.certificate = certificate;
}
// Token: 0x04007AF1 RID: 31473
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007AF1")]
internal X509Certificate certificate;
// Token: 0x04007AF2 RID: 31474
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007AF2")]
internal ISignatureFactory contentSigner;
// Token: 0x04007AF3 RID: 31475
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007AF3")]
internal SignerIdentifier sigId;
// Token: 0x04007AF4 RID: 31476
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007AF4")]
internal CmsAttributeTableGenerator signedGen;
// Token: 0x04007AF5 RID: 31477
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007AF5")]
internal CmsAttributeTableGenerator unsignedGen;
// Token: 0x04007AF6 RID: 31478
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007AF6")]
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: 0x02001E4B RID: 7755
[Token(Token = "0x2001E4B")]
public class SignerInfoGeneratorBuilder
{
// Token: 0x0600C273 RID: 49779 RVA: 0x002BF77C File Offset: 0x002BD97C
[Token(Token = "0x600C273")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public SignerInfoGeneratorBuilder()
{
}
// Token: 0x0600C274 RID: 49780 RVA: 0x002BF790 File Offset: 0x002BD990
[Token(Token = "0x600C274")]
[Address(RVA = "0x29350A0", Offset = "0x29340A0", VA = "0x1829350A0")]
public SignerInfoGeneratorBuilder SetDirectSignature(bool hasNoSignedAttributes)
{
this.directSignature = hasNoSignedAttributes;
return this;
}
// Token: 0x0600C275 RID: 49781 RVA: 0x002BF7A8 File Offset: 0x002BD9A8
[Token(Token = "0x600C275")]
[Address(RVA = "0x493840", Offset = "0x492840", VA = "0x180493840")]
public SignerInfoGeneratorBuilder WithSignedAttributeGenerator(CmsAttributeTableGenerator signedGen)
{
this.signedGen = signedGen;
return this;
}
// Token: 0x0600C276 RID: 49782 RVA: 0x002BF7C0 File Offset: 0x002BD9C0
[Token(Token = "0x600C276")]
[Address(RVA = "0x493850", Offset = "0x492850", VA = "0x180493850")]
public SignerInfoGeneratorBuilder WithUnsignedAttributeGenerator(CmsAttributeTableGenerator unsignedGen)
{
this.unsignedGen = unsignedGen;
return this;
}
// Token: 0x0600C277 RID: 49783 RVA: 0x002BF7D8 File Offset: 0x002BD9D8
[Token(Token = "0x600C277")]
[Address(RVA = "0x2934DA0", Offset = "0x2933DA0", VA = "0x182934DA0")]
public SignerInfoGenerator Build(ISignatureFactory contentSigner, X509Certificate certificate)
{
BigInteger serialNumber = certificate.SerialNumber;
int version = certificate.Version;
IssuerAndSerialNumber issuerAndSerialNumber;
SignerIdentifier signerIdentifier = new SignerIdentifier(issuerAndSerialNumber);
SignerInfoGenerator signerInfoGenerator = this.CreateGenerator(contentSigner, signerIdentifier);
signerInfoGenerator.certificate = certificate;
return signerInfoGenerator;
}
// Token: 0x0600C278 RID: 49784 RVA: 0x002BF818 File Offset: 0x002BDA18
[Token(Token = "0x600C278")]
[Address(RVA = "0x2934EC0", Offset = "0x2933EC0", VA = "0x182934EC0")]
public SignerInfoGenerator Build(ISignatureFactory signerFactory, byte[] subjectKeyIdentifier)
{
SignerIdentifier signerIdentifier = new SignerIdentifier(new DerOctetString(subjectKeyIdentifier));
return this.CreateGenerator(signerFactory, signerIdentifier);
}
// Token: 0x0600C279 RID: 49785 RVA: 0x002BF83C File Offset: 0x002BDA3C
[Token(Token = "0x600C279")]
[Address(RVA = "0x2934F60", Offset = "0x2933F60", VA = "0x182934F60")]
private SignerInfoGenerator CreateGenerator(ISignatureFactory contentSigner, SignerIdentifier sigId)
{
/*
An exception occurred when decompiling this method (0600C279)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInfoGenerator BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInfoGeneratorBuilder::CreateGenerator(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ISignatureFactory,BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.SignerIdentifier)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_70:
stloc:int32(var_8_71, ldc.i4:int32(0))
stfld:SignerIdentifier(SignerInfoGenerator::sigId, ldloc:SignerInfoGenerator(var_7), ldloc:SignerIdentifier(sigId))
stfld:ISignatureFactory(SignerInfoGenerator::contentSigner, ldloc:SignerInfoGenerator(var_7), ldloc:ISignatureFactory(contentSigner))
stfld:bool(SignerInfoGenerator::isDirectSignature, ldloc:SignerInfoGenerator(var_7), ldc.i4:bool(1))
stfld:CmsAttributeTableGenerator(SignerInfoGenerator::signedGen, ldloc:SignerInfoGenerator(var_7), ldloc:int32[exp:CmsAttributeTableGenerator](var_8_71))
stfld:CmsAttributeTableGenerator(SignerInfoGenerator::unsignedGen, ldloc:SignerInfoGenerator(var_7), ldloc:int32[exp:CmsAttributeTableGenerator](var_8_71))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x04007AF7 RID: 31479
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007AF7")]
private bool directSignature;
// Token: 0x04007AF8 RID: 31480
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007AF8")]
private CmsAttributeTableGenerator signedGen;
// Token: 0x04007AF9 RID: 31481
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007AF9")]
private CmsAttributeTableGenerator unsignedGen;
}
}
@@ -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: 0x02001E4C RID: 7756
[Token(Token = "0x2001E4C")]
public class SignerInformation
{
// Token: 0x0600C27A RID: 49786 RVA: 0x002BF8E8 File Offset: 0x002BDAE8
[Token(Token = "0x600C27A")]
[Address(RVA = "0x2938AB0", Offset = "0x2937AB0", VA = "0x182938AB0")]
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: 0x0600C27B RID: 49787 RVA: 0x002BFA44 File Offset: 0x002BDC44
[Token(Token = "0x600C27B")]
[Address(RVA = "0x29389F0", Offset = "0x29379F0", VA = "0x1829389F0")]
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: 0x17001E24 RID: 7716
// (get) Token: 0x0600C27C RID: 49788 RVA: 0x002BFB2C File Offset: 0x002BDD2C
[Token(Token = "0x17001E24")]
public bool IsCounterSignature
{
[Token(Token = "0x600C27C")]
[Address(RVA = "0x82DDE0", Offset = "0x82CDE0", VA = "0x18082DDE0")]
get
{
return this.isCounterSignature;
}
}
// Token: 0x17001E25 RID: 7717
// (get) Token: 0x0600C27D RID: 49789 RVA: 0x002BFB40 File Offset: 0x002BDD40
[Token(Token = "0x17001E25")]
public DerObjectIdentifier ContentType
{
[Token(Token = "0x600C27D")]
[Address(RVA = "0x4936E0", Offset = "0x4926E0", VA = "0x1804936E0")]
get
{
return this.contentType;
}
}
// Token: 0x17001E26 RID: 7718
// (get) Token: 0x0600C27E RID: 49790 RVA: 0x002BFB54 File Offset: 0x002BDD54
[Token(Token = "0x17001E26")]
public SignerID SignerID
{
[Token(Token = "0x600C27E")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530")]
get
{
return this.sid;
}
}
// Token: 0x17001E27 RID: 7719
// (get) Token: 0x0600C27F RID: 49791 RVA: 0x002BFB68 File Offset: 0x002BDD68
[Token(Token = "0x17001E27")]
public int Version
{
[Token(Token = "0x600C27F")]
[Address(RVA = "0x214CFC0", Offset = "0x214BFC0", VA = "0x18214CFC0")]
get
{
return this.info.version.Value.IntValue;
}
}
// Token: 0x17001E28 RID: 7720
// (get) Token: 0x0600C280 RID: 49792 RVA: 0x002BFB90 File Offset: 0x002BDD90
[Token(Token = "0x17001E28")]
public AlgorithmIdentifier DigestAlgorithmID
{
[Token(Token = "0x600C280")]
[Address(RVA = "0x4157C0", Offset = "0x4147C0", VA = "0x1804157C0")]
get
{
return this.digestAlgorithm;
}
}
// Token: 0x17001E29 RID: 7721
// (get) Token: 0x0600C281 RID: 49793 RVA: 0x002BFBA4 File Offset: 0x002BDDA4
[Token(Token = "0x17001E29")]
public string DigestAlgOid
{
[Token(Token = "0x600C281")]
[Address(RVA = "0x21429A0", Offset = "0x21419A0", VA = "0x1821429A0")]
get
{
Asn1Object asn1Object = this.digestAlgorithm.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001E2A RID: 7722
// (get) Token: 0x0600C282 RID: 49794 RVA: 0x002BFBC4 File Offset: 0x002BDDC4
[Token(Token = "0x17001E2A")]
public Asn1Object DigestAlgParams
{
[Token(Token = "0x600C282")]
[Address(RVA = "0x2938CC0", Offset = "0x2937CC0", VA = "0x182938CC0")]
get
{
DerObjectIdentifier objectID = this.digestAlgorithm.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600C283 RID: 49795 RVA: 0x002BFBF0 File Offset: 0x002BDDF0
[Token(Token = "0x600C283")]
[Address(RVA = "0x29376B0", Offset = "0x29366B0", VA = "0x1829376B0")]
public byte[] GetContentDigest()
{
/*
An exception occurred when decompiling this method (0600C283)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::GetContentDigest()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_09:
stloc:InvalidOperationException(var_0_13, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("method can only be called after verify.")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x17001E2B RID: 7723
// (get) Token: 0x0600C284 RID: 49796 RVA: 0x002BFC10 File Offset: 0x002BDE10
[Token(Token = "0x17001E2B")]
public AlgorithmIdentifier EncryptionAlgorithmID
{
[Token(Token = "0x600C284")]
[Address(RVA = "0x4157D0", Offset = "0x4147D0", VA = "0x1804157D0")]
get
{
return this.encryptionAlgorithm;
}
}
// Token: 0x17001E2C RID: 7724
// (get) Token: 0x0600C285 RID: 49797 RVA: 0x002BFC24 File Offset: 0x002BDE24
[Token(Token = "0x17001E2C")]
public string EncryptionAlgOid
{
[Token(Token = "0x600C285")]
[Address(RVA = "0x2938D10", Offset = "0x2937D10", VA = "0x182938D10")]
get
{
Asn1Object asn1Object = this.encryptionAlgorithm.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001E2D RID: 7725
// (get) Token: 0x0600C286 RID: 49798 RVA: 0x002BFC44 File Offset: 0x002BDE44
[Token(Token = "0x17001E2D")]
public Asn1Object EncryptionAlgParams
{
[Token(Token = "0x600C286")]
[Address(RVA = "0x2938D50", Offset = "0x2937D50", VA = "0x182938D50")]
get
{
DerObjectIdentifier objectID = this.encryptionAlgorithm.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x17001E2E RID: 7726
// (get) Token: 0x0600C287 RID: 49799 RVA: 0x002BFC70 File Offset: 0x002BDE70
[Token(Token = "0x17001E2E")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable SignedAttributes
{
[Token(Token = "0x600C287")]
[Address(RVA = "0x2938DA0", Offset = "0x2937DA0", VA = "0x182938DA0")]
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: 0x17001E2F RID: 7727
// (get) Token: 0x0600C288 RID: 49800 RVA: 0x002BFCAC File Offset: 0x002BDEAC
[Token(Token = "0x17001E2F")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable UnsignedAttributes
{
[Token(Token = "0x600C288")]
[Address(RVA = "0x2938E20", Offset = "0x2937E20", VA = "0x182938E20")]
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: 0x0600C289 RID: 49801 RVA: 0x002BFCE8 File Offset: 0x002BDEE8
[Token(Token = "0x600C289")]
[Address(RVA = "0x2937D00", Offset = "0x2936D00", VA = "0x182937D00")]
public byte[] GetSignature()
{
byte[] array = this.signature;
throw new NullReferenceException();
}
// Token: 0x0600C28A RID: 49802 RVA: 0x002BFD04 File Offset: 0x002BDF04
[Token(Token = "0x600C28A")]
[Address(RVA = "0x2937760", Offset = "0x2936760", VA = "0x182937760")]
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: 0x0600C28B RID: 49803 RVA: 0x002BFE04 File Offset: 0x002BE004
[Token(Token = "0x600C28B")]
[Address(RVA = "0x2937CB0", Offset = "0x2936CB0", VA = "0x182937CB0")]
public byte[] GetEncodedSignedAttributes()
{
Asn1Set asn1Set = this.signedAttributeSet;
if (asn1Set == 0)
{
}
return asn1Set.GetEncoded("DER");
}
// Token: 0x0600C28C RID: 49804 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600C28C")]
[Address(RVA = "0x29367C0", Offset = "0x29357C0", VA = "0x1829367C0")]
private bool DoVerify(AsymmetricKeyParameter key)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600C28D RID: 49805 RVA: 0x002BFE2C File Offset: 0x002BE02C
[Token(Token = "0x600C28D")]
[Address(RVA = "0x29380B0", Offset = "0x29370B0", VA = "0x1829380B0")]
private bool IsNull(Asn1Encodable o)
{
return (o != 0 && o != 0) || o == 0;
}
// Token: 0x0600C28E RID: 49806 RVA: 0x002BFE4C File Offset: 0x002BE04C
[Token(Token = "0x600C28E")]
[Address(RVA = "0x29366C0", Offset = "0x29356C0", VA = "0x1829366C0")]
private DigestInfo DerDecode(byte[] encoding)
{
/*
An exception occurred when decompiling this method (0600C28E)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.DigestInfo BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::DerDecode(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_36:
stloc:CmsException(var_3_40, newobj:CmsException(CmsException::.ctor, ldstr:string("malformed RSA signature")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C28F RID: 49807 RVA: 0x002BFE9C File Offset: 0x002BE09C
[Token(Token = "0x600C28F")]
[Address(RVA = "0x2938280", Offset = "0x2937280", VA = "0x182938280")]
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: 0x0600C290 RID: 49808 RVA: 0x002BFFFC File Offset: 0x002BE1FC
[Token(Token = "0x600C290")]
[Address(RVA = "0x29388E0", Offset = "0x29378E0", VA = "0x1829388E0")]
public bool Verify(AsymmetricKeyParameter pubKey)
{
/*
An exception occurred when decompiling this method (0600C290)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::Verify(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_1E:
stloc:ArgumentException(var_1_2D, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Expected public key"), ldstr:string("pubKey")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C291 RID: 49809 RVA: 0x002C0038 File Offset: 0x002BE238
[Token(Token = "0x600C291")]
[Address(RVA = "0x2938860", Offset = "0x2937860", VA = "0x182938860")]
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: 0x0600C292 RID: 49810 RVA: 0x002C0060 File Offset: 0x002BE260
[Token(Token = "0x600C292")]
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0")]
public SignerInfo ToSignerInfo()
{
return this.info;
}
// Token: 0x0600C293 RID: 49811 RVA: 0x002C0074 File Offset: 0x002BE274
[Token(Token = "0x600C293")]
[Address(RVA = "0x2937E60", Offset = "0x2936E60", VA = "0x182937E60")]
private Asn1Object GetSingleValuedSignedAttribute(DerObjectIdentifier attrOID, string printableName)
{
/*
An exception occurred when decompiling this method (0600C293)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Asn1Object BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::GetSingleValuedSignedAttribute(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.DerObjectIdentifier,System.String)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_4D:
stloc:CmsException(var_10_57, newobj:CmsException(CmsException::.ctor, ldloc:string(var_9)))
stloc:CmsException(var_12_60, newobj:CmsException(CmsException::.ctor, ldloc:string(var_11)))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C294 RID: 49812 RVA: 0x002C00E4 File Offset: 0x002BE2E4
[Token(Token = "0x600C294")]
[Address(RVA = "0x2937D80", Offset = "0x2936D80", VA = "0x182937D80")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Time GetSigningTime()
{
/*
An exception occurred when decompiling this method (0600C294)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Time BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::GetSigningTime()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_1E:
stloc:CmsException(var_2_28, newobj:CmsException(CmsException::.ctor, ldstr:string("signing-time attribute value not a valid 'Time' structure")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C295 RID: 49813 RVA: 0x002C011C File Offset: 0x002BE31C
[Token(Token = "0x600C295")]
[Address(RVA = "0x2938130", Offset = "0x2937130", VA = "0x182938130")]
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: 0x0600C296 RID: 49814 RVA: 0x002C01A0 File Offset: 0x002BE3A0
[Token(Token = "0x600C296")]
[Address(RVA = "0x2936190", Offset = "0x2935190", VA = "0x182936190")]
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: 0x04007AFA RID: 31482
[Token(Token = "0x4007AFA")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x04007AFB RID: 31483
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007AFB")]
private SignerID sid;
// Token: 0x04007AFC RID: 31484
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007AFC")]
private SignerInfo info;
// Token: 0x04007AFD RID: 31485
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007AFD")]
private AlgorithmIdentifier digestAlgorithm;
// Token: 0x04007AFE RID: 31486
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007AFE")]
private AlgorithmIdentifier encryptionAlgorithm;
// Token: 0x04007AFF RID: 31487
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007AFF")]
private readonly Asn1Set signedAttributeSet;
// Token: 0x04007B00 RID: 31488
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007B00")]
private readonly Asn1Set unsignedAttributeSet;
// Token: 0x04007B01 RID: 31489
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007B01")]
private CmsProcessable content;
// Token: 0x04007B02 RID: 31490
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007B02")]
private byte[] signature;
// Token: 0x04007B03 RID: 31491
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x4007B03")]
private DerObjectIdentifier contentType;
// Token: 0x04007B04 RID: 31492
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x4007B04")]
private IDigestCalculator digestCalculator;
// Token: 0x04007B05 RID: 31493
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x4007B05")]
private byte[] resultDigest;
// Token: 0x04007B06 RID: 31494
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x4007B06")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttributeTable;
// Token: 0x04007B07 RID: 31495
[FieldOffset(Offset = "0x70")]
[Token(Token = "0x4007B07")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributeTable;
// Token: 0x04007B08 RID: 31496
[FieldOffset(Offset = "0x78")]
[Token(Token = "0x4007B08")]
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: 0x02001E4D RID: 7757
[Token(Token = "0x2001E4D")]
public class SignerInformationStore
{
// Token: 0x0600C298 RID: 49816 RVA: 0x002C02A0 File Offset: 0x002BE4A0
[Token(Token = "0x600C298")]
[Address(RVA = "0x2936070", Offset = "0x2935070", VA = "0x182936070")]
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: 0x0600C299 RID: 49817 RVA: 0x002C02E8 File Offset: 0x002BE4E8
[Token(Token = "0x600C299")]
[Address(RVA = "0x2935DB0", Offset = "0x2934DB0", VA = "0x182935DB0")]
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: 0x0600C29A RID: 49818 RVA: 0x002C0370 File Offset: 0x002BE570
[Token(Token = "0x600C29A")]
[Address(RVA = "0x2935B70", Offset = "0x2934B70", VA = "0x182935B70")]
public SignerInformation GetFirstSigner(SignerID selector)
{
IDictionary dictionary;
do
{
dictionary = this.table;
}
while (dictionary == 0);
throw new NullReferenceException();
}
// Token: 0x17001E30 RID: 7728
// (get) Token: 0x0600C29B RID: 49819 RVA: 0x002C0394 File Offset: 0x002BE594
[Token(Token = "0x17001E30")]
public int Count
{
[Token(Token = "0x600C29B")]
[Address(RVA = "0x2936140", Offset = "0x2935140", VA = "0x182936140")]
get
{
IList list = this.all;
throw new NullReferenceException();
}
}
// Token: 0x0600C29C RID: 49820 RVA: 0x002C03B0 File Offset: 0x002BE5B0
[Token(Token = "0x600C29C")]
[Address(RVA = "0x2935C60", Offset = "0x2934C60", VA = "0x182935C60")]
public ICollection GetSigners()
{
/*
An exception occurred when decompiling this method (0600C29C)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Collections.ICollection BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformationStore::GetSigners()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:IList(var_0_0B, call:IList(Platform::CreateArrayList, ldfld:IList[exp:ICollection](SignerInformationStore::all, ldloc:SignerInformationStore(this))))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600C29D RID: 49821 RVA: 0x002C03C8 File Offset: 0x002BE5C8
[Token(Token = "0x600C29D")]
[Address(RVA = "0x2935CC0", Offset = "0x2934CC0", VA = "0x182935CC0")]
public ICollection GetSigners(SignerID selector)
{
IDictionary dictionary = this.table;
IList list = Platform.CreateArrayList();
throw new NullReferenceException();
}
// Token: 0x04007B09 RID: 31497
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007B09")]
private readonly IList all;
// Token: 0x04007B0A RID: 31498
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007B0A")]
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: 0x02001E4E RID: 7758
[Token(Token = "0x2001E4E")]
public class SimpleAttributeTableGenerator : CmsAttributeTableGenerator
{
// Token: 0x0600C29E RID: 49822 RVA: 0x002C03EC File Offset: 0x002BE5EC
[Token(Token = "0x600C29E")]
[Address(RVA = "0x493D90", Offset = "0x492D90", VA = "0x180493D90")]
public SimpleAttributeTableGenerator(AttributeTable attributes)
{
this.attributes = attributes;
}
// Token: 0x0600C29F RID: 49823 RVA: 0x002C0408 File Offset: 0x002BE608
[Token(Token = "0x600C29F")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530", Slot = "5")]
public virtual AttributeTable GetAttributes(IDictionary parameters)
{
return this.attributes;
}
// Token: 0x04007B0B RID: 31499
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007B0B")]
private readonly AttributeTable attributes;
}
}