OtherRevVals
using System;
namespace Org.BouncyCastle.Asn1.Esf
{
public class OtherRevVals : Asn1Encodable
{
private readonly DerObjectIdentifier m_otherRevValType;
private readonly Asn1Encodable m_otherRevVals;
public DerObjectIdentifier OtherRevValType => m_otherRevValType;
public Asn1Encodable OtherRevValsData => m_otherRevVals;
[Obsolete("Use 'OtherRevValsData' instead")]
public Asn1Object OtherRevValsObject {
get {
return m_otherRevVals.ToAsn1Object();
}
}
public static OtherRevVals GetInstance(object obj)
{
if (obj == null)
return null;
OtherRevVals otherRevVals = obj as OtherRevVals;
if (otherRevVals != null)
return otherRevVals;
return new OtherRevVals(Asn1Sequence.GetInstance(obj));
}
public static OtherRevVals GetInstance(Asn1TaggedObject obj, bool explicitly)
{
return new OtherRevVals(Asn1Sequence.GetInstance(obj, explicitly));
}
public static OtherRevVals GetTagged(Asn1TaggedObject taggedObject, bool declaredExplicit)
{
return new OtherRevVals(Asn1Sequence.GetTagged(taggedObject, declaredExplicit));
}
private OtherRevVals(Asn1Sequence seq)
{
int count = seq.Count;
if (count != 2)
throw new ArgumentException("Bad sequence size: " + count.ToString(), "seq");
m_otherRevValType = DerObjectIdentifier.GetInstance(seq[0]);
m_otherRevVals = seq[1];
}
public OtherRevVals(DerObjectIdentifier otherRevValType, Asn1Encodable otherRevVals)
{
if (otherRevValType == null)
throw new ArgumentNullException("otherRevValType");
m_otherRevValType = otherRevValType;
if (otherRevVals == null)
throw new ArgumentNullException("otherRevVals");
m_otherRevVals = otherRevVals;
}
public override Asn1Object ToAsn1Object()
{
return new DerSequence(m_otherRevValType, m_otherRevVals);
}
}
}