📄 pgpkeys.h
字号:
PGPError PGPGetPrimaryUserIDValidity(PGPKeyDBObjRef key,
PGPValidity *validity);
PGPError PGPGetPrimaryUserIDName(PGPKeyDBObjRef key, void *buffer,
PGPSize bufferSize, PGPSize *dataSize);
PGPError PGPGetKeyForUsage( PGPKeyDBObjRef key, PGPUInt32 usageFlags,
PGPKeyDBObjRef *outRef );
/*____________________________________________________________________________
Key filters
____________________________________________________________________________*/
PGPError PGPNewKeyDBObjBooleanFilter( PGPContextRef context,
PGPKeyDBObjProperty whichProperty, PGPBoolean match,
PGPFilterRef *outFilter );
PGPError PGPNewKeyDBObjNumericFilter( PGPContextRef context,
PGPKeyDBObjProperty whichProperty, PGPUInt32 matchValue,
PGPMatchCriterion matchCriteria, PGPFilterRef *outFilter );
PGPError PGPNewKeyDBObjTimeFilter( PGPContextRef context,
PGPKeyDBObjProperty whichProperty, PGPTime matchValue,
PGPMatchCriterion matchCriteria, PGPFilterRef *outFilter );
PGPError PGPNewKeyDBObjDataFilter( PGPContextRef context,
PGPKeyDBObjProperty whichProperty, const void *matchData,
PGPSize matchDataSize, PGPMatchCriterion matchCriteria,
PGPFilterRef *outFilter );
PGPError PGPFreeFilter( PGPFilterRef filter );
PGPError PGPIncFilterRefCount( PGPFilterRef filter );
PGPError PGPFilterChildObjects( PGPFilterRef filter,
PGPBoolean filterChildren );
/* freeing outfilter will call PGPFreeFilter on filter */
PGPError PGPNegateFilter( PGPFilterRef filter, PGPFilterRef *outFilter);
/* freeing outfilter will call PGPFreeFilter on filter1, filter2 */
PGPError PGPIntersectFilters( PGPFilterRef filter1, PGPFilterRef filter2,
PGPFilterRef *outFilter);
/* freeing outfilter will call PGPFreeFilter on filter1, filter2 */
PGPError PGPUnionFilters( PGPFilterRef filter1, PGPFilterRef filter2,
PGPFilterRef *outFilter);
PGPError PGPFilterKeySet( PGPKeySetRef origSet, PGPFilterRef filter,
PGPKeySetRef *resultSet );
PGPError PGPFilterKeyDB( PGPKeyDBRef keyDB, PGPFilterRef filter,
PGPKeySetRef *resultSet );
/* Keyserver filter functions */
PGPError PGPLDAPQueryFromFilter( PGPFilterRef filter, char **queryOut );
PGPError PGPLDAPX509QueryFromFilter( PGPFilterRef filter, char **queryOut );
PGPError PGPHKSQueryFromFilter( PGPFilterRef filter, char **queryOut );
PGPError PGPNetToolsCAHTTPQueryFromFilter( PGPFilterRef filter,
char **queryOut );
/*____________________________________________________________________________
Key/signature validation
____________________________________________________________________________*/
PGPError PGPCalculateTrust( PGPKeySetRef keySet, PGPKeyDBRef optionalKeyDB);
PGPError PGPCheckKeyRingSigs( PGPKeySetRef keysToCheck,
PGPKeyDBRef optionalSigningKeyDB, PGPBoolean checkAll,
PGPEventHandlerProcPtr eventHandler,
PGPUserValue eventHandlerData );
/*____________________________________________________________________________
Key DB object creation/deletion
____________________________________________________________________________*/
PGPError PGPGenerateKey( PGPContextRef context, PGPKeyDBObjRef *key,
PGPOptionListRef firstOption, ...);
PGPError PGPGenerateSubKey( PGPContextRef context, PGPKeyDBObjRef *subkey,
PGPOptionListRef firstOption, ...);
PGPUInt32 PGPGetKeyEntropyNeeded( PGPContextRef context,
PGPOptionListRef firstOption, ...);
PGPError PGPAddUserID( PGPKeyDBObjRef key, char const *userID,
PGPOptionListRef firstOption, ...);
PGPError PGPAddAttributeUserID( PGPKeyDBObjRef key,
PGPAttributeType attributeType,
PGPByte *attributeData, PGPSize attributeLength,
PGPOptionListRef firstOption, ...);
PGPError PGPCertifyUserID( PGPKeyDBObjRef userID,
PGPKeyDBObjRef certifyingKey,
PGPOptionListRef firstOption, ...);
PGPError PGPCopyKeyDBObj( PGPKeyDBObjRef keyDBObj, PGPKeyDBRef destKeyDB,
PGPKeyDBObjRef *destKeyDBObj );
PGPError PGPCopyKeys( PGPKeySetRef keySet, PGPKeyDBRef destKeyDB,
PGPKeySetRef *destKeySet );
PGPError PGPDeleteKeyDBObj( PGPKeyDBObjRef keyDBObj );
PGPError PGPDeleteKeys( PGPKeySetRef keySet );
/*____________________________________________________________________________
Key manipulation
____________________________________________________________________________*/
PGPError PGPSetPrimaryUserID( PGPKeyDBObjRef userID,
PGPOptionListRef firstOption, ...);
PGPError PGPGetSigCertifierKey( PGPKeyDBObjRef cert,
PGPKeyDBRef searchKeyDB, PGPKeyDBObjRef *certkey);
PGPError PGPGetSigX509CertifierSig( PGPKeyDBObjRef cert,
PGPKeyDBRef searchKeyDB, PGPKeyDBObjRef *certsig);
PGPError PGPCountAdditionalRecipientRequests( PGPKeyDBObjRef basekey,
PGPUInt32 * numARKeys);
PGPError PGPGetIndexedAdditionalRecipientRequestKey( PGPKeyDBObjRef basekey,
PGPUInt32 nth, PGPKeyDBObjRef *arkey,
PGPKeyID *arkeyid, PGPByte *arclass );
PGPError PGPCountRevocationKeys( PGPKeyDBObjRef basekey,
PGPUInt32 * numRevKeys);
PGPError PGPGetIndexedRevocationKey( PGPKeyDBObjRef basekey, PGPUInt32 nth,
PGPKeyDBObjRef *revkey, PGPKeyID *revkeyid );
PGPError PGPGetCRLDistributionPoints( PGPKeyDBObjRef cakey,
PGPUInt32 *pnDistPoints, PGPByte **pDpoints,
PGPSize **pdpointLengths );
PGPError PGPExport( PGPContextRef context,
PGPOptionListRef firstOption, ... );
PGPError PGPImport( PGPContextRef context, PGPKeyDBRef *importedKeysDB,
PGPOptionListRef firstOption, ...);
PGPError PGPRevokeSig( PGPKeyDBObjRef cert,
PGPOptionListRef firstOption, ...);
PGPError PGPRevoke( PGPKeyDBObjRef key,
PGPOptionListRef firstOption, ...);
PGPError PGPChangePassphrase( PGPKeyDBObjRef key,
PGPOptionListRef firstOption, ...);
PGPBoolean PGPPassphraseIsValid( PGPKeyDBObjRef key,
PGPOptionListRef firstOption, ...);
PGPError PGPPurgePassphraseCache( PGPContextRef context );
PGPError PGPCountCachedPassphrases( PGPContextRef context,
PGPUInt32 *pnLocal, PGPUInt32 *pnGlobal,
PGPUInt32 *pnOtherLocal );
/*
* Trust values for PGPSetKeyTrust and kPGPKeyPropTrust property:
*
* kPGPKeyTrust_Undefined (do not pass to PGPSetKeyTrust)
* kPGPKeyTrust_Unknown (unknown)
* kPGPKeyTrust_Never (never)
* kPGPKeyTrust_Marginal (sometimes)
* kPGPKeyTrust_Complete (always)
* kPGPKeyTrust_Ultimate (do not pass to PGPSetKeyTrust)
*/
PGPError PGPSetKeyTrust( PGPKeyDBObjRef key, PGPUInt32 trust);
PGPInt32 PGPCompareKeys( PGPKeyDBObjRef a, PGPKeyDBObjRef b,
PGPKeyOrdering order );
PGPInt32 PGPCompareUserIDStrings(char const *a, char const *b);
/*____________________________________________________________________________
Key lists
____________________________________________________________________________*/
PGPError PGPOrderKeySet( PGPKeySetRef src, PGPKeyOrdering order,
PGPBoolean reverseOrder, PGPKeyListRef *outRef );
PGPError PGPIncKeyListRefCount( PGPKeyListRef keys);
PGPError PGPFreeKeyList( PGPKeyListRef keys );
/*____________________________________________________________________________
Key list iteration
____________________________________________________________________________*/
PGPError PGPNewKeyIter( PGPKeyListRef keys, PGPKeyIterRef *outRef);
PGPError PGPNewKeyIterFromKeySet( PGPKeySetRef keys, PGPKeyIterRef *outRef);
PGPError PGPNewKeyIterFromKeyDB( PGPKeyDBRef keyDB, PGPKeyIterRef *outRef);
PGPError PGPCopyKeyIter( PGPKeyIterRef orig, PGPKeyIterRef *outRef);
PGPError PGPFreeKeyIter( PGPKeyIterRef iter);
PGPInt32 PGPKeyIterIndex( PGPKeyIterRef iter);
PGPError PGPKeyIterRewind( PGPKeyIterRef iter, PGPKeyDBObjType objectType);
PGPInt32 PGPKeyIterSeek( PGPKeyIterRef iter, PGPKeyDBObjRef key);
PGPError PGPKeyIterMove( PGPKeyIterRef iter, PGPInt32 relOffset,
PGPKeyDBObjRef *outRef);
PGPError PGPKeyIterNextKeyDBObj( PGPKeyIterRef iter,
PGPKeyDBObjType objectType, PGPKeyDBObjRef *outRef);
PGPError PGPKeyIterPrevKeyDBObj( PGPKeyIterRef iter,
PGPKeyDBObjType objectType, PGPKeyDBObjRef *outRef);
PGPError PGPKeyIterGetKeyDBObj( PGPKeyIterRef iter,
PGPKeyDBObjType objectType, PGPKeyDBObjRef *outRef);
/*____________________________________________________________________________
Get/set user value
____________________________________________________________________________*/
PGPError PGPSetKeyDBObjUserValue( PGPKeyDBObjRef key,
PGPUserValue userValue);
PGPError PGPGetKeyDBObjUserValue( PGPKeyDBObjRef key,
PGPUserValue *userValue);
/* Passphrase conversion to passkeybuffer */
/* The size of the output buffer is from the kPGPKeyPropLockingBits property */
PGPError PGPGetPasskeyBuffer ( PGPKeyDBObjRef key,
void *passkeyBuffer, PGPOptionListRef firstOption,...);
/* Change key options which are stored in self signatures internally */
PGPError PGPAddKeyOptions( PGPKeyDBObjRef key,
PGPOptionListRef firstOption, ...);
PGPError PGPRemoveKeyOptions( PGPKeyDBObjRef key,
PGPOptionListRef firstOption, ...);
PGPError PGPUpdateKeyOptions( PGPKeyDBObjRef key,
PGPOptionListRef firstOption, ...);
/*____________________________________________________________________________
Key IDs
____________________________________________________________________________*/
PGPError PGPNewKeyID( const PGPByte *keyIDBytes, PGPSize numKeyIDBytes,
PGPPublicKeyAlgorithm pkalg, PGPKeyID *id );
PGPError PGPNewKeyIDFromString( const char *string,
PGPPublicKeyAlgorithm pkalg, PGPKeyID *id );
PGPError PGPGetKeyIDAlgorithm( const PGPKeyID *keyID,
PGPPublicKeyAlgorithm *pkalg );
enum PGPKeyIDStringType_
{
kPGPKeyIDString_Abbreviated = 1,
kPGPKeyIDString_Full = 2,
PGP_ENUM_FORCE( PGPKeyIDStringType_ )
};
PGPENUM_TYPEDEF( PGPKeyIDStringType_, PGPKeyIDStringType );
#define kPGPMaxKeyIDStringSize ( 127 + 1 )
PGPError PGPGetKeyIDString( PGPKeyID const * ref, PGPKeyIDStringType type,
char outString[ kPGPMaxKeyIDStringSize ] );
/* returns 0 if equal, -1 if key1 < key2, 1 if key1 > key2 */
PGPInt32 PGPCompareKeyIDs( PGPKeyID const * key, PGPKeyID const * key2);
/*____________________________________________________________________________
Token functions
____________________________________________________________________________*/
PGPError PGPCountTokens( PGPContextRef context, PGPUInt32 *numTokens );
PGPError PGPGetTokenInfo( PGPContextRef context,
PGPUInt32 tokNumber, PGPTokenInfo *tokenInfo);
PGPError PGPDeleteKeyOnToken( PGPKeyDBObjRef key,
PGPUInt32 tokNumber /*-1 for any token*/,
const PGPByte *pin, PGPSize pinLen );
PGPError PGPWipeToken( PGPContextRef context, PGPUInt32 tokNumber,
PGPByte const *passphrase, PGPSize passphraseLength );
PGPError PGPTokenPassphraseIsValid( PGPContextRef context,
PGPUInt32 tokNumber, PGPByte const *passphrase,
PGPSize passphraseLength );
PGPError PGPSetPKCS11DrvFile( PGPByte *module );
/*____________________________________________________________________________
Getting contexts back from key related items.
____________________________________________________________________________*/
PGPContextRef PGPPeekKeyDBContext( PGPKeyDBRef ref );
PGPContextRef PGPPeekKeyDBObjContext( PGPKeyDBObjRef ref );
PGPContextRef PGPPeekKeyListContext( PGPKeyListRef ref );
PGPContextRef PGPPeekKeySetContext( PGPKeySetRef ref );
PGPContextRef PGPPeekKeyIterContext( PGPKeyIterRef ref );
/*____________________________________________________________________________
Getting parent objects from key related items. If the input is invalid,
you get kInvalidPGPKeyDBObjRef back.
____________________________________________________________________________*/
PGPKeyDBRef PGPPeekKeyDBObjKeyDB( PGPKeyDBObjRef ref );
PGPKeyDBObjRef PGPPeekKeyDBObjKey( PGPKeyDBObjRef ref );
PGPKeyDBObjRef PGPPeekKeyDBObjUserID( PGPKeyDBObjRef ref );
/*____________________________________________________________________________
Secret sharing functionality
____________________________________________________________________________*/
PGPError PGPSecretShareData(PGPContextRef context,
void const * input, PGPSize inputBytes,
PGPUInt32 threshold, PGPUInt32 nShares, void * output);
PGPError PGPSecretReconstructData(PGPContextRef context,
void * input, PGPSize outputBytes,
PGPUInt32 nShares, void * output);
/*____________________________________________________________________________
X509 certificate specific
____________________________________________________________________________*/
PGPError PGPVerifyX509CertificateChain (PGPContextRef context,
PGPByte *certchain, PGPByte *rootcerts);
PGPError PGPCreateDistinguishedName( PGPContextRef context,
char const *str, PGPByte **pdname, PGPSize *pdnamelen );
PGPError PGPCreateX509Certificate(PGPKeyDBObjRef signingSig,
PGPKeyDBObjRef signedKey, PGPKeyDBObjRef *newSig,
PGPOptionListRef firstOption, ...);
/* Pass PKCS-10 format request in PGPOInput.... */
PGPError PGPCreateX509CertificateFromRequest(PGPKeyDBObjRef signingSig,
PGPKeyDBObjRef *newSig, PGPOptionListRef firstOption, ...);
PGPError PGPCreateSelfSignedX509Certificate(PGPKeyDBObjRef signingKey,
PGPKeyDBObjRef *newSig, PGPOptionListRef firstOption, ...);
PGPError PGPCreateX509CRL(PGPKeyDBObjRef signingKey,
PGPKeySetRef revokedSigs,
PGPOptionListRef firstOption, ...);
PGP_END_C_DECLARATIONS
#endif /* ] Included_pgpKeys_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 + -