Code example for InvalidKeyException

0
                    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,
        SecureRandom    random)
        throws InvalidKeyException 
    { 
        this.random = random;
        engineInitSign(privateKey);
    }