143 lines
4.9 KiB
C#
143 lines
4.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 Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
|
|
{
|
|
// Token: 0x02001D33 RID: 7475
|
|
[Token(Token = "0x2001D33")]
|
|
public class CmsEnvelopedData
|
|
{
|
|
// Token: 0x0600BD2A RID: 48426 RVA: 0x002B088C File Offset: 0x002AEA8C
|
|
[Token(Token = "0x600BD2A")]
|
|
[Address(RVA = "0x1664730", Offset = "0x1663530", VA = "0x181664730")]
|
|
public CmsEnvelopedData(byte[] envelopedData)
|
|
{
|
|
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(envelopedData);
|
|
}
|
|
|
|
// Token: 0x0600BD2B RID: 48427 RVA: 0x002B08A0 File Offset: 0x002AEAA0
|
|
[Token(Token = "0x600BD2B")]
|
|
[Address(RVA = "0x16645C0", Offset = "0x16633C0", VA = "0x1816645C0")]
|
|
public CmsEnvelopedData(Stream envelopedData)
|
|
{
|
|
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(envelopedData);
|
|
}
|
|
|
|
// Token: 0x0600BD2C RID: 48428 RVA: 0x002B08B4 File Offset: 0x002AEAB4
|
|
[Token(Token = "0x600BD2C")]
|
|
[Address(RVA = "0x16645F0", Offset = "0x16633F0", VA = "0x1816645F0")]
|
|
public CmsEnvelopedData(ContentInfo contentInfo)
|
|
{
|
|
this.contentInfo = contentInfo;
|
|
EnvelopedData instance = EnvelopedData.GetInstance(contentInfo.content);
|
|
Asn1Set recipientInfos = instance.recipientInfos;
|
|
EncryptedContentInfo encryptedContentInfo = instance.encryptedContentInfo;
|
|
AlgorithmIdentifier contentEncryptionAlgorithm = encryptedContentInfo.contentEncryptionAlgorithm;
|
|
this.encAlg = contentEncryptionAlgorithm;
|
|
Stream octetStream = encryptedContentInfo.encryptedContent.GetOctetStream();
|
|
CmsProcessableByteArray cmsProcessableByteArray;
|
|
cmsProcessableByteArray.bytes = octetStream;
|
|
AlgorithmIdentifier algorithmIdentifier = this.encAlg;
|
|
CmsEnvelopedHelper.CmsEnvelopedSecureReadable cmsEnvelopedSecureReadable;
|
|
cmsEnvelopedSecureReadable.readable = cmsProcessableByteArray;
|
|
cmsEnvelopedSecureReadable.algorithm = algorithmIdentifier;
|
|
RecipientInformationStore recipientInformationStore = CmsEnvelopedHelper.BuildRecipientInformationStore(recipientInfos, cmsEnvelopedSecureReadable);
|
|
this.recipientInfoStore = recipientInformationStore;
|
|
Asn1Set unprotectedAttrs = instance.unprotectedAttrs;
|
|
this.unprotectedAttributes = unprotectedAttrs;
|
|
}
|
|
|
|
// Token: 0x17001D4E RID: 7502
|
|
// (get) Token: 0x0600BD2D RID: 48429 RVA: 0x002B0950 File Offset: 0x002AEB50
|
|
[Token(Token = "0x17001D4E")]
|
|
public AlgorithmIdentifier EncryptionAlgorithmID
|
|
{
|
|
[Token(Token = "0x600BD2D")]
|
|
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
|
|
get
|
|
{
|
|
return this.encAlg;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001D4F RID: 7503
|
|
// (get) Token: 0x0600BD2E RID: 48430 RVA: 0x002B0964 File Offset: 0x002AEB64
|
|
[Token(Token = "0x17001D4F")]
|
|
public string EncryptionAlgOid
|
|
{
|
|
[Token(Token = "0x600BD2E")]
|
|
[Address(RVA = "0x1661330", Offset = "0x1660130", VA = "0x181661330")]
|
|
get
|
|
{
|
|
Asn1Object asn1Object = this.encAlg.ToAsn1Object();
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BD2F RID: 48431 RVA: 0x002B0984 File Offset: 0x002AEB84
|
|
[Token(Token = "0x600BD2F")]
|
|
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
|
|
public RecipientInformationStore GetRecipientInfos()
|
|
{
|
|
return this.recipientInfoStore;
|
|
}
|
|
|
|
// Token: 0x17001D50 RID: 7504
|
|
// (get) Token: 0x0600BD30 RID: 48432 RVA: 0x002B0998 File Offset: 0x002AEB98
|
|
[Token(Token = "0x17001D50")]
|
|
public ContentInfo ContentInfo
|
|
{
|
|
[Token(Token = "0x600BD30")]
|
|
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
|
|
get
|
|
{
|
|
return this.contentInfo;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BD31 RID: 48433 RVA: 0x002B09AC File Offset: 0x002AEBAC
|
|
[Token(Token = "0x600BD31")]
|
|
[Address(RVA = "0x1664550", Offset = "0x1663350", VA = "0x181664550")]
|
|
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable GetUnprotectedAttributes()
|
|
{
|
|
Asn1Set asn1Set = this.unprotectedAttributes;
|
|
if (asn1Set != 0)
|
|
{
|
|
return new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(asn1Set);
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BD32 RID: 48434 RVA: 0x002B09CC File Offset: 0x002AEBCC
|
|
[Token(Token = "0x600BD32")]
|
|
[Address(RVA = "0x1661070", Offset = "0x165FE70", VA = "0x181661070")]
|
|
public byte[] GetEncoded()
|
|
{
|
|
return this.contentInfo.GetEncoded();
|
|
}
|
|
|
|
// Token: 0x04007876 RID: 30838
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4007876")]
|
|
internal RecipientInformationStore recipientInfoStore;
|
|
|
|
// Token: 0x04007877 RID: 30839
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4007877")]
|
|
internal ContentInfo contentInfo;
|
|
|
|
// Token: 0x04007878 RID: 30840
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4007878")]
|
|
private AlgorithmIdentifier encAlg;
|
|
|
|
// Token: 0x04007879 RID: 30841
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4007879")]
|
|
private Asn1Set unprotectedAttributes;
|
|
}
|
|
}
|