Add support for KeyGenerator iterations variable (resolves #3363)