CryptoSys PKI Toolkit Manual

Example: Rsa.MakeKeys  Rsa.PbeOptions  Rsa.PublicExponent 

[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.epk"
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)
Rsa.MakeKeys Method (String, String, Int32, Rsa.PublicExponent, Int32, String, Rsa.PbeOptions, Boolean, Byte[])

[Contents] [Index]

[HOME]   [NEXT: Example: Rsa.KeyBits ...]

Copyright © 2004-12 D.I. Management Services Pty Ltd. All rights reserved.