The new law lets the president impose tariffs on the largest purchases of Russian oil and natural gas.