Is there an faster algorithm to rotate 2 opposite corners? I can't find anything else but doing the sexy move multiple times.
This algorithm can be adapted to do what you need.
F D' F' B F D' F' U' F D F' D' F D F' U
Notation is standard
To deal with non adjacent corners where one corner is on the right hand side of F (corners in a diagonal), rotate U twice instead of once in the algorithm i.e.
F D' F' D F D' F' U2 F D F' D' F D F' U2
If both corners are far opposites (do not share any faces), make sure one corner is on the right hand side of F (as before), rotate L2 and then apply the original algorithm, and rotate L2 to finish.