A rusty dynohub isn't necessarily a dead dynohub. Magnets and armatures can often be freed off and working perfectly again with some WD40 and gentle persuasion. Don't separate them though or they may never work again. Rusted chrome can be rubbed down and painted. Black looks good. This is not for the restoration purist though.
If you are offered a Sturmey Archer Dynohub that turns and you can feel a strong regular pulse, the chances are that it will generate electricity correctly and it will be worth buying if the price is low enough. If the pulse is very weak or non-existent it is unlikely to work.