84 lines
3.3 KiB
C#
84 lines
3.3 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.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;
|
|
}
|
|
}
|