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

package org.bouncycastle.cert.cmp;

import org.bouncycastle.asn1.cmp.PKIBody;
import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.cmp.POPODecKeyRespContent;

public class POPODecryptionKeyResponseContent
{
    private final POPODecKeyRespContent respContent;
    
    POPODecryptionKeyResponseContent(final POPODecKeyRespContent respContent) {
        this.respContent = respContent;
    }
    
    public byte[][] getResponses() {
        final ASN1Integer[] asn1IntegerArray = this.respContent.toASN1IntegerArray();
        final byte[][] array = new byte[asn1IntegerArray.length][];
        for (int i = 0; i != asn1IntegerArray.length; ++i) {
            array[i] = asn1IntegerArray[i].getValue().toByteArray();
        }
        return array;
    }
    
    public static POPODecryptionKeyResponseContent fromPKIBody(final PKIBody pkiBody) {
        if (pkiBody.getType() != 6) {
            throw new IllegalArgumentException("content of PKIBody wrong type: " + pkiBody.getType());
        }
        return new POPODecryptionKeyResponseContent(POPODecKeyRespContent.getInstance(pkiBody.getContent()));
    }
    
    public POPODecKeyRespContent toASN1Structure() {
        return this.respContent;
    }
}
