CryptoSys PKI Pro Manual

Example: Rsa.KeyBits  Rsa.ReadPrivateKey  Rsa.ToXMLString  Rsa.XmlOptions 

[VB6 equivalent: RSA_ToXMLString]

Dim strEPKFile As String
Dim strPassword As String
Dim strPrivateKey As String
Dim strXML As String

strEPKFile = "AlicePrivRSASign.p8e"
strPassword = "password"

' Read in the deciphered private key string in our internal format
strPrivateKey = Rsa.ReadPrivateKey(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 (String, Rsa.XmlOptions)

[Contents] [Index]

[PREV: Example: Rsa.Format ...]   [Contents]   [Index]   
   [NEXT: Example: Tdea.B64Mode ...]

Copyright © 2004-23 D.I. Management Services Pty Ltd. All rights reserved. Generated 2023-09-18T10:02:53Z.