[VB6 equivalent: RSA_MakeKeys
]
Dim nRet As Integer
Dim sPublicKeyFile As String
Dim sPrivateKeyFile As String
Dim sPassword As String
sPublicKeyFile = "mykey.pub"
sPrivateKeyFile = "mykey.p8e"
sPassword = "password"
' Create a new pair of RSA keys saved as BER-encoded files
Console.WriteLine("About to create a new RSA key pair...")
nRet = Rsa.MakeKeys(sPublicKeyFile, sPrivateKeyFile, 512, Rsa.PublicExponent.Exp_EQ_3, _
1000, sPassword, Rsa.PbeOptions.PbeWithMD5AndDES_CBC, False)
Console.WriteLine("RSA_MakeKeys returns " & nRet & " (expected 0)")
See Also:
Rsa.MakeKeys Method (String, String, Int32, Rsa.PublicExponent, Int32, String, CipherAlgorithm, HashAlgorithm, Rsa.Format, Boolean)
Rsa.MakeKeys Method (String, String, Int32, Rsa.PublicExponent, Int32, String, Rsa.PbeOptions, Boolean, Byte[])