PollReqContent
using Org.BouncyCastle.Math;
using Org.BouncyCastle.Utilities.Collections;
namespace Org.BouncyCastle.Asn1.Cmp
{
public class PollReqContent : Asn1Encodable
{
private readonly Asn1Sequence m_content;
public static PollReqContent GetInstance(object obj)
{
if (obj == null)
return null;
PollReqContent pollReqContent = obj as PollReqContent;
if (pollReqContent != null)
return pollReqContent;
return new PollReqContent(Asn1Sequence.GetInstance(obj));
}
public static PollReqContent GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
{
return new PollReqContent(Asn1Sequence.GetInstance(taggedObject, declaredExplicit));
}
public static PollReqContent GetTagged(Asn1TaggedObject taggedObject, bool declaredExplicit)
{
return new PollReqContent(Asn1Sequence.GetTagged(taggedObject, declaredExplicit));
}
private PollReqContent(Asn1Sequence seq)
{
m_content = seq;
}
public PollReqContent(DerInteger certReqId)
: this(DerSequence.FromElement(new DerSequence(certReqId)))
{
}
public PollReqContent(DerInteger[] certReqIds)
: this(DerSequence.WithElements(CollectionUtilities.Map(certReqIds, (DerInteger id) => new DerSequence(id))))
{
}
public PollReqContent(BigInteger certReqId)
: this(new DerInteger(certReqId))
{
}
public PollReqContent(BigInteger[] certReqIds)
: this(CollectionUtilities.Map(certReqIds, (BigInteger id) => new DerInteger(id)))
{
}
public virtual DerInteger[][] GetCertReqIDs()
{
return m_content.MapElements((Asn1Encodable element) => Asn1Sequence.GetInstance(element).MapElements(DerInteger.GetInstance));
}
public virtual BigInteger[] GetCertReqIDValues()
{
return m_content.MapElements((Asn1Encodable element) => DerInteger.GetInstance(Asn1Sequence.GetInstance(element)[0]).Value);
}
public override Asn1Object ToAsn1Object()
{
return m_content;
}
}
}