RSA.ToXmlString Method (Boolean)
Creates and returns an XML string containing the key of the current RSA object.
Assembly: mscorlib (in mscorlib.dll)
true to include a public and private RSA key; false to include only the public key.
Persisting an XML string containing a private key to an insecure location is a security threat. The security of your application can be compromised if a malicious third party can access your private key. To safely persist a private key, use a secure key container. For more information about persisting private keys in a key container, see How to: Store Asymmetric Keys in a Key Container.
When you pass true to themethod, the resulting XML string takes the following form:
<RSAKeyValue> <Modulus>…</Modulus> <Exponent>…</Exponent> <P>…</P> <Q>…</Q> <DP>…</DP> <DQ>…</DQ> <InverseQ>…</InverseQ> <D>…</D> </RSAKeyValue>
When you pass false to themethod, the resulting XML string takes the following form:
<RSAKeyValue> <Modulus>…</Modulus> <Exponent>…</Exponent> </RSAKeyValue>
Available since 1.1
Windows Phone Silverlight
Available since 7.1