// implement callback function int confirm_cb(X509 * xcert, cst_t_cert_folder * folder, cst_t_cert_purpose * purpose, unsigned char * out_pass, int is_pair, int *cancel, void * user_data) { if (is_pair) { *out_pass = "secret"; *purpose = CST_PURPOSE_SSL_CLIENT; *folder = CST_FOLDER_PERSONAL; *cancel = FALSE; return TRUE; } else { *purpose = CST_PURPOSE_CA; *folder = CST_FOLDER_CA; *cancel = FALSE; return TRUE; } }