pam_pkcs11 0.6.12
pkcs11_lib.h
Go to the documentation of this file.
1/*
2 * PKCS #11 PAM Login Module
3 * Copyright (C) 2003 Mario Strasser <mast@gmx.net>,
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * $Id$
16 */
17#ifndef __PKCS11_LIB_H__
18#define __PKCS11_LIB_H__
19
20#include "cert_st.h"
21
22typedef struct cert_object_str cert_object_t;
23typedef struct pkcs11_handle_str pkcs11_handle_t;
24
25#ifndef __PKCS11_LIB_C__
26#define PKCS11_EXTERN extern
27#else
28#define PKCS11_EXTERN
29#endif
30
35 unsigned int *slot);
37 int slot_num, const char *slot_label,
38 unsigned int *slot);
41 int wanted_slot_num,
42 const char *wanted_token_label,
43 unsigned int *slot);
45 const char *wanted_slot_label,
46 unsigned int *slot);
48 const char *wanted_slot_label,
49 const char *wanted_token_label,
50 unsigned int *slot);
52 const char *wanted_slot_label,
53 const char *wanted_token_label,
54 unsigned int *slot);
64 int *ncert);
67 unsigned char *data, unsigned long length,
68 unsigned char **signature, unsigned long *signature_length);
69PKCS11_EXTERN int get_random_value(unsigned char *data, int length);
70PKCS11_EXTERN void cleanse(void *ptr, size_t len);
71
72#undef PKCS11_EXTERN
73
74/* end of pkcs11_lib.h */
75#endif
struct cert_policy_st cert_policy
Definition cert_st.h:26
PKCS11_EXTERN int get_slot_protected_authentication_path(pkcs11_handle_t *h)
PKCS11_EXTERN X509 * get_X509_certificate(cert_object_t *cert)
PKCS11_EXTERN int find_slot_by_slotlabel_and_tokenlabel(pkcs11_handle_t *h, const char *wanted_slot_label, const char *wanted_token_label, unsigned int *slot)
struct pkcs11_handle_str pkcs11_handle_t
Definition pkcs11_lib.h:23
PKCS11_EXTERN int get_private_key(pkcs11_handle_t *h, cert_object_t *)
PKCS11_EXTERN int crypto_init(cert_policy *policy)
PKCS11_EXTERN int pkcs11_pass_login(pkcs11_handle_t *h, int nullok)
PKCS11_EXTERN int find_slot_by_number(pkcs11_handle_t *h, unsigned int slot_num, unsigned int *slot)
PKCS11_EXTERN int get_slot_login_required(pkcs11_handle_t *h)
#define PKCS11_EXTERN
Definition pkcs11_lib.h:26
PKCS11_EXTERN int wait_for_token(pkcs11_handle_t *h, int wanted_slot_num, const char *wanted_token_label, unsigned int *slot)
PKCS11_EXTERN int open_pkcs11_session(pkcs11_handle_t *h, unsigned int slot)
PKCS11_EXTERN void cleanse(void *ptr, size_t len)
struct cert_object_str cert_object_t
Definition pkcs11_lib.h:22
PKCS11_EXTERN int load_pkcs11_module(const char *module, pkcs11_handle_t **h)
PKCS11_EXTERN int wait_for_token_by_slotlabel(pkcs11_handle_t *h, const char *wanted_slot_label, const char *wanted_token_label, unsigned int *slot)
PKCS11_EXTERN cert_object_t ** get_certificate_list(pkcs11_handle_t *h, int *ncert)
PKCS11_EXTERN int find_slot_by_number_and_label(pkcs11_handle_t *h, int slot_num, const char *slot_label, unsigned int *slot)
PKCS11_EXTERN int find_slot_by_slotlabel(pkcs11_handle_t *h, const char *wanted_slot_label, unsigned int *slot)
PKCS11_EXTERN int pkcs11_login(pkcs11_handle_t *h, char *password)
PKCS11_EXTERN void release_pkcs11_module(pkcs11_handle_t *h)
PKCS11_EXTERN int close_pkcs11_session(pkcs11_handle_t *h)
PKCS11_EXTERN int init_pkcs11_module(pkcs11_handle_t *h, int flag)
PKCS11_EXTERN int get_random_value(unsigned char *data, int length)
PKCS11_EXTERN int sign_value(pkcs11_handle_t *h, cert_object_t *, unsigned char *data, unsigned long length, unsigned char **signature, unsigned long *signature_length)
PKCS11_EXTERN const char * get_slot_tokenlabel(pkcs11_handle_t *h)