1gnutls_pkcs11_set_pin_function(3) gnutls gnutls_pkcs11_set_pin_function(3)
2
3
4
6 gnutls_pkcs11_set_pin_function - API function
7
9 #include <gnutls/gnutls.h>
10
11 void gnutls_pkcs11_set_pin_function(gnutls_pkcs11_pin_callback_t fn,
12 void * userdata);
13
15 gnutls_pkcs11_pin_callback_t fn
16 The PIN callback
17
18 void * userdata
19 data to be supplied to callback
20
22 This function will set a callback function to be used when a PIN is
23 required for PKCS 11 operations.
24
25 Callback for PKCS11 PIN entry. The callback provides the PIN code to
26 unlock the token with label 'token_label', specified by the URL
27
28 The PIN code, as a NUL-terminated ASCII string, should be copied into
29 the 'pin' buffer (of maximum size pin_max), and return 0 to indicate
30 success. Alternatively, the callback may return a negative gnutls error
31 code to indicate failure and cancel PIN entry (in which case, the con‐
32 tents of the 'pin' parameter are ignored).
33
34 When a PIN is required, the callback will be invoked repeatedly (and
35 indefinitely) until either the returned PIN code is correct, the call‐
36 back returns failure, or the token refuses login (e.g. when the token
37 is locked due to too many incorrect PINs!). For the first such invoca‐
38 tion, the 'attempt' counter will have value zero; it will increase by
39 one for each subsequent attempt.
40
42 On success, GNUTLS_E_SUCCESS is returned, otherwise a negative error
43 value.
44
46 Report bugs to <bug-gnutls@gnu.org>. GnuTLS home page:
47 http://www.gnu.org/software/gnutls/ General help using GNU software:
48 http://www.gnu.org/gethelp/
49
51 Copyright © 2008 Free Software Foundation.
52 Copying and distribution of this file, with or without modification,
53 are permitted in any medium without royalty provided the copyright
54 notice and this notice are preserved.
55
57 The full documentation for gnutls is maintained as a Texinfo manual.
58 If the info and gnutls programs are properly installed at your site,
59 the command
60
61 info gnutls
62
63 should give you access to the complete manual.
64
65
66
67gnutls 2.12.6.1 gnutls_pkcs11_set_pin_function(3)