📄 pgpcl.h
字号:
PGPKeySetRef keysetToDisable);
// Downloads a new groupset from the root server
//
// Entry parameters :
// hwndParent parent window
// keysetMain keyset to which tls key is added and
// which contains signing keys
// groupsetDownloaded newly downloaded groupset
PGPError PGPclExport
PGPclGetGroupsFromRootServer (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hwndParent,
PGPKeySetRef keysetMain,
PGPGroupSetRef* groupsetDownloaded);
// Downloads a new groupset from the root server
//
// Entry parameters :
// hwndParent parent window
// keysetMain keyset to which tls key is added and
// which contains signing keys
// groupsetToSend groupset to send to root server
PGPError PGPclExport
PGPclSendGroupsToRootServer (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hwndParent,
PGPKeySetRef keysetMain,
PGPGroupSetRef groupsetToSend);
// Create and send certificate request to CA server
//
// Entry parameters :
// hwndParent parent window
// keysetMain main keyset
// userid userid for which request will be made
// keysetKey keyset containing single key to request
// certificate for
PGPError PGPclExport
PGPclSendCertificateRequestToServer (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hwndParent,
PGPKeySetRef keysetMain,
PGPUserIDRef userid,
PGPKeySetRef keysetKey);
// Create and send certificate request to CA server with notifications
//
// Entry parameters :
// hwndToNotify window to receive progress notifications
// keysetMain main keyset
// userid userid for which request will be made
// keysetKey keyset containing single key to request
// certificate for
// pszPassPhrase passphrase of key in keysetKey
PGPError PGPclExport
PGPclSendCertificateRequestToServerNotify (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hwndToNotify,
PGPKeySetRef keysetMain,
PGPUserIDRef userid,
PGPKeySetRef keysetKey,
LPSTR pszPassPhrase);
// Get the previously-requested certificate from the CA server
//
// Entry parameters :
// hwndParent parent window
// keysetKey keyset containing single key for whic request
// was previously made
// userid userid to retrieve certificate for
// pkeysetCert buffer to receive PGPKeySetRef of found cert
PGPError PGPclExport
PGPclRetrieveCertificateFromServer (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hwndParent,
PGPKeySetRef keysetMain,
PGPKeySetRef keysetKey,
PGPUserIDRef userid,
PGPKeySetRef* pkeysetCert);
// Create and send certificate request to CA server
//
// Entry parameters :
// hwndParent parent window
// keysetMain main keyset containing CA root key
PGPError PGPclExport
PGPclGetCertificateRevocationsFromServer (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hwndParent,
PGPKeySetRef keysetMain);
// Create certificate request AV list
//
// Entry parameters :
// hwnd parent window
// bForceDlg TRUE=>forces dialog to appear
// userid userid of key for which cert req is made
// or kInvalidPGPUserID
// serverclass class of CA server or kPGPKeyServerClass_Invalid
// pAVlist receives pointer to AVlist
// pNumAVs receives number of AVs in list
PGPError PGPclExport
PGPclGetCACertRequestAVList (
HWND hwnd,
PGPContextRef context,
PGPBoolean bForceDlg,
PGPUserIDRef userid,
PGPKeyServerClass serverclass,
PGPAttributeValue** ppAVlist,
PGPUInt32* pNumAVs);
// Free AV list previously returned by PGPclGetCACertRequestAVList
//
// Entry parameters :
// pAVlist pointer to AVlist
// NumAVs number of AVs in list
PGPError PGPclExport
PGPclFreeCACertRequestAVList (
PGPAttributeValue* pAVlist,
PGPUInt32 NumAVs);
// return a string description of a given attribute type
//
// Entry parameters :
// attr attribute
// psz string buffer to fill
// uLen size of string buffer
//
// Note: returns kPGPError_ItemNotFound if no string available for attribute
PGPError PGPclExport
PGPclGetAVListAttributeString (
PGPAVAttribute attr,
LPSTR psz,
UINT uLen);
// _______________________________________________________
//
// Split key sharing functions
// Send key share file to remote computer
//
// Entry parameters :
// context - PGP library context
// hwndParent - handle of parent window
// keysetMain - main keyset (should contain decryption
// and authentication keys)
PGPError PGPclExport
PGPclSendShares (
PGPContextRef context,
PGPtlsContextRef tlsContext,
HWND hwndParent,
PGPKeySetRef keysetMain);
// Reconstitute key by collecting key shares
//
// Entry parameters :
// context - PGP library context
// hwndParent - handle of parent window
// keysetMain - main keyset (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,
PGPKeySetRef keysetMain,
PGPKeyRef 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
// keysetMain - main keyset to which keyAuth may be added
// uFlags - flags controlling text display
//
// returns kPGPError_NoErr or kPGPError_UserAbort
#define PGPCL_SHOWAUTHENTICATION 0x0000
#define PGPCL_AUTHRECONSTITUTING 0x0001
#define PGPCL_AUTHNEWKEY 0x0002
#define PGPCL_AUTHUNEXPECTEDKEY 0x0003
#define PGPCL_AUTHEXPECTEDKEY 0x0004
PGPError PGPclExport
PGPclConfirmRemoteAuthentication (
PGPContextRef context,
HWND hwndParent,
LPSTR pszServer,
PGPKeyRef keyAuth,
PGPtlsCipherSuiteNum tlsCipher,
PGPKeySetRef keysetMain,
UINT uFlags);
// _______________________________________________________
//
// 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
#define PGPCL_ASCIIARMOR 0x0001
#define PGPCL_DETACHEDSIG 0x0002
#define PGPCL_PASSONLY 0x0004
#define PGPCL_WIPEORIG 0x0008
#define PGPCL_FYEO 0x0010
#define PGPCL_SDA 0x0020
// disable bits
#define PGPCL_DISABLE_ASCIIARMOR 0x0001
#define PGPCL_DISABLE_AUTOMODE 0x0002
#define PGPCL_DISABLE_PASSONLY 0x0004
#define PGPCL_DISABLE_WIPEORIG 0x0008
#define PGPCL_DISABLE_FYEO 0x0010
#define PGPCL_DISABLE_SDA 0x0020
// flag bits
#define PGPCL_RSAENCRYPT 0x0001
#define PGPCL_DECRYPTION 0x0002
#define PGPCL_ENCRYPTION 0x0004
#define PGPCL_KEYPASSPHRASE 0x0008
#define PGPCL_REJECTSPLITKEYS 0x0010
PGPError PGPclExport
PGPclGetPhrase (
PGPContextRef context,
PGPKeySetRef MainKeySet,
HWND hWndParent,
LPSTR szPrompt,
LPSTR* ppszPhrase,
PGPKeySetRef KeySet,
PGPKeyID* pKeyIDs,
UINT uKeyCount,
PGPKeyRef* pKey,
UINT* puOptions,
UINT uFlags,
PGPByte** ppPasskeyBuffer,
PGPUInt32* piPasskeyLength,
PGPUInt32 MinLength,
PGPUInt32 MinQuality,
PGPtlsContextRef tlsContext,
PGPKeySetRef *AddedKeys,
char *szTitle
) ;
// Recipient dialog glue call
//
// Interfaces to PGPsdkUI calls.
#define CurrentPGPrecipVersion 'DUKE'
typedef struct _recipientdialogstruct
{
DWORD Version;
HWND hwndParent;
char * szTitle;
PGPContextRef Context;
PGPKeySetRef OriginalKeySetRef;
PGPKeySetRef SelectedKeySetRef;
char ** szRecipientArray;
DWORD dwNumRecipients;
DWORD dwOptions;
DWORD dwFlags;
DWORD dwDisableFlags;
PGPtlsContextRef tlsContext;
PGPKeySetRef AddedKeys;
} RECIPIENTDIALOGSTRUCT, *PRECIPIENTDIALOGSTRUCT;
UINT PGPclExport PGPclRecipientDialog(PRECIPIENTDIALOGSTRUCT prds);
// Wipe and deallocate phrase buffer.
//
// Entry parameters :
// szPhrase - passphrase buffer to wipe and deallocate
//
VOID PGPclExport
PGPclFreePhrase (LPSTR szPhrase);
//___________________________________
//
// passphrase caching routines
//
// PGPclGetCachedDecryptionPhrase
// This routine is called to get either cached phrase
// (if available) or prompt user for phrase.
PGPError PGPclExport
PGPclGetCachedDecryptionPhrase (
PGPContextRef context,
PGPtlsContextRef tlsContext,
PGPKeySetRef keysetMain,
HWND hwnd,
LPSTR szPrompt,
BOOL bForceUserInput,
LPSTR* pszBuffer,
PGPKeySetRef keysetEncryptedTo,
PGPKeyID* pkeyidEncryptedTo,
UINT uKeyIDCount,
PGPByte** ppPasskeyBuffer,
PGPUInt32* piPasskeyLength,
PGPKeySetRef* pkeysetAdded,
char * szTitle);
//
// PGPclGetCachedSigningPhrase
// 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,
LPSTR szPrompt,
BOOL bForceUserInput,
LPSTR* pszBuffer,
PGPKeySetRef keysetSigning,
PGPKeyRef* pkeySigning,
PGPHashAlgorithm* pulHashAlg,
UINT* puOptions,
UINT uFlags,
PGPByte** ppPasskeyBuffer,
PGPUInt32* piPasskeyLength,
PGPKeySetRef* pkeysetAdded,
char * szTitle);
#define PGPCL_DECRYPTIONCACHE 0x0001
#define PGPCL_SIGNINGCACHE 0x0002
//
// PGPclPurgeCachedPassphrase
// Called to purge phrases from cache.
// dwFlags is the logical OR of PGPCL_DECRYPTIONCACHE and
// PGPCL_SIGNINGCACHE.
BOOL PGPclExport
PGPclPurgeCachedPassphrase (DWORD dwFlags);
//
// PGPclFreeCachedPhrase
// Called to wipe and free the phrase returned by
// PGPGetCachedPhrase.
VOID PGPclExport
PGPclFreeCachedPhrase (LPSTR szPhrase);
//
// PGPclQueryDecryptCacheSecsRemaining
// Returns number of seconds remaining until cache expires
INT PGPclExport
PGPclQueryDecryptionCacheSecsRemaining (VOID);
//
// PGPclQuerySignCacheSecsRemaining
// Returns number of seconds remaining until cache expires
INT PGPclExport
PGPclQuerySigningCacheSecsRemaining (VOID);
// Broadcast message that indicates that the receiving module
// should purge its passphrase cache(s)
//
// Entry parameters :
// wParam - logical OR of PGPCL_DECRYPTIONCACHE and
// PGPCL_SIGNINGCACHE.
// 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 PURGEPASSPHRASECACEHMSG ("PGPM_PURGEPASSPHRASECACHE")
VOID PGPclExport
PGPclNotifyPurgePassphraseCache (
WPARAM wParam,
LPARAM lParam);
// __________________________________________________________
//
// Check to see if it's time to auto-update keys
//
// Entry parameters :
// memoryMgr Memory manager ref
// bResetDates TRUE=>set "last updated" date to today
// pbUpdateAllKeys Pointer to boolean, TRUE if it's
// time to update all keys
// pbUpdateTrustedIntroducers Pointer to boolean, TRUE if it's
// time to update trusted introducers
// pbUpdateCRL Pointer to boolean, TRUE if it's
// time to update CA CRLs
PGPError PGPclExport
PGPclCheckAutoUpdate(PGPMemoryMgrRef memoryMgr,
PGPBoolean bResetDates,
PGPBoolean* pbUpdateAllKeys,
PGPBoolean* pbUpdateTrustedIntroducers,
PGPBoolean* pbUpdateCRL);
// __________________________________________________________
//
// 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,
PGPKeySetRef KeySetMain,
PGPtlsContextRef tlsContext,
HWND hwnd,
PGPEvent *event,
PGPKeyID signingKeyID,
PGPBoolean *pbGotKeys);
// _______________________________________________________
#ifdef __cplusplus
}
#endif
#endif /* ] Included_PGPcl_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 + -