75 lines
2.7 KiB
C#
75 lines
2.7 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.Crypto;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
|
|
{
|
|
// Token: 0x02001D63 RID: 7523
|
|
[Token(Token = "0x2001D63")]
|
|
public class PasswordRecipientInformation : RecipientInformation
|
|
{
|
|
// Token: 0x0600BE84 RID: 48772 RVA: 0x002B6858 File Offset: 0x002B4A58
|
|
[Token(Token = "0x600BE84")]
|
|
[Address(RVA = "0x2012EC0", Offset = "0x2011CC0", VA = "0x182012EC0")]
|
|
internal PasswordRecipientInformation(PasswordRecipientInfo info, CmsSecureReadable secureReadable)
|
|
{
|
|
AlgorithmIdentifier keyEncryptionAlgorithm = info.keyEncryptionAlgorithm;
|
|
base..ctor(keyEncryptionAlgorithm, secureReadable);
|
|
this.info = info;
|
|
RecipientID recipientID = new RecipientID();
|
|
this.rid = recipientID;
|
|
}
|
|
|
|
// Token: 0x17001D7F RID: 7551
|
|
// (get) Token: 0x0600BE85 RID: 48773 RVA: 0x002B6890 File Offset: 0x002B4A90
|
|
[Token(Token = "0x17001D7F")]
|
|
public virtual AlgorithmIdentifier KeyDerivationAlgorithm
|
|
{
|
|
[Token(Token = "0x600BE85")]
|
|
[Address(RVA = "0x420450", Offset = "0x41F250", VA = "0x180420450", Slot = "5")]
|
|
get
|
|
{
|
|
return this.info.keyDerivationAlgorithm;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BE86 RID: 48774 RVA: 0x002B68B0 File Offset: 0x002B4AB0
|
|
[Token(Token = "0x600BE86")]
|
|
[Address(RVA = "0x2012A90", Offset = "0x2011890", VA = "0x182012A90", Slot = "4")]
|
|
public override CmsTypedStream GetContentStream(ICipherParameters key)
|
|
{
|
|
DerObjectIdentifier objectID = AlgorithmIdentifier.GetInstance(this.info.keyEncryptionAlgorithm).ObjectID;
|
|
Stream octetStream = this.info.encryptedKey.GetOctetStream();
|
|
if (objectID == 0)
|
|
{
|
|
throw new NullReferenceException();
|
|
}
|
|
DerObjectIdentifier derObjectIdentifier;
|
|
string identifier = derObjectIdentifier.identifier;
|
|
CmsEnvelopedHelper instance = CmsEnvelopedHelper.Instance;
|
|
IWrapper wrapper = WrapperUtilities.GetWrapper(instance.GetRfc3211WrapperName(identifier));
|
|
Asn1OctetString asn1OctetString;
|
|
Stream octetStream2 = asn1OctetString.GetOctetStream();
|
|
if (key != 0 && key != 0)
|
|
{
|
|
string contentAlgorithmName = base.GetContentAlgorithmName();
|
|
AlgorithmIdentifier keyEncAlg = this.keyEncAlg;
|
|
KeyParameter keyParameter;
|
|
return base.GetContentFromSessionKey(keyParameter);
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x04007930 RID: 31024
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4007930")]
|
|
private readonly PasswordRecipientInfo info;
|
|
}
|
|
}
|