Code example for InvalidParameterSpecException

        AlgorithmParameterSpec paramSpec)
        throws InvalidParameterSpecException 
        if (!(paramSpec instanceof DSAParameterSpec))
            throw new InvalidParameterSpecException("DSAParameterSpec required to initialise a DSA algorithm parameters object");
        this.currentSpec = (DSAParameterSpec)paramSpec;
    protected void engineInit( 
        byte[] params)
        throws IOException 
            DSAParameter dsaP = DSAParameter.getInstance(ASN1Primitive.fromByteArray(params));
            currentSpec = new DSAParameterSpec(dsaP.getP(), dsaP.getQ(), dsaP.getG());
Stop searching for code, let great code find you!  Add Codota to your java IDE