RSA.FromXmlString(String) Method

Definition

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

public override void FromXmlString (string xmlString);

Parameters

xmlString
String

The XML string containing RSA key information.

Exceptions

The xmlString parameter is null.

The format of the xmlString parameter is not valid.

.NET Core and .NET 5+ only: In all cases.

Remarks

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.

Varúð

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.

Applies to

Vara Útgáfur
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also