187 lines
5.8 KiB
C#
187 lines
5.8 KiB
C#
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;
|
|
}
|
|
}
|