OtherRecipientInfo
using System;
namespace Org.BouncyCastle.Asn1.Cms
{
public class OtherRecipientInfo : Asn1Encodable
{
private readonly DerObjectIdentifier m_oriType;
private readonly Asn1Encodable m_oriValue;
public virtual DerObjectIdentifier OriType => m_oriType;
public virtual Asn1Encodable OriValue => m_oriValue;
public static OtherRecipientInfo GetInstance(object obj)
{
if (obj == null)
return null;
OtherRecipientInfo otherRecipientInfo = obj as OtherRecipientInfo;
if (otherRecipientInfo != null)
return otherRecipientInfo;
return new OtherRecipientInfo(Asn1Sequence.GetInstance(obj));
}
public static OtherRecipientInfo GetInstance(Asn1TaggedObject obj, bool explicitly)
{
return new OtherRecipientInfo(Asn1Sequence.GetInstance(obj, explicitly));
}
public static OtherRecipientInfo GetTagged(Asn1TaggedObject taggedObject, bool declaredExplicit)
{
return new OtherRecipientInfo(Asn1Sequence.GetTagged(taggedObject, declaredExplicit));
}
public OtherRecipientInfo(DerObjectIdentifier oriType, Asn1Encodable oriValue)
{
if (oriType == null)
throw new ArgumentNullException("oriType");
m_oriType = oriType;
if (oriValue == null)
throw new ArgumentNullException("oriValue");
m_oriValue = oriValue;
}
private OtherRecipientInfo(Asn1Sequence seq)
{
int count = seq.Count;
if (count != 2)
throw new ArgumentException("Bad sequence size: " + count.ToString(), "seq");
m_oriType = DerObjectIdentifier.GetInstance(seq[0]);
m_oriValue = seq[1];
}
public override Asn1Object ToAsn1Object()
{
return new DerSequence(m_oriType, m_oriValue);
}
}
}