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

package org.bouncycastle.asn1.ocsp;

import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1Object;

public class ResponseBytes extends ASN1Object
{
    ASN1ObjectIdentifier responseType;
    ASN1OctetString response;
    
    public ResponseBytes(final ASN1ObjectIdentifier responseType, final ASN1OctetString response) {
        this.responseType = responseType;
        this.response = response;
    }
    
    private ResponseBytes(final ASN1Sequence asn1Sequence) {
        this.responseType = (ASN1ObjectIdentifier)asn1Sequence.getObjectAt(0);
        this.response = (ASN1OctetString)asn1Sequence.getObjectAt(1);
    }
    
    public static ResponseBytes getInstance(final ASN1TaggedObject asn1TaggedObject, final boolean b) {
        return getInstance(ASN1Sequence.getInstance(asn1TaggedObject, b));
    }
    
    public static ResponseBytes getInstance(final Object o) {
        if (o instanceof ResponseBytes) {
            return (ResponseBytes)o;
        }
        if (o != null) {
            return new ResponseBytes(ASN1Sequence.getInstance(o));
        }
        return null;
    }
    
    public ASN1ObjectIdentifier getResponseType() {
        return this.responseType;
    }
    
    public ASN1OctetString getResponse() {
        return this.response;
    }
    
    @Override
    public ASN1Primitive toASN1Primitive() {
        return new DERSequence(this.responseType, this.response);
    }
}
