Code example for InvalidKeyException

0
param = DSAUtil.generatePublicKeyParameter(publicKey);
                } 
                else 
                { 
                    throw new InvalidKeyException("can't recognise key type in DSA based signer");
                } 
            } 
            catch (Exception e)
            { 
                throw new InvalidKeyException("can't recognise key type in DSA based signer");
            } 
        } 
 
        digest.reset();
        signer.init(false, param);
    } 
 
    protected void engineInitSign( 
        PrivateKey      privateKey,