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

package org.bouncycastle.jcajce.spec;

import org.bouncycastle.util.Arrays;
import java.security.spec.KeySpec;

public class MLDSAPrivateKeySpec implements KeySpec
{
    private final byte[] data;
    private final byte[] publicData;
    private final MLDSAParameterSpec params;
    private final boolean isSeed;
    
    public MLDSAPrivateKeySpec(final MLDSAParameterSpec params, final byte[] array) {
        if (array.length != 32) {
            throw new IllegalArgumentException("incorrect length for seed");
        }
        this.isSeed = true;
        this.params = params;
        this.data = Arrays.clone(array);
        this.publicData = null;
    }
    
    public MLDSAPrivateKeySpec(final MLDSAParameterSpec params, final byte[] array, final byte[] array2) {
        this.isSeed = false;
        this.params = params;
        this.data = Arrays.clone(array);
        this.publicData = Arrays.clone(array2);
    }
    
    public boolean isSeed() {
        return this.isSeed;
    }
    
    public MLDSAParameterSpec getParameterSpec() {
        return this.params;
    }
    
    public byte[] getSeed() {
        if (this.isSeed()) {
            return Arrays.clone(this.data);
        }
        throw new IllegalStateException("KeySpec represents long form");
    }
    
    public byte[] getPrivateData() {
        if (!this.isSeed()) {
            return Arrays.clone(this.data);
        }
        throw new IllegalStateException("KeySpec represents seed");
    }
    
    public byte[] getPublicData() {
        if (!this.isSeed()) {
            return Arrays.clone(this.publicData);
        }
        throw new IllegalStateException("KeySpec represents long form");
    }
}
