⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pgpclientlibwin32.h

📁 PGP8.0源码 请认真阅读您的文件包然后写出其具体功能
💻 H
📖 第 1 页 / 共 5 页
字号:
//	display X.509 certs and allow user to select cert
//
//	Entry parameters :
//		hwndParent		- handle of parent window
//		pszPrompt		- prompt string
//		keydbMain		- backing keydb
//		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
enum
{
	kPGPclSelectX509CanSignOnly			= (1UL << 0),
	kPGPclSelectX509NoSplitKeys			= (1UL << 1),
	kPGPclSelectX509CACertsOnly			= (1UL << 2),

	kPGPclDefaultX509SelectionFlags 	= 0
};

PGPError PGPclExport
PGPclSelectX509Cert (
		PGPContextRef		context,
		HWND				hwndParent,
		char*				pszPrompt,
		PGPKeySetRef		keysetToDisplay,
		PGPUInt32			uFlags,
		PGPKeyDBObjRef*		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);

//	Display timeout (eval or beta) message to user
//
//	Entry parameters :
//		hwnd		Parent of window so we can show the MB or nag screen.
//					NULL is acceptable.
//		bBeta		TRUE if this is a beta timeout, FALSE otherwise
//		iGraceDays	number of days left in grace period; 0 means no grace
//		bOperation	TRUE if "operation" (vs. "module") timeout

void PGPclExport 
PGPclDisplayTimeoutMessage (
		HWND				hwnd,
		BOOL				bBeta,
		INT					iGraceDays,
		BOOL				bOperation);

//	Wrapper around PGPlnPGPmailEnabled for use by Notes plugin

PGPBoolean PGPclExport
PGPclPGPmailEnabled (void);

//	Wrapper around PGPlnDesktop for use by Notes plugin

PGPBoolean PGPclExport
PGPclPGPdesktopEnabled (void);

//	Wrapper around PGPlnEnterprise for use by Notes plugin

PGPError PGPclExport
PGPclEnterprise (void);

//	Wrapper around PGPlnIsAuthorized for use by Notes plugin

PGPError PGPclExport
PGPclIsAuthorized (void);

//	Wrappers around PGPlnIsExpired for use by Notes plugin

typedef enum PGPclExpType
{
	kPGPclDefaultExpired				= 1,
	kPGPclEncryptSignExpired			= 2
} PGPclExpType;

PGPError PGPclExport
PGPclIsExpired (
		HWND				hwnd,
		PGPclExpType		type);

PGPError PGPclExport
PGPclEvalExpired (
		HWND				hwnd,
		PGPclExpType		type);

//	_______________________________________________________
//
//	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

PGPBoolean PGPclExport
PGPclIsClientInstall (void);

//
//	Query if this is a "Admin" installation

PGPBoolean PGPclExport
PGPclIsAdminInstall (void);

//
//	Find default key in specified keydb by looking it up via the
//  keyid stored in the client prefs
//
//	Entry parameters :
//		keydb	- keydb containing default key
//		pkeyOut	- received key obj ref of default key

PGPError PGPclExport
PGPclGetDefaultKey (
		PGPKeyDBRef			keydb,
		PGPKeyDBObjRef*		pkeyOut);
		
//
//	Find default private key in specified keydb by looking it up 
//	via the keyid stored in the client prefs.  This differs from
//	PGPclGetDefaultKey in that it only returns keypairs.
//
//	Entry parameters :
//		keydb	- keydb containing default key
//		pkeyOut	- received key obj ref of default key

PGPError PGPclExport
PGPclGetDefaultPrivateKey (
		PGPKeyDBRef			keydb,
		PGPKeyDBObjRef*		pkeyOut);
		
//
//	Get the prefref(s) for the currently open PGPclientLib prefs.
//	Pass a NULL for those prefrefs you don't want
//
//	Entry parameters :
//		pprefref	- points to prefref to receive PGP prefref
//		pprefrefNet	- points to prefref to receive PGPnet prefref

PGPError PGPclExport
PGPclPeekClientLibPrefRefs (
		PGPPrefRef*			pprefref,
		PGPPrefRef*			pprefrefNet);

//
//	Flush the specified prefs to disk or to service.
//	Pass a kInvalidPGPPrefRef for those prefrefs you don't want to flush.
//
//	Entry parameters :
//		prefref		- prefref for PGP prefs
//		prefrefNet	- prefref for PGPnet prefs

PGPError PGPclExport
PGPclFlushClientLibPrefs (
		PGPPrefRef			prefref,
		PGPPrefRef			prefrefNet);

//
//  Import the default keys (DefaultKeys.asc) into the user's keyring
//

PGPError PGPclExport
PGPclImportDefaultKeys (
		PGPContextRef	context,
		HWND			hwnd);

