Code example for UnrecoverableKeyException

0
            UnrecoverableKeyException { 
        if (password == null) {
            throw new KeyStoreException("Incorrect password");            
        } 
        if (ks == null) {
            throw new UnrecoverableKeyException("Incorrect keystore");
        } 
    } 
 
    protected void engineInit(ManagerFactoryParameters spec)
            throws InvalidAlgorithmParameterException { 
        if (spec == null) {
            throw new InvalidAlgorithmParameterException("Incorrect parameter");
        } 
        if (spec instanceof Parameters) {
            try { 
                engineInit(((Parameters)spec).getKeyStore(),
                        ((Parameters)spec).getPassword());
            } catch (Exception e) {
                throw new InvalidAlgorithmParameterException(e.toString()); 
            }