I have two XML files, structured as follows:
My Key
...
..
Since xmlseclibs is PHP it seems like another PHP solution might be desirable. Here's how:
loadKey('
...
...
...
...
...
...
...
...
');
$privatekey = $rsa->getPrivateKey();
$publickey = $rsa->getPublicKey();
?>
phpseclib has built in support for XML keys, PuTTY keys and PKCS1 keys. It'll auto detect the format and load it and getPrivateKey / getPublicKey will output PKCS1 formatted keys by default if no parameters are provided. More info:
http://phpseclib.sourceforge.net/rsa/examples.html#convert