263 lines
7.9 KiB
C#
263 lines
7.9 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 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;
|
|
}
|
|
}
|