EasyByte Software

Welcome to EasyByte Software

Home Buy Online Products Downloads Support
ASP and dotNET
Further Information



PGPGenKeys Method

Cryptocx v7 User Guide


PGPGenKeys Method

This is the method that you use to generate a public - private key pair. The keys are placed in their respective key rings, the public keyring and the secret keyring.



Generates a new public/private key pair and stores them in their respective keyrings in the keyfolder that you specify.


x = object.PGPGenKeys

The syntax of the PGPGenKeys method has these parts:

Part Description
x A string that becomes either "TRUE" or "Error: xxx" where xxx is the error message.
object A Cryptocx v7 control.

Remarks If for whatever reason the method fails to complete, the method will return some text stating exactly what has gone wrong.

Once some keys have been generated they cannot be modified in the keyring, you can only create new keys with different user id's.


When generating new keys you must specify the Password that the new key should have.

You must also specify the KeyID that the new key should have. The KeyId is how you refer to the key in future.

You also need to specify the KeySize of the new keys. This is the strength of the keys, the higher the KeySize you use the stronger the encryption will be, but also slower. You can specify 1024 -> 4096 for the keysize.

You need to specify the KeyFolder, this is the directory which will contain the new public/private keyrings if they do not already exist, or will contain the existing keyrings that the new keys will be added to.

You must also specify the KeyType of the new keys. This is either "RSA" or "DH/DSS"



Example Sample Visual Basic Code to generate a key pair:


Where Cryptocx1 is an instance of a Cryptocx Control.

'' Set the properties of the Cryptocx control and then generate the keys

Cryptocx1.Password = "mypassword"
Cryptocx1.KeyID = "mynewkey"
Cryptocx1.KeySize = "1024"
Cryptocx1.KeyType = "RSA"
Cryptocx1.KeyFolder = "c:\rings\"

'' Do the key generation. x will be set to any error messages if there was a problem
'' during the key generation phase.

x = Cryptocx1.PGPGenKeys





Back to Contents Page


Click here to set this great site as your home page

Or click here to add it to your Favorites.


Copyright (c) EasyByte Software 1998-2008, info@easybyte.com