Code example for UnrecoverableKeyException

0
        if (engineContainsAlias(alias)) {
            if (!engineIsKeyEntry(alias)) {
                if (password == null) {
                    throw new NoSuchAlgorithmException("no such alg");
                } else { 
                    throw new UnrecoverableKeyException();
                } 
                 
            } 
            return (Key) aliases.get(alias);
        } 
         
        throw new UnrecoverableKeyException();
    } 
 
    @Override 
    public boolean engineIsCertificateEntry(String alias) {
        try { 
            Certificate c = (Certificate) aliases.get(alias);
            return true; 
        } catch (ClassCastException e) {