If someone had a list of all primes, would it be possible for them to factor any integer in polynomial time? For example, if they somehow got a function that would churn out any arbitrary amount of primes in a row. Could they break the RSA problem then?
Mathematically, yes, it will work. Practically, you will require an extremely very long time and an incredible amount of energy, considering the sizes of the primes  involved in RSA (usually around 1024-bit prime numbers). It is about billion and billions of years and billions and billions times the energy of the whole universe (RSA: How effective is this keypair-trash attack)