Yes it is legal. The President doesn't even personally sign things with a real pen anymore.
"The Electronic Signatures in Global and National Commerce Act was passed to facilitate the use of electronic records and signatures in interstate and foreign commerce by ensuring the validity and legal effect of contracts entered into electronically."
http://en.wikipedia.org/wiki/Electronic_signature