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: 0x02001D5C RID: 7516
|
|
[Token(Token = "0x2001D5C")]
|
|
public class KeyTransRecipientInformation : RecipientInformation
|
|
{
|
|
// Token: 0x0600BE65 RID: 48741 RVA: 0x002B6160 File Offset: 0x002B4360
|
|
[Token(Token = "0x600BE65")]
|
|
[Address(RVA = "0x20119B0", Offset = "0x20107B0", VA = "0x1820119B0")]
|
|
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: 0x0600BE66 RID: 48742 RVA: 0x002B6238 File Offset: 0x002B4438
|
|
[Token(Token = "0x600BE66")]
|
|
[Address(RVA = "0x2011620", Offset = "0x2010420", VA = "0x182011620")]
|
|
private string GetExchangeEncryptionAlgorithmName(DerObjectIdentifier oid)
|
|
{
|
|
DerObjectIdentifier rsaEncryption = PkcsObjectIdentifiers.RsaEncryption;
|
|
return oid.identifier;
|
|
}
|
|
|
|
// Token: 0x0600BE67 RID: 48743 RVA: 0x002B6260 File Offset: 0x002B4460
|
|
[Token(Token = "0x600BE67")]
|
|
[Address(RVA = "0x20116C0", Offset = "0x20104C0", VA = "0x1820116C0")]
|
|
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: 0x0600BE68 RID: 48744 RVA: 0x002B62B4 File Offset: 0x002B44B4
|
|
[Token(Token = "0x600BE68")]
|
|
[Address(RVA = "0x20115F0", Offset = "0x20103F0", VA = "0x1820115F0", Slot = "4")]
|
|
public override CmsTypedStream GetContentStream(ICipherParameters key)
|
|
{
|
|
KeyParameter keyParameter = this.UnwrapKey(key);
|
|
return base.GetContentFromSessionKey(keyParameter);
|
|
}
|
|
|
|
// Token: 0x04007928 RID: 31016
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4007928")]
|
|
private KeyTransRecipientInfo info;
|
|
}
|
|
}
|