I generate a pair of keys using openssl:
shell> ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/Users/mike
You can get the public key in a more standardized format using phpseclib, a pure PHP RSA implementation. eg.
loadKey(array('n' => $modulus, 'e' => $exponent)); $rsa->setPublicKey(); echo $rsa->getPublicKey();