BaseAlgorithmParameters.java revision a198e1ecc615e26a167d0f2dca9fa7e5fc62de10
1package org.bouncycastle.jcajce.provider.symmetric.util;
2
3import java.security.AlgorithmParametersSpi;
4import java.security.spec.AlgorithmParameterSpec;
5import java.security.spec.InvalidParameterSpecException;
6
7public abstract class BaseAlgorithmParameters
8    extends AlgorithmParametersSpi
9{
10    protected boolean isASN1FormatString(String format)
11    {
12        return format == null || format.equals("ASN.1");
13    }
14
15    protected AlgorithmParameterSpec engineGetParameterSpec(
16        Class paramSpec)
17        throws InvalidParameterSpecException
18    {
19        if (paramSpec == null)
20        {
21            throw new NullPointerException("argument to getParameterSpec must not be null");
22        }
23
24        return localEngineGetParameterSpec(paramSpec);
25    }
26
27    protected abstract AlgorithmParameterSpec localEngineGetParameterSpec(Class paramSpec)
28        throws InvalidParameterSpecException;
29}
30