Export (0) Print
Expand All

RSA.FromXmlString Method

Initializes an RSA object from the key information from an XML string.

Namespace:  System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

public override void FromXmlString(
	string xmlString
)

Parameters

xmlString
Type: System.String
The XML string containing RSA key information.

ExceptionCondition
ArgumentNullException

The xmlString parameter is null.

CryptographicException

The format of the xmlString parameter is not valid.

The FromXmlString initializes an RSA object using key information in an XML string that was generated using the ToXmlString method. The FromXmlString method accepts either an XML string containing a public key or an XML string containing a public and private key.

Use the FromXmlString method to conveniently initialize RSA key information.

Caution noteCaution

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.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft