Back to the Function Reference Table of Contents

User-Interface Dialog Functions


spgpUIRecipientsDialog (PGP 6.x only)

Presents the standard Key Selection dialog, which allows users to select User ID's from a list based on the local key-ring. The function returns the Hex IDs of the selected keys.

Visual Basic declaration:

Declare Function spgpuirecipientsdialog Lib "spgp.dll" (
        ByVal RecipientHexID As String, 
        ByVal RecipientHexIDLen As Long, 
        ByVal Caption As String, 
        ByVal Reserved1 As String, 
        ByVal DisplayMarginalValidity As Long, 
        ByVal Reserved2 As Long, 
        ByVal Reserved3 As Long, 
        ByVal Reserved4 As Long, 
        ByVal Reserved5 As Long, 
        ByVal WindowHandle As Long
        ) As Long

Parameters:
RecipientHexID A fixed-length string which will act as a buffer for output. If the function returns successfully, the buffer will contain a tab-delimited list of Hex IDs corresponding to any keys selected by the user.
RecipientHexIDLen Size of RecipientHexID. If output exceeds RecipientHexIDLen the output will be discarded and the function will return a positive number indicating the size of the output (i.e. the buffer size necessary to hold it).
Caption Caption for the dialog's title bar. If Caption is blank the default will be used.
Reserved1 Reserved for future use.
DisplayMarginalValidity May be 0 (false) or 1 (true). If false, the dialog's "Validity" column will display validity in terms of true (a green disc) or false (a silver disc). If true, grey bars will be used to indicate valid, invalid, and "marginally valid" keys.
Reserved2 Reserved for future use.
Reserved3 Reserved for future use.
Reserved4 Reserved for future use.
Reserved5 Reserved for future use.
WindowHandle Handle to the calling application or window.

Notes and Warnings:

up to the top

spgpUISigningPassphraseDialog

Presents the standard Signing Passphrase dialog, which gives users a list of possible signing keys (i.e., secret keys from the local key-ring) and asks for the passphrase necessary to access the selected secret key. The function returns the Hex ID of the key selected by the user, and the provided passphrase. The dialog confirms that the passphrase is correct for the selected key.

Visual Basic declaration:

Declare Function spgpuisigningpassphrasedialog Lib "spgp.dll" (
        ByVal SelectedKeyHexID As String, 
        ByVal SelectedKeyPass As String, 
        ByVal DefaultKeyID As String, 
        ByVal FindMatchingKey As Long, 
        ByVal WindowHandle As Long
        ) As Long

Parameters:
SelectedKeyHexID A fixed-length string which will act as a buffer for output. If the function returns successfully, the buffer will contain the Hex ID of the secret key selected by the user.
SelectedKeyPass A fixed-length string which will act as a buffer for output. If the function returns successfully, the buffer will contain the passphrase to the secret key selected by the user, as provided by the user and cofirmed by the dialog.
DefaultKeyID The key ID of the preferred secret key. By default, if there is more than one secret key available, the default key stored in the target machine's PGP preferences (if any) will be shown as the dialog's default key. Use the DefaultKeyID parameter to specify a different secret key. Note that this ID must refer to a secret key; however, if a public key is given, or if the specified key isn't present on the local key-ring, the function will not return an error.
FindMatchingKey May be 0 (false) or 1 (true). If true, and the user enters a passphrase which is incorrect for the selected secret key, the dialog will attempt to match the passphrase to another available secret key and, if a match is found, will prompt the user to use that key instead of the selected key. If false, an incorrect passphrase results in the standard error message box and a prompt to try again. In PGP versions before 6, this is not optional. The dialog will always search for a matching key.
WindowHandle Handle to the calling application or window.

Notes and Warnings:

up to the top

spgpUIConfirmationPassphraseDialog

Presents the standard Passphrase dialog, with a confirmation box. The user is asked to provide a passphrase once in the upper box and again in the lower box; the dialog will confirm that the passphrases match. The function returns the confirmed passphrase. Options are available to crudely estimate the quality of the passphrase and to require minimum values for quality and length.

Visual Basic declaration:

Declare Function spgpuiconfirmationpassphrasedialog lib "spgp.dll" (
        ByVal Passphrase As String, 
        ByVal ShowPassphraseQuality As Long, 
        ByVal MinimumPassphraseQuality As Long, 
        ByVal MinimumPassphraseLength As Long
        ByVal WindowHandle As Long
        ) As Long

Parameters:
Passphrase A fixed-length string which will act as a buffer for output. If the function returns successfully, the buffer will contain the passphrase provided by the user and confirmed by the dialog.
ShowPassphraseQuality May be 0 (false) or 1 (true). If true, a graph bar will appear on the dialog, crudely estimating the quality of the provided passphrase on a scale of 0 to 100. In PGP versions before 6, this is not optional. The dialog will always display passphrase quality.
MinimumPassphraseQuality A number from 0 to 100 indicating the minimum quality-level required for the dialog to accept a passphrase. A graph bar will indicate the required quality. If '0' there is no requirement. This option is not available in PGP versions before 6.
MinimumPassphraseLength A number indicating the minimum number of characters the dialog will accept for a passphrase. The dialog prompt will inform users of the minimum requirement. If '0' there is no minimum, but the dialog will accept a blank ("") passphrase. This option is not available in PGP versions before 6.
WindowHandle Handle to the calling application or window.

Notes and Warnings:

up to the top

spgpUIKeyPassphraseDialog (PGP 6.x only)

Presents a dialog which displays a secret key's primary User ID, and prompts the user for the key's passphrase. The function returns the provided passphrase if the dialog confirms that it is correct.

Visual Basic declaration:

Declare Function spgpuikeypassphrasedialog Lib "spgp.dll" (
        ByVal KeyID As String, 
        ByVal Passphrase As String
        ByVal WindowHandle As Long
        ) As Long

Parameters:
KeyID The key ID of the secret key. The user will be prompted to provide the passphrase for this key.
Passphrase A fixed-length string which will act as a buffer for output. If the function returns successfully, the buffer will contain the passphrase of the secret key as provided by the user and confirmed by the dialog.
WindowHandle Handle to the calling application or window.

Notes and Warnings:

up to the top

spgpUISelectKeysDialog (PGP 6.x only)

This function posts a dialog which displays one or more keys which may be examined and selected by the user. This is essentially the same dialog PGP's clients use for importing keys. The function returns the properties of the selected keys.

Visual Basic declaration:

Declare Function spgpuiselectkeysdialog Lib "spgp.dll" (
        ByVal KeyID As String, 
        ByVal KeyProps As String, 
        ByVal Prompt As String, 
        ByVal KeyPropsLen As Long, 
        ByVal ShowKeyRing As Long, 
        ByVal Flags As Long, 
        ByVal WinHandle As Long
        ) As Long

Parameters:
KeyID The key ID of the key or keys to display.
KeyProps A fixed-length string which will act as a buffer for output. If the function returns successfully, the buffer will contain the properties of the selected key or keys.
Prompt Text to appear above the displayed keys, prompting the user to take some action. Prefixing a character with '&' will make that character an accelerator to the 'select all' action.
KeyPropsLen Size of KeyProps. If output exceeds KeyPropsLen the output will be discarded and the function will return a positive number indicating the size of the output (i.e. the buffer size necessary to hold it).
ShowKeyRing Show the key-ring? May be 0 (false) or 1 (true). If true, the contents of KeyID will be ignored and the dialog will display all the keys on the local ring.
Flags Bit flags indicating which key properties to return. See the Notes, below.
WindowHandle Handle to the calling application or window.

Notes and Warnings:

up to the top
Back to the Function Reference Table of Contents