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

📄 pgpdialogs.h

📁 PGP8.0源码 请认真阅读您的文件包然后写出其具体功能
💻 H
字号:
/*____________________________________________________________________________
	Copyright (C) 2002 PGP Corporation
	All rights reserved.
	
	$Id: pgpDialogs.h,v 1.11 2002/08/06 20:11:13 dallen Exp $
____________________________________________________________________________*/

#ifndef Included_pgpDialogs_h	/* [ */
#define Included_pgpDialogs_h

#include "pgpOptionListPriv.h"
#include "pgpUserInterface.h"

struct PGPRecipientSpec;

class CPGPDialogOptions
{
public:

	PGPContextRef			mContext;
	PGPOptionListRef		mClientOptions;
	char					*mWindowTitle;
	const PGPKeyServerSpec	*mServerList;
	PGPUInt32				mServerCount;
	PGPBoolean				mSearchBeforeDisplay;
	PGPBoolean				mTextUI;
	PGPKeyDBRef				*mNewKeys;			/* Server search results */
	PGPtlsContextRef		mTLSContext;
	const char *			mPrompt;
	PGPKeyDBObjRef			mDefaultKey;
	
#if PGP_WIN32
	HWND                mHwndParent;
#endif

						CPGPDialogOptions(void);
	virtual				~CPGPDialogOptions(void);
	
	virtual PGPError	GatherOptions(PGPContextRef context,
								PGPOptionListRef optionList);
};

class CPGPRecipientDialogOptions : public CPGPDialogOptions
{
public:

	PGPOptionListRef		mDialogOptions;
	PGPUInt32				mNumDefaultRecipients;
	const PGPRecipientSpec	*mDefaultRecipients;
	PGPBoolean				mDisplayMarginalValidity;
	PGPBoolean				mIgnoreMarginalValidity;
	PGPGroupSetRef			mGroupSet;
	PGPKeySetRef			mClientKeySet;
	PGPBoolean				mAlwaysDisplay;
	PGPBoolean				mAlwaysDisplayWithARRs;
	PGPKeyDBRef				*mRecipientKeysPtr;		/* Output */
	PGPUInt32				*mRecipientCount;		/* Output */
	PGPRecipientSpec		**mRecipientList;		/* Output */
	
	PGPAdditionalRecipientRequestEnforcement	mEnforcement;
	
						CPGPRecipientDialogOptions(void);
	virtual				~CPGPRecipientDialogOptions(void);

	virtual PGPError	GatherOptions(PGPContextRef context,
								PGPOptionListRef optionList);
};

class CPGPRandomDataDialogOptions : public CPGPDialogOptions
{
public:

	PGPUInt32			mNeededEntropyBits;
	
						CPGPRandomDataDialogOptions(void);
	virtual				~CPGPRandomDataDialogOptions(void);
};

class CPGPKeyServerDialogOptions : public CPGPDialogOptions
{
public:

						CPGPKeyServerDialogOptions(void);
	virtual				~CPGPKeyServerDialogOptions(void);
};

class CPGPSearchKeyServerDialogOptions : public CPGPKeyServerDialogOptions
{
public:

	PGPBoolean			mSearchAllServers;
	PGPFilterRef		mFilter;
	char				mKeyDescription[256];
	
						CPGPSearchKeyServerDialogOptions(void);
	virtual				~CPGPSearchKeyServerDialogOptions(void);

	virtual PGPError	GatherOptions(PGPContextRef context,
								PGPOptionListRef optionList);
								
private:

	PGPError			NewKeyIDListSearchFilter(PGPContextRef context,
								const PGPKeyID *keyIDList,
								PGPUInt32 keyIDCount,
								PGPFilterRef *filter);
	PGPError			NewKeySetSearchFilter(PGPContextRef context,
								PGPKeySetRef keySet, PGPFilterRef *filter);
};

class CPGPSendToKeyServerDialogOptions : public CPGPKeyServerDialogOptions
{
public:

	PGPKeySetRef		mKeysToSend;
	PGPKeySetRef		*mFailedKeys;
	
						CPGPSendToKeyServerDialogOptions(void);
	virtual				~CPGPSendToKeyServerDialogOptions(void);
};


class CPGPPassphraseDialogOptions : public CPGPDialogOptions
{
public:

	char **				mPassphrasePtr;
	PGPOptionListRef	mDialogOptions;
	PGPUInt32			mMinPassphraseLength;
	PGPUInt32			mMinPassphraseQuality;
	PGPUInt32			mDialogTimeout;

						CPGPPassphraseDialogOptions(void);
	virtual				~CPGPPassphraseDialogOptions(void);
	
	virtual PGPError	GatherOptions(PGPContextRef context,
								PGPOptionListRef optionList);
};

class CPGPConfirmationPassphraseDialogOptions :
			public CPGPPassphraseDialogOptions
{
public:

	PGPBoolean			mShowPassphraseQuality;

						CPGPConfirmationPassphraseDialogOptions(void);
	virtual				~CPGPConfirmationPassphraseDialogOptions(void);
	
	virtual PGPError	GatherOptions(PGPContextRef context,
								PGPOptionListRef optionList);
};

class CPGPKeyPassphraseDialogOptions : public CPGPPassphraseDialogOptions
{
public:

	PGPBoolean			mVerifyPassphrase;
	PGPBoolean			mCache;
	PGPBoolean			mCacheGlobal;
	PGPUInt32			mCacheTimeout;

						CPGPKeyPassphraseDialogOptions(void);
	virtual				~CPGPKeyPassphraseDialogOptions(void);
	
	virtual PGPError	GatherOptions(PGPContextRef context,
								PGPOptionListRef optionList);
};

class CPGPKeySetPassphraseDialogOptions :
			public CPGPKeyPassphraseDialogOptions
{
public:

	PGPBoolean			mFindMatchingKey;
	PGPKeySetRef		mKeySet;
	PGPKeyDBObjRef *	mPassphraseKeyPtr;

						CPGPKeySetPassphraseDialogOptions(void);
	virtual				~CPGPKeySetPassphraseDialogOptions(void);
	
	virtual PGPError	GatherOptions(PGPContextRef context,
								PGPOptionListRef optionList);
};

class CPGPSigningPassphraseDialogOptions :
			public CPGPKeySetPassphraseDialogOptions
{
public:

						CPGPSigningPassphraseDialogOptions(void);
	virtual				~CPGPSigningPassphraseDialogOptions(void);
};

class CPGPDecryptionPassphraseDialogOptions :
			public CPGPKeySetPassphraseDialogOptions
{
public:

	const PGPKeyID		*mKeyIDList;
	PGPUInt32			mKeyIDCount;
	PGPKeyID			*mMissingKeyIDList;
	PGPUInt32			mMissingKeyIDCount;
	
						CPGPDecryptionPassphraseDialogOptions(void);
	virtual				~CPGPDecryptionPassphraseDialogOptions(void);
	
	PGPError			GatherMissingKeys(void);
	PGPError			SearchForMissingKeys(void *hwndParent,
								PGPBoolean *foundNewKeys);
	
private:

	PGPError			RemoveFoundKeys(PGPKeySetRef keySet);
};

class CPGPOptionsDialogOptions : public CPGPDialogOptions
{
public:

						CPGPOptionsDialogOptions(void);
	virtual				~CPGPOptionsDialogOptions(void);
};


PGP_BEGIN_C_DECLARATIONS

/* Platform specific handler functions */

PGPError	pgpRecipientDialogPlatform(PGPContextRef context,
					CPGPRecipientDialogOptions *options);
PGPError	pgpPassphraseDialogPlatform(PGPContextRef context,
					CPGPPassphraseDialogOptions *options);
PGPError	pgpKeyPassphraseDialogPlatform(PGPContextRef context,
					CPGPKeyPassphraseDialogOptions *options);
PGPError	pgpSigningPassphraseDialogPlatform(PGPContextRef context,
					CPGPSigningPassphraseDialogOptions *options);
PGPError	pgpDecryptionPassphraseDialogPlatform(PGPContextRef context,
					CPGPDecryptionPassphraseDialogOptions *options);
PGPError	pgpConfirmationPassphraseDialogPlatform(PGPContextRef context,
					CPGPConfirmationPassphraseDialogOptions *options);
PGPError	pgpOptionsDialogPlatform(PGPContextRef context,
					CPGPOptionsDialogOptions *options);
PGPError	pgpCollectRandomDataDialogPlatform(PGPContextRef context,
					CPGPRandomDataDialogOptions *options);
PGPError	pgpSearchKeyServerDialogPlatform(PGPContextRef context,
					CPGPSearchKeyServerDialogOptions *options);
PGPError	pgpSendToKeyServerDialogPlatform(PGPContextRef context,
					CPGPSendToKeyServerDialogOptions *options);
PGPError	pgpGetMissingRecipientKeyIDStringPlatform(PGPContextRef context,
					const PGPKeyID	*keyID, char keyIDString[256]);

#if PGP_OSX
PGPError	pgpRecipientDialogPlatformMain(PGPContextRef context,
					CPGPRecipientDialogOptions *options);
PGPError	pgpPassphraseDialogPlatformMain(PGPContextRef context,
					CPGPPassphraseDialogOptions *options);
PGPError	pgpKeyPassphraseDialogPlatformMain(PGPContextRef context,
					CPGPKeyPassphraseDialogOptions *options);
PGPError	pgpSigningPassphraseDialogPlatformMain(PGPContextRef context,
					CPGPSigningPassphraseDialogOptions *options);
PGPError	pgpDecryptionPassphraseDialogPlatformMain(PGPContextRef context,
					CPGPDecryptionPassphraseDialogOptions *options);
PGPError	pgpConfirmationPassphraseDialogPlatformMain(PGPContextRef context,
					CPGPConfirmationPassphraseDialogOptions *options);
PGPError	pgpOptionsDialogPlatformMain(PGPContextRef context,
					CPGPOptionsDialogOptions *options);
PGPError	pgpCollectRandomDataDialogPlatformMain(PGPContextRef context,
					CPGPRandomDataDialogOptions *options);
PGPError	pgpSearchKeyServerDialogPlatformMain(PGPContextRef context,
					CPGPSearchKeyServerDialogOptions *options);
PGPError	pgpSendToKeyServerDialogPlatformMain(PGPContextRef context,
					CPGPSendToKeyServerDialogOptions *options);
#endif

/* Utilitiy functions */

PGPError		pgpCheckNetworklibAvailability(void);
PGPKeyDBObjRef	GetKeyForPassphrase(
		PGPKeySetRef keySet, 
		char *passphrase,
#if PGP_WIN32	
		void *hwnd,				// needed for determining codepage
		PGPBoolean *nonUTF8,	// TRUE on return if nonUTF8 version matches
#endif // PGP_WIN32	
		PGPBoolean signing);

PGPError pgpRecipientDialogTTY (
		PGPContextRef, CPGPRecipientDialogOptions *);

PGP_END_C_DECLARATIONS

#endif /* ] Included_pgpDialogs_h */

/*__Editor_settings____

	Local Variables:
	tab-width: 4
	End:
	vi: ts=4 sw=4
	vim: si
_____________________*/

⌨️ 快捷键说明

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