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

package org.bouncycastle.jcajce.provider.asymmetric;

import org.bouncycastle.jcajce.provider.config.ConfigurableProvider;
import org.bouncycastle.jcajce.provider.util.AsymmetricAlgorithmProvider;
import java.io.IOException;
import java.security.spec.InvalidParameterSpecException;
import java.security.spec.AlgorithmParameterSpec;
import org.bouncycastle.jcajce.spec.ContextParameterSpec;
import java.security.AlgorithmParametersSpi;

public class CONTEXT
{
    private static final String PREFIX = "org.bouncycastle.jcajce.provider.asymmetric.CONTEXT$";
    
    public static class ContextAlgorithmParametersSpi extends AlgorithmParametersSpi
    {
        private ContextParameterSpec contextParameterSpec;
        
        protected boolean isASN1FormatString(final String s) {
            return s == null || s.equals("ASN.1");
        }
        
        @Override
        protected AlgorithmParameterSpec engineGetParameterSpec(final Class clazz) throws InvalidParameterSpecException {
            if (clazz == null) {
                throw new NullPointerException("argument to getParameterSpec must not be null");
            }
            if (clazz != ContextParameterSpec.class) {
                throw new IllegalArgumentException("argument to getParameterSpec must be ContextParameterSpec.class");
            }
            return this.contextParameterSpec;
        }
        
        @Override
        protected void engineInit(final AlgorithmParameterSpec algorithmParameterSpec) throws InvalidParameterSpecException {
            if (!(algorithmParameterSpec instanceof ContextParameterSpec)) {
                throw new IllegalArgumentException("argument to engineInit must be a ContextParameterSpec");
            }
            this.contextParameterSpec = (ContextParameterSpec)algorithmParameterSpec;
        }
        
        @Override
        protected void engineInit(final byte[] array) throws IOException {
            throw new IllegalStateException("not implemented");
        }
        
        @Override
        protected void engineInit(final byte[] array, final String s) throws IOException {
            throw new IllegalStateException("not implemented");
        }
        
        @Override
        protected byte[] engineGetEncoded() throws IOException {
            throw new IllegalStateException("not implemented");
        }
        
        @Override
        protected byte[] engineGetEncoded(final String s) throws IOException {
            throw new IllegalStateException("not implemented");
        }
        
        @Override
        protected String engineToString() {
            return "ContextParameterSpec";
        }
    }
    
    public static class Mappings extends AsymmetricAlgorithmProvider
    {
        @Override
        public void configure(final ConfigurableProvider configurableProvider) {
            configurableProvider.addAlgorithm("AlgorithmParameters.CONTEXT", "org.bouncycastle.jcajce.provider.asymmetric.CONTEXT$ContextAlgorithmParametersSpi");
        }
    }
}