//	______________________________________________
//
//  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 PGPclExport
PGPclGetPrefFlags(
		PGPPrefRef			prefref,
		PGPPrefIndex		prefIndex,
		PGPUInt32*			flags);

PGPError PGPclExport
PGPclGetPrefArray(
		PGPPrefRef			prefref,
		PGPPrefIndex		prefIndex,
		PGPPrefArray**		array);

PGPError PGPclExport
PGPclSetPrefArray(
		PGPPrefRef			prefref,
		PGPPrefIndex		prefIndex,
		PGPPrefArray*		array);

PGPError PGPclExport
PGPclGetPrefBoolean (
		PGPPrefRef 			prefref,
		PGPPrefIndex 		prefIndex,
		PGPBoolean 			*data);

PGPError PGPclExport
PGPclSetPrefBoolean (
		PGPPrefRef 			prefref,
		PGPPrefIndex 		prefIndex,
		PGPBoolean 			data);

PGPError PGPclExport
PGPclGetPrefNumber (
		PGPPrefRef 			prefref,
		PGPPrefIndex 		prefIndex,
		PGPUInt32 			*data);

PGPError PGPclExport
PGPclSetPrefNumber (
		PGPPrefRef 			prefref,
		PGPPrefIndex 		prefIndex,
		PGPUInt32 			data);

PGPError PGPclExport
PGPclGetPrefStringAlloc (
		PGPPrefRef 			prefref,
		PGPPrefIndex 		prefIndex,
		char**				string);

PGPError PGPclExport
PGPclGetPrefStringBuffer (
		PGPPrefRef 			prefref,
		PGPPrefIndex 		prefIndex,
		PGPSize 			maxSize,
		char*				string);

PGPError PGPclExport
PGPclSetPrefString (
		PGPPrefRef 			prefref,
		PGPPrefIndex 		prefIndex,
		const char*			string);

PGPError PGPclExport
PGPclGetPrefData (
		PGPPrefRef 			prefref,
		PGPPrefIndex 		prefIndex,
		PGPSize*			dataLength,
		void**				inBuffer);

PGPError PGPclExport
PGPclSetPrefData (
		PGPPrefRef 			prefref,
		PGPPrefIndex 		prefIndex,
		PGPSize 			dataLength,
		const void*			outBuffer);

PGPError PGPclExport
PGPclRemovePref (
		PGPPrefRef 			prefref,
		PGPPrefIndex 		prefIndex);

//
//	Get root CA key and sig that are specified by client prefs
//
//	Entry parameters :
//		prefref			- valid prefref for client prefs
//		keydb			- main keydb on which root CA key is located
//		psigCert		- pointer to buffer to receive sig

PGPError PGPclExport
PGPclGetRootCACertPrefs (
		PGPContextRef		context,
		PGPPrefRef			prefref,
		PGPKeyDBRef			keydb,
		PGPKeyDBObjRef*		psigCert);


//	_______________________________________________________
//
//	IE token support functions

// Application-independent IE wrappers, based on CryptoAPI
int PGPclExport
PGPclIEExportX509 ( 
		unsigned char*		pCertEncoded, 
		unsigned 			cbCertEncoded, 
		const char *		userID, 
		const char *		keyIDstr, 
		const char *		key_container, 
		unsigned 			key_container_size, 
		const char *		CSP);
    
int PGPclExport
PGPclIETokenProvToCSP (
		const char*			tokenProv, 
		char 				CSP[80], 
		int 				size);

int PGPclExport PGPclIEInit(const char *cmdLine);

int PGPclExport PGPclIEGetExistingKeyContainersRemote(
		const char *CSP, char **cont, int *n);

void PGPclExport PGPclIEFreeMem( void *cont );

// PGP-specific IE import routine
PGPError PGPclExport
PGPclProcessKeyConts( 
		PGPContextRef ctx, PGPKeyDBObjRef key, 
		const char *pszPassPhrase,
		const char *CSP, const PGPTokenInfo *pti, 
		const char *conts1, int conts1_n, 
		const char *conts2, int conts2_n );


//	_______________________________________________________
//
//	Exchange server support functions

PGPBoolean PGPclExport
PGPclIsExchangeServerUser (void);

PGPError PGPclExport
PGPclGetExchangeServerAddress (
		HWND		hwnd,
		PGPBoolean	bDefaultLogon,
		char*		pszName,
		PGPSize		sizeName,
		char*		pszEmailAddress, 
		PGPSize		sizeEmailAddress);

//	_______________________________________________________
//
//	Miscellaneous convenience functions

//
//	Determines which windows OS we are running under
//	Note: either argument can be NULL if information is not needed

