int dwKeySize = 384 ;
bool exportPrivateKey = true ;
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider( dwKeySize );
using( StreamWriter sw = new StreamWriter( "RSAParameters.xml" ) )
{
sw.Write( rsa.ToXmlString( exportPrivateKey ) );
sw.Close();
}
Format .Net System.Security.Cryptography.RSACryptoServiceProvider.ToXmlString() :
Private:
3XGodAOyDWfoGGMelpKft1Wx1E15m5yot4Rj0ppWpa/wTaHcudYfl+VIq+0EaC4N
AQAB
+dhBWqM/4f1FBB3dP2fqKfhRnsfGqgTz
4uZIM7QCetizjB9PGLoLcLIM2f1vDcD/
U2mXqCMImPJtsEooK5sN2qVE2rXn5atx
xblS9etJte+dFuA5txx4163w0Q2udtfV
3q9gba8r1cFdsp/0uAYO3aVn7gnwqCPG
W9XmAW8C6XJdG7gHmHRoTlT4sc4Lj9BwliwVb9fN0sSqbF4UlABupXlIZTyuCBS1
Public only:
t6yVboVvHOyCpOH7/hdA2cRlmkDoMZJc3cC72PpakR2/7dbq9Lqc1a+MY09sOMDH
AQAB