Torque would not necessarily have to be calculated, depending on how the feature is implemented.
As a simple implementation, essentially setting the angle would be physicsless, like rotating a child part (the docked ship) against the parent in the editor. This could be an instantaneous angle change or it could be programmed to slowly rotate into the specified angle.
A more complex implementation would work something like a rotating joint in Infernal Robotics and that would be something that would indeed impart torque to both sides of the connection, possibly stressing or breaking the joint if too much force is applied.
I had not considered trying to rotate a ship docked to the parent at two or more points. It should be fairly straightforward to make a check that would display "Error: Vessel not free to rotate." if more than one connection to the parent exists. You would have to undock ports until only one connection remains in order to rotate by the remaining port.
As far as torque and rotational stresses go, in an orbital vacuum it would only take a small force to slowly rotate even a very large vessel. The larger and more off-center the child structure, however, the longer it would take.
Frankly, even without an explaination in lore (I.E. "small interlocking gears and tracks along the face of the docking port") this would be such a quality of life improvement for building vessels in orbit that it would be a very welcome feature in my opinion.