Back to product page

FromXmlString method


Reconstructs an RSA/DSA key from an XML string.

Type

None

Syntax

  • Basic
object.FromXmlString XmlData
The FromXmlString(object,XmlData) syntax has these parts:
objectAn expression evaluating to an object of type Keys.
XmlDataRequired. A String value. XML data that represent RSA/DSA key.

Remarks

FromXmlString method will try to decode RSA/DSA key (both public and private, when possible) from given XML string, as it is exported by MS NET framework. Typically, your XML representation of the key will look like this:

<RSAKeyValue><Modulus>ySvYlf2fjZTitchU0XJ4KU1jCy0O2bwaz6K3OK6NiC6Io43H7L7nCFuj+q
FwW9Mrs1CTNp8e5TAsTtAH9PMOixYghWTK8t6EqutyctNa9GEb6qdi6CuPMmF/qMbvu3EtWp80qBgt1l
........
hSE4AeOt6eS5UefNkjuJXPllYKp4znIPcC1eMWYyud6sLbeKYbsMM2e+AOqAloNR0zys9S3rhi5Nj4d+
I65gNXs9C0bNIE=</D></RSAKeyValue>


This method will replace current RSA/DSA key with new one. You can Save this key once it is imported, or can directly use it in your applications.

To convert back to XML format, you can use ToXmlString method.

Platforms

Windows