Class RSACryptoServiceProviderExtensions
OptimaJet.Workflow.Core.RSACryptoServiceProviderExtensions
Provides helper methods for importing and exporting RSA key data from and to XML.
Namespace: OptimaJet.Workflow.Core
public static class RSACryptoServiceProviderExtensionsMethods
public static void FromXmlString(RSACryptoServiceProvider rsa, string xmlString) #Loads RSA key values from an XML string and assigns them to the specified RSACryptoServiceProvider instance.
Parameters
Name
Type
Description
rsaRSACryptoServiceProviderThe RSA provider that receives the imported key values.
xmlStringStringXML text in
<RSAKeyValue> format that contains RSA key parameter nodes.Exceptions
Type
Description
XmlExceptionThe XML text is not valid XML.
ExceptionThe XML document is not an
<RSAKeyValue> block.FormatExceptionOne or more key node values are not valid Base64 text.
CryptographicExceptionThe imported key parameters are not valid for the provider.
Remarks
The method reads Base64-encoded values from child nodes whose names match
Modulus, Exponent, P, Q, DP, DQ, InverseQ, and D.public static string ToXmlString(RSACryptoServiceProvider rsa) #Exports the RSA parameters from the specified provider as an
<RSAKeyValue> XML string.Parameters
Name
Type
Description
rsaRSACryptoServiceProviderThe RSA provider whose key parameters to serialize.
Returns
Type
Description
StringA string containing RSA key data encoded as an
<RSAKeyValue> XML document.Exceptions
Type
Description
CryptographicExceptionThe RSA parameters cannot be exported.
Remarks
The output includes both public and private parameter elements.
Remarks
This class is intended for working with RSACryptoServiceProvider key XML in the
<RSAKeyValue> format.