
@subheading int
@anchor{int}
@deftypefun {typedef} {int} (* @var{gnutls_pin_callback_t})
@var{gnutls_pin_callback_t}: -- undescribed --

Callback function type for PKCS@code{11}  or TPM PIN entry.  It is set by
functions like @code{gnutls_pkcs11_set_pin_function()} .

The callback should provides the PIN code to unlock the token with
label  @code{token_label} , specified by the URL  @code{token_url} .

The PIN code, as a NUL-terminated ASCII string, should be copied
into the  @code{pin} buffer (of maximum size  @code{pin_max} ), and return 0 to
indicate success.  Alternatively, the callback may return a
negative gnutls error code to indicate failure and cancel PIN entry
(in which case, the contents of the  @code{pin} parameter are ignored).

When a PIN is required, the callback will be invoked repeatedly
(and indefinitely) until either the returned PIN code is correct,
the callback returns failure, or the token refuses login (e.g. when
the token is locked due to too many incorrect PINs!).  For the
first such invocation, the  @code{attempt} counter will have value zero;
it will increase by one for each subsequent attempt.

@strong{Returns:} @code{GNUTLS_E_SUCCESS}  (0) on success or a negative error code on error.

@strong{Since:} 2.12.0
@end deftypefun


@c gnutls_certificate_import_flags
@table @code
@item GNUTLS_@-X509_@-CRT_@-LIST_@-IMPORT_@-FAIL_@-IF_@-EXCEED
Fail if the
certificates in the buffer are more than the space allocated for
certificates. The error code will be @code{GNUTLS_E_SHORT_MEMORY_BUFFER} .
@item GNUTLS_@-X509_@-CRT_@-LIST_@-FAIL_@-IF_@-UNSORTED
Fail if the certificates
in the buffer are not ordered starting from subject to issuer.
The error code will be @code{GNUTLS_E_CERTIFICATE_LIST_UNSORTED} .
@end table
