Determine rotation indices when deserializing keys?

When deserializing rotation keys, is there a way to determine which rotation indices are supported by the keys without knowing in advance? I’ve looked at GetExistingEvalAutomorphismKeyIndices(const std::string &keyTag), but it returns the automorphism indices and not the rotation indices. I can find the automorphism index for a given rotation index using FindAutomorphismIndex(const usint idx) const, but I didn’t see a straightforward way to determine the rotation indices from the automorphism indices.

FindAutomorphismIndex converts the rotation index into an automorphism index by raising a certain generator (5) to the rotation index modulo the cyclotomic ring index m=2N, where N is the ring dimension. To reverse that, all you need to do is solving the discrete log problem for a small modulus m, and this should be easy to do.
Alternatively, you can keep a lookup table for rotation and automorphism indices.

Note that the generator OpenFHE uses depends on the FHE scheme used, and the sign of the rotation index, but for your purpose, I think generator 5 should serve your purpose.