pkcs11-helper
Classes | Macros | Typedefs | Functions
pkcs11h-core.h File Reference

pkcs11-helper core. More...

Go to the source code of this file.

Classes

struct  pkcs11h_token_id_s
 Token identifier. More...
 

Macros

#define PKCS11H_FEATURE_MASK_ENGINE_CRYPTO_OPENSSL   (1<< 0)
 
#define PKCS11H_FEATURE_MASK_ENGINE_CRYPTO_GNUTLS   (1<< 1)
 
#define PKCS11H_FEATURE_MASK_ENGINE_CRYPTO_CRYPTOAPI   (1<< 2)
 
#define PKCS11H_FEATURE_MASK_ENGINE_CRYPTO_WIN32   (1<< 2)
 
#define PKCS11H_FEATURE_MASK_DEBUG   (1<< 3)
 
#define PKCS11H_FEATURE_MASK_THREADING   (1<< 4)
 
#define PKCS11H_FEATURE_MASK_TOKEN   (1<< 5)
 
#define PKCS11H_FEATURE_MASK_DATA   (1<< 6)
 
#define PKCS11H_FEATURE_MASK_CERTIFICATE   (1<< 7)
 
#define PKCS11H_FEATURE_MASK_SLOTEVENT   (1<< 8)
 
#define PKCS11H_FEATURE_MASK_OPENSSL   (1<< 9)
 
#define PKCS11H_FEATURE_MASK_ENGINE_CRYPTO_POLARSSL   (1<< 10)
 
#define PKCS11H_FEATURE_MASK_ENGINE_CRYPTO_MBEDTLS   (1<< 10)
 
#define PKCS11H_LOG_DEBUG2   5
 
#define PKCS11H_LOG_DEBUG1   4
 
#define PKCS11H_LOG_INFO   3
 
#define PKCS11H_LOG_WARN   2
 
#define PKCS11H_LOG_ERROR   1
 
#define PKCS11H_LOG_QUIET   0
 
#define PKCS11H_PIN_CACHE_INFINITE   -1
 
#define PKCS11H_PRIVATEMODE_MASK_AUTO   (0)
 
#define PKCS11H_PRIVATEMODE_MASK_SIGN   (1<<0)
 
#define PKCS11H_PRIVATEMODE_MASK_RECOVER   (1<<1)
 
#define PKCS11H_PRIVATEMODE_MASK_DECRYPT   (1<<2)
 
#define PKCS11H_PRIVATEMODE_MASK_UNWRAP   (1<<3)
 
#define PKCS11H_SLOTEVENT_METHOD_TRIGGER   1
 
#define PKCS11H_SLOTEVENT_METHOD_POLL   2
 
#define PKCS11H_SLOTEVENT_METHOD_FETCH   3
 
#define PKCS11H_PROMPT_MASK_ALLOW_PIN_PROMPT   (1<<0)
 
#define PKCS11H_PROMPT_MASK_ALLOW_TOKEN_PROMPT   (1<<1)
 
#define PKCS11H_PROMPT_MASK_ALLOW_ALL
 
#define PKCS11H_ENUM_METHOD_CACHE   0
 
#define PKCS11H_ENUM_METHOD_CACHE_EXIST   1
 
#define PKCS11H_ENUM_METHOD_RELOAD   2
 

Typedefs

typedef struct pkcs11h_token_id_spkcs11h_token_id_t
 Token identifier.
 
typedef void(* pkcs11h_hook_log_t) (IN void *const global_data, IN const unsigned flags, IN const char *const format, IN va_list args)
 Log hook. More...
 
typedef void(* pkcs11h_hook_slotevent_t) (IN void *const global_data)
 Slotevent hook. More...
 
typedef PKCS11H_BOOL(* pkcs11h_hook_token_prompt_t) (IN void *const global_data, IN void *const user_data, IN const pkcs11h_token_id_t token, IN const unsigned retry)
 Token prompt hook. More...
 
typedef PKCS11H_BOOL(* pkcs11h_hook_pin_prompt_t) (IN void *const global_data, IN void *const user_data, IN const pkcs11h_token_id_t token, IN const unsigned retry, OUT char *const pin, IN const size_t pin_max)
 PIN prompt hook. More...
 

Functions

const char * pkcs11h_getMessage (IN const CK_RV rv)
 Get message by return value. More...
 
unsigned int pkcs11h_getVersion (void)
 Get version of library. More...
 
unsigned int pkcs11h_getFeatures (void)
 Get features of library. More...
 
CK_RV pkcs11h_initialize (void)
 Inititalize helper interface. More...
 
CK_RV pkcs11h_terminate (void)
 Terminate helper interface. More...
 
void pkcs11h_setLogLevel (IN const unsigned flags)
 Set current log level of the helper. More...
 
unsigned pkcs11h_getLogLevel (void)
 Get current log level. More...
 
CK_RV pkcs11h_setForkMode (IN const PKCS11H_BOOL safe)
 How does the foked process bahaves after POSIX fork() More...
 
CK_RV pkcs11h_setLogHook (IN const pkcs11h_hook_log_t hook, IN void *const global_data)
 Set a log callback. More...
 
CK_RV pkcs11h_setSlotEventHook (IN const pkcs11h_hook_slotevent_t hook, IN void *const global_data)
 Set a slot event callback. More...
 
CK_RV pkcs11h_setTokenPromptHook (IN const pkcs11h_hook_token_prompt_t hook, IN void *const global_data)
 Set a token prompt callback. More...
 
CK_RV pkcs11h_setPINPromptHook (IN const pkcs11h_hook_pin_prompt_t hook, IN void *const global_data)
 Set a pin prompt callback. More...
 
CK_RV pkcs11h_setProtectedAuthentication (IN const PKCS11H_BOOL allow_protected_auth)
 Set global protected authentication mode. More...
 
CK_RV pkcs11h_setPINCachePeriod (IN const int pin_cache_period)
 Set global PIN cache timeout. More...
 
CK_RV pkcs11h_setMaxLoginRetries (IN const unsigned max_retries)
 Set global login retries attempts. More...
 
CK_RV pkcs11h_addProvider (IN const char *const reference, IN const char *const provider_location, IN const PKCS11H_BOOL allow_protected_auth, IN const unsigned mask_private_mode, IN const unsigned slot_event_method, IN const unsigned slot_poll_interval, IN const PKCS11H_BOOL cert_is_private)
 Add a PKCS#11 provider. More...
 
CK_RV pkcs11h_removeProvider (IN const char *const reference)
 Delete a PKCS#11 provider. More...
 
CK_RV pkcs11h_forkFixup (void)
 Handle special case of POSIX fork() More...
 
CK_RV pkcs11h_plugAndPlay (void)
 Handle slot rescan. More...
 
CK_RV pkcs11h_logout (void)
 Logout from all sessions. More...
 

Detailed Description

pkcs11-helper core.

Author
Alon Bar-Lev alon..nosp@m.barl.nosp@m.ev@gm.nosp@m.ail..nosp@m.com
See also
pkcs11-helper core interface.

pkcs11-helper, Copyright (C) Alon Bar-Lev <alon.barlev@gmail.com>OpenSC-Project.org Logo