typedef enum PGPclWindowsFamily
{
	kPGPclWindowsFamilyUnknown			= 0,
	kPGPclWindowsFamily9x				= 1,	//includes Millenium
	kPGPclWindowsFamilyNT				= 2		//includes Windows2000, XP
} PGPclWindowsFamily;

typedef enum PGPclWindowsGenus
{
	kPGPclWindowsGenusUnknown			= 0,
	kPGPclWindowsGenus95				= 1,
	kPGPclWindowsGenus98				= 2,
	kPGPclWindowsGenusMillenium			= 3,
	kPGPclWindowsGenusPostMillenium		= 4,
	kPGPclWindowsGenusNT3				= 101,
	kPGPclWindowsGenusNT4				= 102,
	kPGPclWindowsGenus2000				= 103,
	kPGPclWindowsGenusXp				= 104,
	kPGPclWindowsGenusPostKnown			= 901
} PGPclWindowsGenus;

typedef enum PGPclWindowsSpecies
{
	kPGPclWindowsSpeciesUnknown			= 0,
	kPGPclWindowsSpecies95OSR1			= 1,
	kPGPclWindowsSpecies95OSR2			= 2,
	kPGPclWindowsSpecies98				= 3,
	kPGPclWindowsSpecies98SE			= 4,
	kPGPclWindowsSpeciesMillenium		= 5,
	kPGPclWindowsSpeciesPostMillenium	= 6,
	kPGPclWindowsSpeciesNT3				= 101,
	kPGPclWindowsSpeciesNT4NoSp			= 102,
	kPGPclWindowsSpeciesNT4Sp1			= 103,
	kPGPclWindowsSpeciesNT4Sp2			= 104,
	kPGPclWindowsSpeciesNT4Sp3			= 105,
	kPGPclWindowsSpeciesNT4Sp4			= 106,
	kPGPclWindowsSpeciesNT4Sp5			= 107,
	kPGPclWindowsSpeciesNT4Sp6			= 108,
	kPGPclWindowsSpeciesNT4PostSp6		= 109,
	kPGPclWindowsSpecies2000Beta		= 201,
	kPGPclWindowsSpecies2000			= 202,
	kPGPclWindowsSpecies2000Sp1			= 203,
	kPGPclWindowsSpecies2000Sp2			= 204,
	kPGPclWindowsSpecies2000Sp3			= 205,
	kPGPclWindowsSpeciesXpBeta			= 301,
	kPGPclWindowsSpeciesXp				= 302,
	kPGPclWindowsSpeciesXpSp1			= 303,
	kPGPclWindowsSpeciesPostKnown		= 901
} PGPclWindowsSpecies;

PGPError PGPclExport
PGPclGetWindowsVersion (
		PGPclWindowsFamily*		pFamily,
		PGPclWindowsGenus*		pGenus,
		PGPclWindowsSpecies*	pSpecies);

//
//	Get our process's Terminal Services session ID

PGPError PGPclExport
PGPclGetTerminalServicesSessionId (
		PGPUInt32*			puSessionId);

//
//	Tests for whether we are running as a terminal server client

PGPBoolean PGPclExport
PGPclRunningUnderTerminalServer (void);

//
//	Tests for various conditions of interest on specified
//	file or directory path.  Return value is logical OR of following
//	flags.  Suppresses the display of system messageboxes

enum
{
	kPGPclInvalidPath				= (1UL << 0),
	kPGPclMediaNotInserted			= (1UL << 1),
	kPGPclIsFile					= (1UL << 2),
	kPGPclIsFolder					= (1UL << 3),
	kPGPclIsReadOnly				= (1UL << 4),
	kPGPclIsInReadOnlyFolder		= (1UL << 5),
};

PGPUInt32 PGPclExport
PGPclTestPathNameStatus (
		char*				pszPath);

//
// wrapper for HtmlHelp call.  does some processing based on
// message or help type.  if used in response to WM_HELP or
// WM_CONTEXTMENU messages, just pass the msg, and parameters
// directly into PGpclHtmlHelp.  if you pass one of the following
// enums for uMsgOrHelpType, the wParam and lParam arguments
// are ignored.

//	Entry parameters :
//		hwnd			- specifies the parent window
//		wMsgOrHelpType	- either one of the following enums, or
//						  WM_HELP, or WM_CONTEXTMENU
//		wParam			- the wParam of WM_HELP or WM_CONTEXTMENU
//		lParam			- the lParam of WM_HELP or WM_CONTEXTMENU
//		pszHelpFile		- the help file path, or one of the PGPclPathIndex
//						  enums (used with PGPclGetPath) specifying a help
//						  file path
//		pdwID			- for WM_HELP and WM_CONTEXTMENU, this should be a
//						  pointer to the help ID array.  Otherwise it should

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -