DhbmParameter
using Org.BouncyCastle.Asn1.X509;
using System;
namespace Org.BouncyCastle.Asn1.Cmp
{
public class DhbmParameter : Asn1Encodable
{
private readonly AlgorithmIdentifier m_owf;
private readonly AlgorithmIdentifier m_mac;
public virtual AlgorithmIdentifier Owf => m_owf;
public virtual AlgorithmIdentifier Mac => m_mac;
public static DhbmParameter GetInstance(object obj)
{
if (obj == null)
return null;
DhbmParameter dhbmParameter = obj as DhbmParameter;
if (dhbmParameter != null)
return dhbmParameter;
return new DhbmParameter(Asn1Sequence.GetInstance(obj));
}
public static DhbmParameter GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
{
return new DhbmParameter(Asn1Sequence.GetInstance(taggedObject, declaredExplicit));
}
public static DhbmParameter GetTagged(Asn1TaggedObject taggedObject, bool declaredExplicit)
{
return new DhbmParameter(Asn1Sequence.GetTagged(taggedObject, declaredExplicit));
}
private DhbmParameter(Asn1Sequence seq)
{
int count = seq.Count;
if (count != 2)
throw new ArgumentException("Bad sequence size: " + count.ToString(), "seq");
m_owf = AlgorithmIdentifier.GetInstance(seq[0]);
m_mac = AlgorithmIdentifier.GetInstance(seq[1]);
}
public DhbmParameter(AlgorithmIdentifier owf, AlgorithmIdentifier mac)
{
if (owf == null)
throw new ArgumentNullException("owf");
m_owf = owf;
if (mac == null)
throw new ArgumentNullException("mac");
m_mac = mac;
}
public override Asn1Object ToAsn1Object()
{
return new DerSequence(m_owf, m_mac);
}
}
}