📄 pgpcl.h
字号:
/*____________________________________________________________________________
Copyright (C) 1998 Network Associates, Inc.
All rights reserved.
PGPcl.h - header file for PGP ClientLib DLL
$Id: PGPcl.h,v 1.71 1999/04/13 17:29:52 wjb Exp $
____________________________________________________________________________*/
#ifndef Included_PGPcl_h /* [ */
#define Included_PGPcl_h
#include "pflPrefTypes.h"
#include "pgpGroups.h"
#include "pgpKeyServerPrefs.h"
#ifdef _PGPCLDLL
# define PGPclExport __declspec( dllexport )
#else
# define PGPclExport __declspec( dllimport )
#endif
#ifdef __cplusplus
extern "C" {
#endif
// _______________________________________________________
//
// Library Initialization/Cleanup
//
// Open library and initialize
PGPError PGPclExport
PGPclInitLibrary (PGPContextRef context);
// Close down DLL and purge passphrase buffers.
PGPError PGPclExport
PGPclCloseLibrary (VOID);
// _______________________________________________________
//
// Word wrap convenience functions
//
// Wrap text using platform independent word wrap code.
// Output buffer must be freed with PGPclFreeWrapBuffer
//
// Entry parameters :
// szInText - input buffer
// wrapColumn - column at which to wrap
// pszOutText - buffer to receive pointer to
// output buffer containing wrapped text
PGPError PGPclExport
PGPclWrapBuffer (
LPSTR szInText,
PGPUInt16 wrapColumn,
LPSTR* pszOutText);
// Free previously-wrapped text buffer.
//
// Entry parameters :
// textBuffer - buffer to free
PGPError PGPclExport
PGPclFreeWrapBuffer (LPSTR textBuffer);
// _______________________________________________________
//
// Miscellaneous common dialogs and UI elements
// Post PGP preferences property sheets.
//
// This function posts the "PGP Preferences" property
// sheet dialog boxes. Appropriate calls are made into
// the pgpkeydb library to set the preferences.
//
// Entry parameters :
// Context - PGP library context
// hWndParent - handle of parent window
// iStartsheet - zero-based index of property sheet
// page to display initially.
// use the below-defined constants
// keysetMain - main keyset, if available. If not
// available, NULL is OK.
//
// This function returns kPGPError_UserAbort (if the user
// presses the cancel button)
// preferences pages (used for "iStartsheet")
#define PGPCL_GENERALPREFS 0
#define PGPCL_KEYRINGPREFS 1
#define PGPCL_EMAILPREFS 2
#define PGPCL_HOTKEYPREFS 3
#define PGPCL_KEYSERVERPREFS 4
#define PGPCL_CAPREFS 5
#define PGPCL_ADVANCEDPREFS 6
PGPError PGPclExport
PGPclPreferences (
PGPContextRef Context,
HWND hWndParent,
INT iStartsheet,
PGPKeySetRef keysetMain);
// Get descriptive string for error code for encode/decode modules
//
// Entry parameters :
// iCode - error code returned by pgp or simple library routine
// szString - buffer to be filled with descriptive error message
// uLen - length of buffer in bytes
//
// This function evaluates iCode. If iCode warrants an error
// message, the buffer is filled with the message and the function
// returns kPGPError_UnknownError. If no message is warranted,
// the function returns kPGPError_NoErr.
PGPError PGPclExport
PGPclEncDecErrorToString (
INT iCode,
LPSTR szString,
UINT uLen);
// Putup error messagebox (if necessary) for encode/decode modules
//
// Entry parameters :
// hWnd - handle of parent (NULL is OK)
// iCode - error code returned by pgp or simple library routine
//
// This function calls PGPclErrorToString to evaluate iCode.
// If PGPclErrorToString returns kPGPError_UnknownError, a message
// box is posted containing the descriptive text. Otherwise no
// messagebox is displayed. This function returns the value returned
// by PGPclErrorToString.
PGPError PGPclExport
PGPclEncDecErrorBox (
HWND hWnd,
INT iCode);
// Get descriptive string for error code
//
// Entry parameters :
// iCode - error code returned by pgp or simple library routine
// szString - buffer to be filled with descriptive error message
// uLen - length of buffer in bytes
//
// This function evaluates iCode. If iCode warrants an error
// message, the buffer is filled with the message and the function
// returns kPGPError_UnknownError. If no message is warranted,
// the function returns kPGPError_NoErr.
PGPError PGPclExport
PGPclErrorToString (
INT iCode,
LPSTR szString,
UINT uLen);
// Putup error messagebox (if necessary)
//
// Entry parameters :
// hWnd - handle of parent (NULL is OK)
// iCode - error code returned by pgp or simple library routine
//
// This function calls PGPclErrorToString to evaluate iCode.
// If PGPclErrorToString returns kPGPError_UnknownError, a message
// box is posted containing the descriptive text. Otherwise no
// messagebox is displayed. This function returns the value returned
// by PGPclErrorToString.
PGPError PGPclExport
PGPclErrorBox (
HWND hWnd,
INT iCode);
// Collect entropy from keyboard/mouse.
//
// Entry parameters :
// Context - PGP library context
// hWndParent - handle of parent window
// uNeeded - bits of entropy needed
//
// This function returns kPGPError_UserAbort (if the user
// presses the cancel button).
PGPError PGPclExport
PGPclRandom (
PGPContextRef Context,
HWND hWndParent,
UINT uNeeded);
// Post Help|About dialog with button for browser launch to specified URL.
//
// Entry parameters :
// context - current PGP context
// hWndParent - handle of parent window
// szVersion - string containing version information
// to be displayed
// NULL => use default version string
// szLinkText - text to be displayed on link button
// (should be <= ~20 chars),
// NULL => use default ("www.pgpi.com")
// szLink - URL to which to jump
// NULL => use default ("http://www.pgpi.com/")
PGPError PGPclExport
PGPclHelpAbout (
PGPContextRef context,
HWND hWndParent,
LPSTR szVersion,
LPSTR szLinkText,
LPSTR szLink);
// Post nag dialog with button for browser launch to specified URL.
//
// Entry parameters :
// hWndParent - handle of parent window
// szLinkText - text to be displayed on link button
// (should be <= ~20 chars),
// NULL => use default ("Order Now!")
// szLink - URL to which to jump
// NULL => use default ("http://www.pgpi.com/")
PGPError PGPclExport
PGPclNag (
HWND hWndParent,
LPSTR szLinkText,
LPSTR szLink);
// Post Splash screen
//
// Entry parameters :
// hWndParent - handle of parent window (if NULL,
// screen will not be dismissed until
// PGPclSetSplashParent is called
// with a non-null value)
// uMilliseconds - milliseconds to display splash
PGPError PGPclExport
PGPclSplash (
PGPContextRef Context,
HWND hWndParent,
UINT uMS);
// Inform splash screen who its parent is
//
// Entry parameters :
// hWndParent - handle of parent window
PGPError PGPclExport
PGPclSetSplashParent (HWND hWndParent);
// display and handle selective key import dialog
//
// Entry parameters :
// hWndParent - handle of parent window
// KeySetToAdd - keyset containing keys to add
// KeySetMain - keyset to which keys will be added
//
// Returns kPGPError_NoErr if no error
//
PGPError PGPclExport
PGPclQueryAddKeys (
PGPContextRef Context,
PGPtlsContextRef tlsContext,
HWND hWndParent,
PGPKeySetRef KeySetToAdd,
PGPKeySetRef KeySetMain);
// display keyset and allow user to select keys
// - original calling parameters
//
// Entry parameters :
// hWndParent - handle of parent window
// pszPrompt - prompt string
// KeySetToDisplay - keyset containing keys to show
// KeySetMain - backing keyset
// pKeySetSelected - buffer to receive keyset ref of selected keys
//
//
// Returns kPGPError_NoErr if no error
//
PGPError PGPclExport
PGPclSelectKeys (
PGPContextRef Context,
PGPtlsContextRef tlsContext,
HWND hWndParent,
LPSTR pszPrompt,
PGPKeySetRef KeySetToDisplay,
PGPKeySetRef KeySetMain,
PGPKeySetRef* pKeySetSelected);
// display keyset and allow user to select keys
// - extended calling parameters -- added option flags
//
// Entry parameters :
// hWndParent - handle of parent window
// pszPrompt - prompt string
// KeySetToDisplay - keyset containing keys to show
// KeySetMain - backing keyset
// uFlags - option flags (see below)
// pKeySetSelected - buffer to receive keyset ref of selected keys
//
//
// Returns kPGPError_NoErr if no error
//
// option flag bits
#define PGPCL_SINGLESELECTION 0x0001
PGPError PGPclExport
PGPclSelectKeysEx (
PGPContextRef Context,
PGPtlsContextRef tlsContext,
HWND hWndParent,
LPSTR pszPrompt,
PGPKeySetRef KeySetToDisplay,
PGPKeySetRef KeySetMain,
UINT uFlags,
PGPKeySetRef* pKeySetSelected);
// display X.509 certs and allow user to select cert
//
// Entry parameters :
// hWndParent - handle of parent window
// pszPrompt - prompt string
// KeySetMain - backing keyset
// uFlags - option flags (see below)
// pkeyCert - buffer to receive cert keyref
// psigCert - buffer to receive cert sigref
//
//
// Returns kPGPError_NoErr if no error
//
// option flag bits
#define PGPCL_CANSIGNKEYSONLY 0x0001
#define PGPCL_NOSPLITKEYS 0x0002
#define PGPCL_CACERTSONLY 0x0004
PGPError PGPclExport
PGPclSelectX509Cert (
PGPContextRef context,
HWND hwndParent,
LPSTR pszPrompt,
PGPKeySetRef keysetMain,
UINT uFlags,
PGPKeyRef* pkeyCert,
PGPSigRef* psigRef);
// Post RSA/DSA mix warning dialog
//
// Entry parameters :
// hWndParent - handle of parent window
//
// Returns kPGPError_NoErr, kPGPError_UserAbort, or PGPCL_NO
//
PGPError PGPclExport
PGPclRSADSAMixWarning (HWND hWnd, PGPBoolean *pbNeverShowAgain);
// Check for product expiration
//
// Returns kPGPError_FeatureNotAvailable if the beta or eval has expired,
// and displays a message box. Returns kPGPError_NoErr and does nothing
// if it's still valid.
//
// Entry parameters :
// hwnd - Parent of window so we can show the MB.
// NULL is acceptable.
PGPError PGPclExport
PGPclIsExpired (HWND hwnd);
// Check for evaluation product expiration
//
// Returns kPGPError_FeatureNotAvailable if the evaluation has expired,
// and displays a message box. If the eval is partially expired, the
// nag screen will be displayed.
//
// Entry parameters :
// hwnd Parent of window so we can show the MB or nag screen.
// NULL is acceptable.
// nIndex Type of expiration to test: Encrypt/Sign or All
#define PGPCL_ENCRYPTSIGNEXPIRED 1
#define PGPCL_ALLEXPIRED 2
#if PGP_DEMO
BOOL PGPclExport PGPclEvalExpired (HWND hwnd, int nIndex);
#else
#define PGPclEvalExpired(x,y) kPGPError_NoErr
#endif // PGP_DEMO
// _______________________________________________________
//
// Group files convenience functions
typedef struct _PGPclGROUPFILE
{
PGPFileSpecRef filespec;
PGPGroupSetRef groupset;
} PGPclGROUPFILE;
// Opens standard groups file
//
// Entry parameters :
// ppGroup address of buffer to receive pointer
// to group file structure
PGPError PGPclExport
PGPclOpenGroupFile (
PGPContextRef Context,
PGPclGROUPFILE** ppGroup);
// Saves groups file
//
// Entry parameters :
// pGroup pointer to group file structure
PGPError PGPclExport
PGPclSaveGroupFile (PGPclGROUPFILE* pGroup);
// Closes groups file
//
// Entry parameters :
// pGroup pointer to group file structure
PGPError PGPclExport
PGPclCloseGroupFile (PGPclGROUPFILE* pGroup);
// _______________________________________________________
//
// Preference files convenience functions
// Query if this is a "Client" installation
//
BOOL PGPclExport
PGPclIsClientInstall (VOID);
// Query if this is a "Admin" installation
//
BOOL PGPclExport
PGPclIsAdminInstall (VOID);
// Get the path where client prefs files are located
//
// Entry parameters :
// pszPath - buffer to receive path string
// uLen - length of buffer in bytes
PGPError PGPclExport
PGPclGetClientPrefsPath (
LPSTR pszPath,
UINT uLen);
// Open client preferences file and returns PrefRef to caller
//
// Entry parameters :
// memMgr - memory manager to user for allocating fileref
// pPrefRef - pointer to buffer to receive PrefRef
PGPError PGPclExport
PGPclOpenClientPrefs (
PGPMemoryMgrRef memMgr,
PGPPrefRef* pPrefRef);
// ______________________________________________
//
// The following functions are wrappers for
// the pfl prefs routines. These are needed so
// groupwise plugin can access prefs (Delphi)
// using code in the PGPcl DLL.
PGPError PGPclGetPrefBoolean(PGPPrefRef prefRef,
PGPPrefIndex prefIndex,
PGPBoolean *data);
PGPError PGPclSetPrefBoolean(PGPPrefRef prefRef,
PGPPrefIndex prefIndex,
PGPBoolean data);
PGPError PGPclGetPrefNumber(PGPPrefRef prefRef,
PGPPrefIndex prefIndex,
PGPUInt32 *data);
PGPError PGPclSetPrefNumber(PGPPrefRef prefRef,
PGPPrefIndex prefIndex,
PGPUInt32 data);
PGPError PGPclGetPrefStringAlloc(PGPPrefRef prefRef,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -