📄 pgpclientlibwin32.h
字号:
// Get the prefs from the server specified as kPGPPrefLDAPPrefsServer
// and merge them with the existing prefs
//
// Entry parameters :
// hwndParent parent window
// prefref client prefref to update
// prefrefNet net prefref to update
//
// Note: if both prefrefs are kInvalidPGPPrefRef, the clientlib
// prefrefs will be used instead.
PGPError PGPclExport
PGPclGetPrefsFromServer (
PGPContextRef context,
PGPtlsContextRef tlscontext,
HWND hwndParent,
PGPPrefRef prefref,
PGPPrefRef prefrefNet);
//
// Get the admin-specified default keys from the default server
//
// Entry parameters :
// hwndParent parent window
// keydb keydb to be updated
PGPError PGPclExport
PGPclGetDefaultKeysFromServer (
PGPContextRef context,
PGPtlsContextRef tlscontext,
HWND hwndParent,
PGPKeyDBRef keydb);
// _______________________________________________________
//
// KeyDB Object properties propertysheet functions
// messages
#define PGPCL_M_PROPERTYMESSAGE WM_APP+330
#define PGPCL_M_REGISTERPROPERTYWINDOW WM_APP+331
enum
{
kPGPclProperties_UpdateObject = 1,
kPGPclProperties_CloseWindow = 2,
kPGPclProperties_DisableWindow = 3,
kPGPclProperties_ShowKeyProps = 4,
kPGPclProperties_ShowCertProps = 5,
kPGPclProperties_RefreshPhotoID = 6,
kPGPclProperties_EnableWindows = 7,
kPGPclProperties_UpdateKeyring = 8
};
// flags
enum
{
kPGPclProperties_Modeless = (1UL << 0),
kPGPclProperties_CenterWindow = (1UL << 1),
kPGPclProperties_ReadOnly = (1UL << 2),
kPGPclProperties_Key = (1UL << 3),
kPGPclProperties_UserID = (1UL << 4),
kPGPclProperties_Signature = (1UL << 5),
};
//
// Put up property sheet about specified object
//
// Entry parameters :
// context - PGP library context
// hwndParent - handle of parent window
// obj - object to display
// keydbMain - main keydb (if object is not in main keydb)
// uFlags - logical OR of above flags
// phwnd - pointer to buffer to receive hwnd of property
// sheet if kPGPclProperties_Modeless
PGPError PGPclExport
PGPclKeyDBObjProperties (
PGPContextRef context,
PGPtlsContextRef tlscontext,
HWND hwndParent,
PGPKeyDBObjRef obj,
PGPKeyDBRef keydbMain,
PGPUInt32 uFlags,
HWND* phwnd);
// _______________________________________________________
//
// Split key sharing functions
// Send key share file to remote computer
//
// Entry parameters :
// context - PGP library context
// hwndParent - handle of parent window
// keydbMain - main keydb (should contain decryption
// and authentication keys)
PGPError PGPclExport
PGPclSendShares (
PGPContextRef context,
PGPtlsContextRef tlscontext,
HWND hwndParent,
PGPKeyDBRef keydbMain);
//
// Reconstitute key by collecting key shares
//
// Entry parameters :
// context - PGP library context
// hwndParent - handle of parent window
// keydbMain - main keydb (should contain decryption
// and authentication keys)
// key - key to reconstitute
// ppPasskeyBuffer - pointer to buffer to receive address
// of passkey buffer
// piPasskeyLength - pointer to buffer to receive length
PGPError PGPclExport
PGPclReconstituteKey (
PGPContextRef context,
PGPtlsContextRef tlscontext,
HWND hwndParent,
PGPKeyDBRef keydbMain,
PGPKeyDBObjRef key,
PGPByte** ppPasskeyBuffer,
PGPUInt32* piPasskeyLength);
//
// Allow user to confirm remote authentication key
//
// Entry parameters :
// hwndParent - handle of parent window
// pszServer - string with name of remote host
// keyAuth - authentication key to confirm
// tlsCipher - cipher suite number
// keydbMain - main keydb to which keyAuth may be added
// uFlags - flags controlling text display
//
// returns kPGPError_NoErr or kPGPError_UserAbort
typedef enum PGPclAuthType
{
kPGPclAuthUseAppropriate = 0,
kPGPclAuthShowAuthentication = 1,
kPGPclAuthReconstituting = 2,
kPGPclAuthNewKey = 3,
kPGPclAuthUnexpectedKey = 4,
kPGPclAuthExpectedKey = 5,
kPGPclAuthConfirmIfInvalid = 6,
kPGPclAuthDoNotConfirm = 7,
kPGPclAuthConfirmAlways = 8
} PGPclAuthType;
PGPError PGPclExport
PGPclConfirmRemoteAuthentication (
PGPContextRef context,
HWND hwndParent,
char* pszServer,
PGPKeyDBObjRef keyAuth,
PGPtlsCipherSuiteNum tlsCipher,
PGPKeyDBRef keydbMain,
PGPclAuthType type);
// _______________________________________________________
//
// Passphrase functions
// Get passphrase from user.
//
// Entry parameters :
// context - PGP library context
// hwndParent - handle of parent window
// szPrompt - message string to be displayed to user
// pszPhrase - pointer to receive address of buffer which
// will contain passphrase. The caller should
// deallocate this buffer by calling PGPclFreePhrase
// keyset - keyset containing keys to display in combo or list box
// NULL => hide key selection combo box
// pKeyIDs - additional keyids to tag onto end of listbox in
// decryption dialog
// uKeyCount - total number of keys to display (only necessary when
// keyids are to be displayed, otherwise can be zero)
// pKey - pointer to buffer to receive ref to selected key.
// if buffer contains key on entry, this will be default.
// buffer should be set to NULL to use keyring default key.
// NULL => hide key selection combo box
// uOptions - pointer to buffer which contains and will receive
// options bits
// NULL => hide option checkboxes
// uFlags - flag bits
// PGPcl_RSAENCRYPT => encrypting to RSA key
// PGPcl_DECRYPTION => display decryption dialog
// PGPcl_ENCRYPTION => display conventional encryption
// dialog
//
// This function returns kPGPError_UserAbort if the user
// presses the cancel button.
// options bits
enum
{
kPGPclASCIIArmor = (1UL << 0),
kPGPclDetachedSignature = (1UL << 1),
kPGPclPassOnly = (1UL << 2),
kPGPclWipeOriginal = (1UL << 3),
kPGPclSecureViewer = (1UL << 4),
kPGPclSelfDecryptingArchive = (1UL << 5),
kPGPclInputIsText = (1UL << 6),
};
// disable bits
enum
{
kPGPclDisableASCIIArmor = (1UL << 0),
kPGPclDisableAutoMode = (1UL << 1),
kPGPclDisablePassOnly = (1UL << 2),
kPGPclDisableWipeOriginal = (1UL << 3),
kPGPclDisableSecureViewer = (1UL << 4),
kPGPclDisableSelfDecryptingArchive = (1UL << 5),
kPGPclDisableInputIsText = (1UL << 6),
};
// flag bits
enum
{
kPGPclRSAEncrypt = (1UL << 0),
kPGPclDecryption = (1UL << 1),
kPGPclEncryption = (1UL << 2),
kPGPclKeyPassphrase = (1UL << 3),
kPGPclRejectSplitKeys = (1UL << 4),
kPGPclHideQualityIndicator = (1UL << 5),
};
PGPError PGPclExport
PGPclGetPhrase (
PGPContextRef context,
PGPKeyDBRef keydbMain,
HWND hwndParent,
char* szPrompt,
char** ppszPhrase,
PGPKeySetRef keyset,
PGPKeyID* pKeyIDs,
PGPUInt32 uKeyCount,
PGPKeyDBObjRef* pkey,
PGPUInt32* puOptions,
PGPUInt32 uFlags,
PGPByte** ppPasskeyBuffer,
PGPUInt32* puPasskeyLength,
PGPUInt32 uMinLength,
PGPUInt32 uMinQuality,
PGPtlsContextRef tlscontext,
PGPKeyDBRef* keydbAdded,
char* szTitle);
//
// Recipient dialog glue call
//
// Interfaces to PGPsdkUI calls.
#define kPGPCurrentRecipVersion 'DUKE'
typedef struct _recipientdialogstruct
{
DWORD Version;
HWND hwndParent;
char * szTitle;
PGPContextRef context;
PGPKeyDBRef keydbOriginal;
PGPKeyDBRef keydbSelected;
char ** szRecipientArray;
DWORD dwNumRecipients;
DWORD dwOptions;
DWORD dwFlags;
DWORD dwDisableFlags;
PGPtlsContextRef tlsContext;
PGPKeyDBRef keydbAdded;
} PGPclRecipientDialogStruct, *PPGPclRecipientDialogStruct;
PGPUInt32 PGPclExport
PGPclRecipientDialog (
PPGPclRecipientDialogStruct prds);
// Wipe and deallocate phrase buffer.
//
// Entry parameters :
// szPhrase - passphrase buffer to wipe and deallocate
//
VOID PGPclExport
PGPclFreePhrase (
char* szPhrase);
//___________________________________
//
// passphrase caching routines
//
// This routine is called to get either cached phrase
// (if available) or prompt user for phrase.
PGPError PGPclExport
PGPclGetCachedDecryptionPhrase (
PGPContextRef context,
PGPtlsContextRef tlscontext,
PGPKeyDBRef keydbMain,
HWND hwnd,
char* szPrompt,
BOOL bForceUserInput,
char** pszBuffer,
PGPKeySetRef keysetEncryptedTo,
PGPKeyID* pkeyidEncryptedTo,
PGPUInt32 uKeyIDCount,
PGPByte** ppPasskeyBuffer,
PGPUInt32* piPasskeyLength,
PGPKeyDBRef* pkeydbAdded,
char* szTitle);
//
// This routine is called to get either signing cached phrase
// (if available) or prompt user for phrase.
PGPError PGPclExport
PGPclGetCachedSigningPhrase (
PGPContextRef context,
PGPtlsContextRef tlscontext,
HWND hwnd,
char* szPrompt,
BOOL bForceUserInput,
char** pszBuffer,
PGPKeyDBRef keydbSigning,
PGPKeyDBObjRef* pkeySigning,
PGPUInt32* puOptions,
PGPUInt32 uFlags,
PGPByte** ppPasskeyBuffer,
PGPUInt32* piPasskeyLength,
PGPKeyDBRef* pkeydbAdded,
char* szTitle);
//
// Called to wipe and free the phrase returned by
// PGPGetCachedPhrase.
void PGPclExport
PGPclFreeCachedPhrase (
char* szPhrase);
// __________________________________________________________
//
// Convenience wrapper functions for sdkUI passphrase routines
PGPError PGPclExport
PGPclGetKeyPhrase (
PGPContextRef context,
PGPtlsContextRef tlscontext,
HWND hwnd,
char* szPrompt,
PGPKeyDBRef keydb,
PGPKeyDBObjRef key,
char** ppszPhrase,
PGPByte** ppPasskeyBuffer,
PGPInt32* piPasskeyLength);
PGPError PGPclExport
PGPclGetSigningKeyPhrase (
PGPContextRef context,
PGPtlsContextRef tlscontext,
HWND hwnd,
char* szPrompt,
PGPKeyDBRef keydb,
PGPBoolean bRejectSplitKeys,
PGPKeyDBObjRef* pkey,
char** ppszPhrase,
PGPByte** ppPasskeyBuffer,
PGPInt32* piPasskeyLength);
PGPError PGPclExport
PGPclGetConfirmationPhrase (
PGPContextRef context,
HWND hwnd,
char* szPrompt,
PGPKeyDBRef keydb,
PGPInt32 iMinPhraseLength,
PGPInt32 iMinPhraseQuality,
char** ppszPhrase);
PGPError PGPclExport
PGPclGetDecryptionPhrase (
PGPContextRef context,
PGPtlsContextRef tlscontext,
HWND hwnd,
char* szPrompt,
PGPKeyDBRef keydbMain,
PGPKeyDBObjRef* pkey,
PGPKeySetRef keysetDecryption,
PGPInt32 iKeyIDCount,
PGPKeyID* keyidsDecryption,
PGPKeyDBRef* pkeydbToAdd,
char** ppszPhrase,
PGPByte** ppPasskeyBuffer,
PGPInt32* piPasskeyLength);
PGPError PGPclExport
PGPclGetConventionalPhrase (
PGPContextRef context,
HWND hwnd,
char* szPrompt,
char** ppszPhrase);
VOID PGPclExport
PGPclFreePhrase (
char* pszPhrase);
VOID PGPclExport
PGPclFreePasskey (
PGPByte* pbyte,
PGPSize size);
PGPError PGPclExport
PGPclChangePhrase (
PGPContextRef context,
PGPtlsContextRef tlscontext,
HWND hwnd,
PGPKeyDBObjRef key,
PGPBoolean bAdvise);
PGPError PGPclExport
PGPclCachePhrase (
PGPContextRef context,
PGPKeyDBObjRef key,
char* pszPhrase,
PGPByte* pPasskey,
PGPInt32 iPasskeyLength);
// __________________________________________________________
//
// Update introducer keys from server
//
// Entry parameters :
// hwnd NULL => use silent mode
// bForce TRUE => don't ask importation confirmation
PGPError PGPclExport
PGPclAutoUpdateIntroducers (
PGPContextRef context,
PGPtlsContextRef tlscontext,
HWND hwnd,
PGPKeyDBRef keydbMain,
BOOL bForce);
//
// Schedule next CRL update on basis of root CA key
PGPError PGPclExport
PGPclScheduleNextCRLUpdate (
PGPContextRef context,
PGPKeyDBRef keydbMain);
// __________________________________________________________
//
// Look up an unknown signer's key on the keyserver
//
// Entry parameters :
// context context ref
// hwnd handle to parent window
// event event data pointer
// signingKeyID Key ID of unknown signer
// pbGotKeys Pointer to boolean, TRUE if the key(s)
// of the unknown signer were successfully fetched
PGPError PGPclExport
PGPclLookupUnknownSigner (
PGPContextRef context,
PGPKeyDBRef keydbMain,
PGPtlsContextRef tlscontext,
HWND hwnd,
PGPEvent* event,
PGPKeyID keyidSigning,
PGPBoolean* pbGotKeys,
PGPKeyDBRef *pkeydbNew);
//________________________________________________
//
// Creates empty keylist window
//
// Entry parameters :
// context - PGP library context
// hwndParent - handle of parent window
// iID - window ID to assign to manager (used in notifications)
// lpfnSetList
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -