Is it generally possible to generate the corresponding namecoin public key from a bitcoin public key?
I assume you mean namecoin address vs Bitcoin address (public keys are the same for both)
Use my Utility, the Address Utility screen
Put the Bitcoin address in the bottom box and hit the up arrow to get the Hash160
Then switch the selection dropdown from Bitcoin to Namecoin. Then hit the opposite arrow to go from hash160 to address and you will get the namecoin address.
sweet! works like a charm. Had played with your tool just today but did not realize it was so easy.
The reason why I am asking is a sendbtctoname function for namecoin using a shared key. Should be easy to implement.
Found an alternative in the meantime, through sendbtctoalias:
https://bitcointalk.org/index.php?topic=83793.msg1500895#msg1500895