CryptoSys PKI Pro 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.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[])

[Contents] [Index]

[PREV: Example: Rsa.CheckKey ...]   [Contents]   [Index]   
   [NEXT: Example: Rsa.KeyBits ...]

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