Back to product page

ToXmlString method


Creates and returns an XML string representation of the current RSA/DSA key.

Type

None

Syntax

  • Basic
object.ToXmlString(KeyType, IncludePrivate)
The ToXmlString(object,KeyType,IncludePrivate) syntax has these parts:
objectAn expression evaluating to an object of type Keys.
KeyTypeRequired. A SSHKeyTypes enumeration, as described in settings. Type of the key (RSA/DSA).
IncludePrivateRequired. A Boolean value that determine if private key is also exported. If set to False then only public part is exported.

Remarks

The settings for KeyType are:

Constant Value Description
RSAkey 0 Exports RSA key.
DSAkey 1 Exports DSA key.


This method will return XML string expression of public or private RSA/DSA key, so it can be reused by MS NET framework directly.

Platforms

Windows