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

package org.bouncycastle.crypto.params;

import org.bouncycastle.util.Arrays;
import org.bouncycastle.crypto.CipherParameters;

public class ParametersWithContext implements CipherParameters
{
    private CipherParameters parameters;
    private byte[] context;
    
    public ParametersWithContext(final CipherParameters parameters, final byte[] array) {
        if (array == null) {
            throw new NullPointerException("'context' cannot be null");
        }
        this.parameters = parameters;
        this.context = Arrays.clone(array);
    }
    
    public void copyContextTo(final byte[] array, final int n, final int n2) {
        if (this.context.length != n2) {
            throw new IllegalArgumentException("len");
        }
        System.arraycopy(this.context, 0, array, n, n2);
    }
    
    public byte[] getContext() {
        return Arrays.clone(this.context);
    }
    
    public int getContextLength() {
        return this.context.length;
    }
    
    public CipherParameters getParameters() {
        return this.parameters;
    }
}
