📄 pgpcl.h
字号:
PGPPrefIndex prefIndex,
char **string);
PGPError PGPclGetPrefStringBuffer(PGPPrefRef prefRef,
PGPPrefIndex prefIndex,
PGPSize maxSize,
char *string);
PGPError PGPclSetPrefString(PGPPrefRef prefRef,
PGPPrefIndex prefIndex,
const char *string);
PGPError PGPclGetPrefData(PGPPrefRef prefRef,
PGPPrefIndex prefIndex,
PGPSize *dataLength,
void **inBuffer);
PGPError PGPclGetPrefFileSpec(PGPPrefRef prefRef,
PFLFileSpecRef *prefFileSpec);
PGPError PGPclSetPrefData(PGPPrefRef prefRef,
PGPPrefIndex prefIndex,
PGPSize dataLength,
const void *outBuffer);
PGPError PGPclRemovePref(PGPPrefRef prefRef,
PGPPrefIndex prefIndex);
PGPError PGPclDisposePrefData(PGPPrefRef prefRef,
void *dataBuffer);
// Close, and optionally save changes to, open client preference
// file.
//
// Entry parameters :
// PrefRef - PrefRef of file to close
// bSave - TRUE => save changes before closing
PGPError PGPclExport
PGPclCloseClientPrefs (
PGPPrefRef PrefRef,
BOOL bSave);
// Open admin preferences file and returns PrefRef to caller
//
// Entry parameters :
// memMgr - memory manager to user for allocating fileref
// pPrefRef - pointer to buffer to receive PrefRef
// bLoadDefaults - TRUE=>if file doesn't exist, then create
// and load default values
// FALSE=>if file doesn't exist, return error
PGPError PGPclExport
PGPclOpenAdminPrefs (
PGPMemoryMgrRef memMgr,
PGPPrefRef* pPrefRef,
BOOL bLoadDefaults);
// Close, and optionally save changes to, open admin preference
// file.
//
// Entry parameters :
// PrefRef - PrefRef of file to close
// bSave - TRUE => save changes before closing
PGPError PGPclExport
PGPclCloseAdminPrefs (
PGPPrefRef PrefRef,
BOOL bSave);
// Get root CA key and sig that are specified by client prefs
//
// Entry parameters :
// prefref - valid prefref for client prefs
// keyset - main keyset on which root CA key is located
// pkeyCert - pointer to buffer to receive key
// psigCert - pointer to buffer to receive sig
PGPError PGPclExport
PGPclGetRootCACertPrefs (
PGPContextRef context,
PGPPrefRef prefref,
PGPKeySetRef keyset,
PGPKeyRef* pkeyCert,
PGPSigRef* psigCert);
// _______________________________________________________
//
// Miscellaneous convenience functions
// Determines if we are running with Admin priviledges
// Note: returns TRUE if not running under NT
BOOL PGPclExport
PGPclLoggedInAsAdministrator (VOID);
// Fills buffer with the path of the current PGP install.
//
// Entry parameters :
// szPath buffer to receive string
// uLen length of buffer in bytes
PGPError PGPclExport
PGPclGetPGPPath (
LPSTR szPath,
UINT uLen);
// Launch web browser and send to specified page
//
// Entry parameters :
// pszURL - URL to open
//
PGPError PGPclExport
PGPclWebBrowse (LPSTR pszURL);
// Sync keysets to resolve trust info discrepancies
//
// Entry parameters :
// context - context ref
// keysetMain - main keyset containing trust info
// keysetNew - newly-imported keyset to sync with main
PGPError PGPclExport
PGPclSyncKeySets (
PGPContextRef context,
PGPKeySetRef keysetMain,
PGPKeySetRef keysetNew);
// Convert info in SYSTEMTIME structure to number of days from today
//
// Entry parameters :
// pst address of SYSTEMTIME structure containing data
// to convert
// piDays address of buffer to receive number of days from
// today. Negative numbers are prior to today.
PGPError PGPclExport
PGPclSystemTimeToDays (
SYSTEMTIME* pst,
INT* piDays);
// Check whether SDK supports specified Public Key algorithm
//
// Entry parameters :
// PGPPublicKeyAlgorithm SDK public key algorithm constant
// mustEncrypt TRUE=>SDK must support encryption with
// this algorithm
// mustSign TRUE=>SDK must support signing with
// this algorithm
//
// returns kPGPError_NoErr if SDK supports operations with
// specified algorithm, kPGPError_FeatureNotAvailable otherwise.
PGPError PGPclExport
PGPclCheckSDKSupportForPKAlg (
PGPPublicKeyAlgorithm alg,
PGPBoolean mustEncrypt,
PGPBoolean mustSign);
// Check whether SDK supports specified cipher algorithm
//
// Entry parameters :
// PGPCipherAlgorithm SDK cipher algorithm constant
//
// returns kPGPError_NoErr if SDK supports operations with
// specified algorithm, kPGPError_FeatureNotAvailable otherwise.
PGPError PGPclExport
PGPclCheckSDKSupportForCipherAlg (PGPCipherAlgorithm alg);
// Broadcast message that indicates that the keyring
// has been changed and that others should reload from
// disk.
//
// Entry parameters :
// lParam - 32 value which is passed along as the LPARAM
// of the broadcast message. Current usage
// is to set this to your process ID or your
// window handle so that you can ignore
// your own messages, if you want. Set to
// zero to ensure all recipients process message.
// broadcast message used to inform others of keyring changes
#define RELOADKEYRINGMSG ("PGPM_RELOADKEYRING")
VOID PGPclExport
PGPclNotifyKeyringChanges (LPARAM lParam);
// Broadcast message that indicates that the keyserver prefs
// have been changed and that others should reload from
// disk.
//
// Entry parameters :
// lParam - 32 value which is passed along as the LPARAM
// of the broadcast message. Current usage
// is to set this to your process ID or your
// window handle so that you can ignore
// your own messages, if you want. Set to
// zero to ensure all recipients process message.
// broadcast message used to inform others of keyring changes
#define RELOADPREFSMSG ("PGPM_RELOADPREFS")
VOID PGPclExport
PGPclNotifyPrefsChanges (LPARAM lParam);
// Broadcast message that indicates that the prefs
// have been changed and that others should reload from
// disk.
//
// Entry parameters :
// lParam - 32 value which is passed along as the LPARAM
// of the broadcast message. Current usage
// is to set this to your process ID or your
// window handle so that you can ignore
// your own messages, if you want. Set to
// zero to ensure all recipients process message.
// broadcast message used to inform others of keyring changes
#define RELOADKEYSERVERPREFSMSG ("PGPM_RELOADKEYSERVERPREFS")
VOID PGPclExport
PGPclNotifyKeyserverPrefsChanges (LPARAM lParam);
// Copy user info strings to preferences file
//
// Entry parameters :
// szOwnerName owner name
// szCompanyName company name
// szLicenseNumber license number
PGPError PGPclExport
PGPclSetUserInfo (
LPSTR szOwnerName,
LPSTR szCompanyName,
LPSTR szLicenseNumber);
// Query SDK for keyring and randseed file paths
//
// Entry parameters :
// pszPubRingPath buffer to receive public keyring file name
// iPubRingLen length of buffer in bytes
// pszPrivRingPath buffer to receive private keyring file name
// iPrivRingLen length of buffer in bytes
// pszRandSeedPath buffer to receive random seed file name
// iRandSeedLen length of buffer in bytes
//
// Note: any or all buffer pointers can be NULL -- they will be ignored.
PGPError PGPclExport
PGPclGetSDKFilePaths (
LPSTR pszPubRingPath,
INT iPubRingLen,
LPSTR pszPrivRingPath,
INT iPrivRingLen,
LPSTR pszRandSeedPath,
INT iRandSeedLen);
// Use SDK to set keyring and randseed file paths
//
// Entry parameters :
// pszPubRingPath buffer containing public keyring file name
// pszPrivRingPath buffer containing private keyring file name
// pszRandSeedPath buffer containing random seed file name
// bForceCreate TRUE => call PGPOpenDefaultKeyRings with "Create"
// flag to force creation of files
// FALSE => do not call PGPOpenDefaultKeyRings
//
// Note: any or all buffer pointers can be NULL -- they will be ignored.
PGPError PGPclExport
PGPclSetSDKFilePaths (
LPSTR pszPubRingPath,
LPSTR pszPrivRingPath,
LPSTR pszRandSeedPath,
BOOL bForceCreate);
// Startup the WinNT memlocking driver. If called under Win95, just
// returns kPGPError_NoErr. If called under WinNT, returns
// kPGPError_NoErr if driver already started, or driver is successfully
// started. Returns kPGPError_UnknownError if driver cannot be started.
PGPError PGPclExport
PGPclStartMemLockDriver (VOID);
// Get key from Key ID string
//
// Entry parameters :
// context - context ref
// keyset - keyset to find key in
// szID - string representation of key ID
// alg - algorithm of key
// Key - buffer to receive keyref
PGPError PGPclExport
PGPclGetKeyFromKeyID (
PGPContextRef context,
PGPKeySetRef keyset,
LPSTR szID,
UINT uAlg,
PGPKeyRef* pkey);
// _______________________________________________________
//
// Keyserver convenience functions
#define PGPCL_SPECIFIEDSERVER 0
#define PGPCL_USERIDBASEDSERVER 1 // determine server based on userid
#define PGPCL_DEFAULTSERVER 2 // use default keyserver
#define PGPCL_ROOTSERVER 3 // use root keyserver
// Searches keyserver prefs for specifed keyserver and replaces
// authentication key.
//
// Entry parameters :
// keyserver keyserver data to put in prefs file
PGPError PGPclExport
PGPclSyncKeyserverPrefs (
PGPContextRef context,
PGPKeyServerEntry* keyserver);
// Searches keyservers (as defined in prefs file) for all
// keys in the specified keyset.
//
// Entry parameters :
// hwndParent parent window
// keysetToUpdate keyset with keys to update
// uServer one of above-defined server constants
// keysetMain keyset to which tls key is added
// pkeysetUpdated buffer to receive PGPKeySetRef of updated keys
PGPError PGPclExport
PGPclUpdateKeySetFromServer (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hwndParent,
PGPKeySetRef keysetToUpdate,
UINT uServer,
PGPKeySetRef keysetMain,
PGPKeySetRef* pkeysetUpdated);
// Searches keyservers (as defined in prefs file) for the
// specified userid string.
//
// Entry parameters :
// hwndParent parent window
// szUserID string containing userid info
// uServer one of above-defined server constants
// keysetMain keyset to which tls key is added
// pkeysetFound buffer to receive PGPKeySetRef of found keys
PGPError PGPclExport
PGPclSearchServerForUserID (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hwndParent,
LPSTR szUserID,
UINT uServer,
PGPKeySetRef keysetMain,
PGPKeySetRef* pkeysetFound);
// Searches default keyserver for the keyids in the list.
//
// Entry parameters :
// hwndParent parent window
// pkeyidList array of PGPKeyID
// iNumKeyIDs number of PGPKeyIDs in list
// uServer one of above-defined server constants
// keysetMain keyset to which tls key is added
// pkeysetFound buffer to receive PGPKeySetRef of found keys
PGPError PGPclExport
PGPclSearchServerForKeyIDs (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hwndParent,
PGPKeyID* pkeyidList,
INT iNumKeyIDs,
UINT uServer,
PGPKeySetRef keysetMain,
PGPKeySetRef* pkeysetFound);
// Searches default keyserver using the specified filter.
//
// Entry parameters :
// hwndParent parent window
// filter filter to use for search
// uServer one of above-defined server constants
// keysetMain keyset to which tls key is added
// pkeysetFound buffer to receive PGPKeySetRef of found keys
PGPError PGPclExport
PGPclSearchServerWithFilter (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hwndParent,
PGPFilterRef filter,
UINT uServer,
PGPKeySetRef keysetMain,
PGPKeySetRef* pkeysetFound);
// Sends keys in keyset to the specified keyserver
//
// Entry parameters :
// hwndParent parent window
// szServerURL server to send to
// uServer one of above-defined server constants
// or zero to use pkeyserver
// pkeyserver server to send to (if uServer == 0)
// keysetMain keyset to which tls key is added and
// which contains signing keys
// keysetToSend keyset with keys to send
PGPError PGPclExport
PGPclSendKeysToServer (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hwndParent,
UINT uServer,
PGPKeyServerEntry* pkeyserver,
PGPKeySetRef keysetMain,
PGPKeySetRef keysetToSend);
// Sends keys in keyset to the root keyserver with notifications
//
// Entry parameters :
// hWndToReceiveNotifications window to get WM_NOTIFYs
// szServerURL server to send to
// keysetMain keyset to which tls key is added and
// which contains signing keys
// keysetToSend keyset with keys to send
//
// returns kPGPError_NoErr. Progress notifications and final
// results are sent to window in form of WM_NOTIFY messages
// keyserver notifications
#define PGPCL_SERVERDONE 0x0001
#define PGPCL_SERVERPROGRESS 0x0002
#define PGPCL_SERVERABORT 0x0003
#define PGPCL_SERVERERROR 0x0004
typedef struct _PGPclSERVEREVENT
{
NMHDR nmhdr;
VOID* pData;
BOOL cancel;
LONG step;
LONG total;
CHAR szmessage[256];
} PGPclSERVEREVENT, *PPGPclSERVEREVENT;
#define PGPCL_SERVERINFINITE -1L
PGPError PGPclExport
PGPclSendKeysToRootServerNotify (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hWndToReceiveNotifications,
PGPKeySetRef keysetMain,
PGPKeySetRef keysetToSend);
// Deletes keys in keyset from the specified keyserver
//
// Entry parameters :
// hwndParent parent window
// szServerURL server to send to
// space pending or active bucket
// keysetMain keyset to which tls key is added and
// which contains signing keys
// keysetToDelete keyset with keys to delete
PGPError PGPclExport
PGPclDeleteKeysFromServer (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hwndParent,
PGPKeyServerEntry* pkeyserver,
INT space,
PGPKeySetRef keysetMain,
PGPKeySetRef keysetToDelete);
// Disables keys in keyset on the specified keyserver
//
// Entry parameters :
// hwndParent parent window
// szServerURL server to send to
// space pending or active bucket
// keysetMain keyset to which tls key is added and
// which contains signing keys
// keysetToDisable keyset with keys to disable
PGPError PGPclExport
PGPclDisableKeysOnServer (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hwndParent,
PGPKeyServerEntry* pkeyserver,
INT space,
PGPKeySetRef keysetMain,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -