[VB6 equivalent: RSA_ToXMLString]
Dim strEPKFile As String
Dim strPassword As String
Dim strPrivateKey As String
Dim strXML As String
strEPKFile = "AlicePrivRSASign.epk"
strPassword = "password"
' Read in the deciphered private key string in our internal format
strPrivateKey = Rsa.ReadEncPrivateKey(strEPKFile, strPassword).ToString()
If strPrivateKey.Length = 0 Then
Console.WriteLine("Unable to retrieve private key")
Exit Sub
End If
Console.WriteLine("Key size=" & Rsa.KeyBits(strPrivateKey) & " bits")
' Convert to XML
strXML = Rsa.ToXMLString(strPrivateKey, Rsa.XmlOptions.ForceRSAKeyValue)
Console.WriteLine("XML=" & strXML)
See Also:
Rsa.ToXMLString Method