// 
// Decompiled by Procyon v0.6.0
// 

package org.bouncycastle.asn1.cmp;

import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
import org.bouncycastle.asn1.ASN1Object;

public class DHBMParameter extends ASN1Object
{
    private final AlgorithmIdentifier owf;
    private final AlgorithmIdentifier mac;
    
    private DHBMParameter(final ASN1Sequence asn1Sequence) {
        if (asn1Sequence.size() != 2) {
            throw new IllegalArgumentException("expecting sequence size of 2");
        }
        this.owf = AlgorithmIdentifier.getInstance(asn1Sequence.getObjectAt(0));
        this.mac = AlgorithmIdentifier.getInstance(asn1Sequence.getObjectAt(1));
    }
    
    public DHBMParameter(final AlgorithmIdentifier owf, final AlgorithmIdentifier mac) {
        this.owf = owf;
        this.mac = mac;
    }
    
    public static DHBMParameter getInstance(final Object o) {
        if (o instanceof DHBMParameter) {
            return (DHBMParameter)o;
        }
        if (o != null) {
            return new DHBMParameter(ASN1Sequence.getInstance(o));
        }
        return null;
    }
    
    public AlgorithmIdentifier getOwf() {
        return this.owf;
    }
    
    public AlgorithmIdentifier getMac() {
        return this.mac;
    }
    
    @Override
    public ASN1Primitive toASN1Primitive() {
        return new DERSequence(new ASN1Encodable[] { this.owf, this.mac });
    }
}
