~nutznboltz-deactivatedaccount/ubuntu/precise/gnutls26/fix-lp926350

« back to all changes in this revision

Viewing changes to doc/gnutls-api.texi

  • Committer: Package Import Robot
  • Author(s): Andreas Metzler
  • Date: 2011-10-01 15:28:13 UTC
  • mfrom: (12.1.20 sid)
  • Revision ID: package-import@ubuntu.com-20111001152813-yygm1c4cxonfxhzy
Tags: 2.12.11-1
* New upstream version.
  + Allow CA importing of 0 certificates to succeed. Closes: #640639
* Add libp11-kit-dev to libgnutls-dev dependencies. (see #643811)
* [20_guiledocstring.diff] guile: Fix docstring extraction with CPP 4.5+.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
 
76
76
@subheading gnutls_anon_allocate_client_credentials
77
77
@anchor{gnutls_anon_allocate_client_credentials}
78
 
@deftypefun {int} {gnutls_anon_allocate_client_credentials} (gnutls_anon_client_credentials_t *       @var{sc})
 
78
@deftypefun {int} {gnutls_anon_allocate_client_credentials} (gnutls_anon_client_credentials_t *                                          @var{sc})
79
79
@var{sc}: is a pointer to a @code{gnutls_anon_client_credentials_t} structure.
80
80
 
81
81
This structure is complex enough to manipulate directly thus
86
86
 
87
87
@subheading gnutls_anon_allocate_server_credentials
88
88
@anchor{gnutls_anon_allocate_server_credentials}
89
 
@deftypefun {int} {gnutls_anon_allocate_server_credentials} (gnutls_anon_server_credentials_t *       @var{sc})
 
89
@deftypefun {int} {gnutls_anon_allocate_server_credentials} (gnutls_anon_server_credentials_t *                                          @var{sc})
90
90
@var{sc}: is a pointer to a @code{gnutls_anon_server_credentials_t} structure.
91
91
 
92
92
This structure is complex enough to manipulate directly thus this
243
243
 
244
244
@subheading gnutls_certificate_allocate_credentials
245
245
@anchor{gnutls_certificate_allocate_credentials}
246
 
@deftypefun {int} {gnutls_certificate_allocate_credentials} (gnutls_certificate_credentials_t *       @var{res})
 
246
@deftypefun {int} {gnutls_certificate_allocate_credentials} (gnutls_certificate_credentials_t *                                          @var{res})
247
247
@var{res}: is a pointer to a @code{gnutls_certificate_credentials_t} structure.
248
248
 
249
249
This structure is complex enough to manipulate directly thus this
317
317
 
318
318
This function will delete all the CA name in the given
319
319
credentials. Clients may call this to save some memory since in
320
 
client side the CA names are not used.
 
320
client side the CA names are not used. Servers might want to use
 
321
this function if a large list of trusted CAs is present and
 
322
sending the names of it would just consume bandwidth without providing 
 
323
information to client.
321
324
 
322
325
CA names are used by servers to advertize the CAs they support to
323
326
clients.
366
369
TLS negotiation that uses the credentials is in progress.
367
370
@end deftypefun
368
371
 
 
372
@subheading gnutls_certificate_get_issuer
 
373
@anchor{gnutls_certificate_get_issuer}
 
374
@deftypefun {int} {gnutls_certificate_get_issuer} (gnutls_certificate_credentials_t @var{sc}, gnutls_x509_crt_t @var{cert}, gnutls_x509_crt_t* @var{issuer}, unsigned int @var{flags})
 
375
@var{sc}: is a @code{gnutls_certificate_credentials_t} structure.
 
376
 
 
377
@var{cert}: is the certificate to find issuer for
 
378
 
 
379
@var{issuer}: Will hold the issuer if any. Should be treated as constant.
 
380
 
 
381
@var{flags}: Use zero.
 
382
 
 
383
This function will return the issuer of a given certificate.
 
384
 
 
385
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
386
negative error value.
 
387
@end deftypefun
 
388
 
369
389
@subheading gnutls_certificate_get_openpgp_keyring
370
390
@anchor{gnutls_certificate_get_openpgp_keyring}
371
391
@deftypefun {void} {gnutls_certificate_get_openpgp_keyring} (gnutls_certificate_credentials_t @var{sc}, gnutls_openpgp_keyring_t * @var{keyring})
395
415
 
396
416
@subheading gnutls_certificate_get_peers
397
417
@anchor{gnutls_certificate_get_peers}
398
 
@deftypefun {const gnutls_datum_t *} {gnutls_certificate_get_peers} (gnutls_session_t          @var{session}, unsigned int * @var{list_size})
 
418
@deftypefun {const gnutls_datum_t *} {gnutls_certificate_get_peers} (gnutls_session_t                               @var{session}, unsigned int * @var{list_size})
399
419
@var{session}: is a gnutls session
400
420
 
401
421
@var{list_size}: is the length of the certificate list
525
545
authentication.  The callback should return zero on success.
526
546
@end deftypefun
527
547
 
 
548
@subheading gnutls_certificate_set_retrieve_function
 
549
@anchor{gnutls_certificate_set_retrieve_function}
 
550
@deftypefun {void} {gnutls_certificate_set_retrieve_function} (gnutls_certificate_credentials_t @var{cred}, gnutls_certificate_retrieve_function * @var{func})
 
551
@var{cred}: is a @code{gnutls_certificate_credentials_t} structure.
 
552
 
 
553
@var{func}: is the callback function
 
554
 
 
555
This function sets a callback to be called in order to retrieve the
 
556
certificate to be used in the handshake.
 
557
 
 
558
The callback's function prototype is:
 
559
int (*callback)(gnutls_session_t, const gnutls_datum_t* req_ca_dn, int nreqs,
 
560
const gnutls_pk_algorithm_t* pk_algos, int pk_algos_length, gnutls_retr2_st* st);
 
561
 
 
562
@code{req_ca_cert} is only used in X.509 certificates.
 
563
Contains a list with the CA names that the server considers trusted.
 
564
Normally we should send a certificate that is signed
 
565
by one of these CAs. These names are DER encoded. To get a more
 
566
meaningful value use the function @code{gnutls_x509_rdn_get()}.
 
567
 
 
568
@code{pk_algos} contains a list with server's acceptable signature algorithms.
 
569
The certificate returned should support the server's given algorithms.
 
570
 
 
571
@code{st} should contain the certificates and private keys.
 
572
 
 
573
If the callback function is provided then gnutls will call it, in the
 
574
handshake, after the certificate request message has been received.
 
575
 
 
576
In server side pk_algos and req_ca_dn are NULL.
 
577
 
 
578
The callback function should set the certificate list to be sent,
 
579
and return 0 on success. If no certificate was selected then the
 
580
number of certificates should be set to zero. The value (-1)
 
581
indicates error and the handshake will be terminated.
 
582
@end deftypefun
 
583
 
528
584
@subheading gnutls_certificate_set_rsa_export_params
529
585
@anchor{gnutls_certificate_set_rsa_export_params}
530
 
@deftypefun {void} {gnutls_certificate_set_rsa_export_params} (gnutls_certificate_credentials_t        @var{res}, gnutls_rsa_params_t @var{rsa_params})
 
586
@deftypefun {void} {gnutls_certificate_set_rsa_export_params} (gnutls_certificate_credentials_t                                           @var{res}, gnutls_rsa_params_t @var{rsa_params})
531
587
@var{res}: is a gnutls_certificate_credentials_t structure
532
588
 
533
589
@var{rsa_params}: is a structure that holds temporary RSA parameters.
539
595
 
540
596
@subheading gnutls_certificate_set_verify_flags
541
597
@anchor{gnutls_certificate_set_verify_flags}
542
 
@deftypefun {void} {gnutls_certificate_set_verify_flags} (gnutls_certificate_credentials_t          @var{res}, unsigned int @var{flags})
 
598
@deftypefun {void} {gnutls_certificate_set_verify_flags} (gnutls_certificate_credentials_t                                      @var{res}, unsigned int @var{flags})
543
599
@var{res}: is a gnutls_certificate_credentials_t structure
544
600
 
545
601
@var{flags}: are the flags
668
724
Currently only PKCS-1 encoded RSA and DSA private keys are accepted by
669
725
this function.
670
726
 
 
727
This function can also accept PKCS @code{11} URLs. In that case it
 
728
will import the private key and certificate indicated by the urls.
 
729
 
671
730
@strong{Returns:} @code{GNUTLS_E_SUCCESS} on success, or an error code.
672
731
@end deftypefun
673
732
 
824
883
the client if a certificate request is sent. This can be disabled
825
884
using @code{gnutls_certificate_send_x509_rdn_sequence()}.
826
885
 
 
886
This function can also accept PKCS @code{11} URLs. In that case it
 
887
will import all certificates that are marked as trusted.
 
888
 
827
889
@strong{Returns:} number of certificates processed, or a negative value on
828
890
error.
829
891
@end deftypefun
996
1058
check is done and only the version string is returned.
997
1059
@end deftypefun
998
1060
 
 
1061
@subheading gnutls_cipher_decrypt2
 
1062
@anchor{gnutls_cipher_decrypt2}
 
1063
@deftypefun {int} {gnutls_cipher_decrypt2} (gnutls_cipher_hd_t @var{handle}, const void * @var{ciphertext}, size_t @var{ciphertextlen}, void * @var{text}, size_t @var{textlen})
 
1064
@var{handle}: is a @code{gnutls_cipher_hd_t} structure.
 
1065
 
 
1066
@var{ciphertext}: the data to encrypt
 
1067
 
 
1068
@var{ciphertextlen}: The length of data to encrypt
 
1069
 
 
1070
@var{text}: the decrypted data
 
1071
 
 
1072
@var{textlen}: The available length for decrypted data
 
1073
 
 
1074
This function will decrypt the given data using the algorithm
 
1075
specified by the context.
 
1076
 
 
1077
@strong{Returns:} Zero or a negative value on error.
 
1078
 
 
1079
@strong{Since:} 2.10.0
 
1080
@end deftypefun
 
1081
 
999
1082
@subheading gnutls_cipher_decrypt
1000
1083
@anchor{gnutls_cipher_decrypt}
1001
1084
@deftypefun {int} {gnutls_cipher_decrypt} (gnutls_cipher_hd_t @var{handle}, void * @var{ciphertext}, size_t @var{ciphertextlen})
1024
1107
@strong{Since:} 2.10.0
1025
1108
@end deftypefun
1026
1109
 
 
1110
@subheading gnutls_cipher_encrypt2
 
1111
@anchor{gnutls_cipher_encrypt2}
 
1112
@deftypefun {int} {gnutls_cipher_encrypt2} (gnutls_cipher_hd_t @var{handle}, void * @var{text}, size_t @var{textlen}, void * @var{ciphertext}, size_t @var{ciphertextlen})
 
1113
@var{handle}: is a @code{gnutls_cipher_hd_t} structure.
 
1114
 
 
1115
@var{text}: the data to encrypt
 
1116
 
 
1117
@var{textlen}: The length of data to encrypt
 
1118
 
 
1119
@var{ciphertext}: the encrypted data
 
1120
 
 
1121
@var{ciphertextlen}: The available length for encrypted data
 
1122
 
 
1123
This function will encrypt the given data using the algorithm
 
1124
specified by the context.
 
1125
 
 
1126
@strong{Returns:} Zero or a negative value on error.
 
1127
 
 
1128
@strong{Since:} 2.10.0
 
1129
@end deftypefun
 
1130
 
1027
1131
@subheading gnutls_cipher_encrypt
1028
1132
@anchor{gnutls_cipher_encrypt}
1029
1133
@deftypefun {int} {gnutls_cipher_encrypt} (gnutls_cipher_hd_t @var{handle}, void * @var{text}, size_t @var{textlen})
1802
1906
@code{gnutls_malloc()} and will be stored in the appropriate datum.
1803
1907
This function is normally slow.
1804
1908
 
1805
 
Note that the bits value should be one of 768, 1024, 2048, 3072 or 4096.
 
1909
Do not set the number of bits directly, use @code{gnutls_sec_param_to_pk_bits()} to
 
1910
get bits for @code{GNUTLS_PK_DSA}.
1806
1911
Also note that the DH parameters are only useful to servers.
1807
1912
Since clients use the parameters sent by the server, it's of
1808
1913
no use to call this in client side.
1931
2036
 
1932
2037
@strong{Returns:} @code{GNUTLS_E_SUCCESS} on success, or an error code.
1933
2038
 
1934
 
@strong{Since:} 2.6.0
 
2039
@strong{Deprecated in:} 2.12.0
1935
2040
@end deftypefun
1936
2041
 
1937
2042
@subheading gnutls_fingerprint
1988
2093
shared by gnutls session structures.  You should call
1989
2094
@code{gnutls_global_deinit()} when gnutls usage is no longer needed
1990
2095
 
1991
 
Note that this function will also initialize libgcrypt, if it has
1992
 
not been initialized before.  Thus if you want to manually
1993
 
initialize libgcrypt you must do it before calling this function.
1994
 
This is useful in cases you want to disable libgcrypt's internal
1995
 
lockings etc.
 
2096
Note that this function will also initialize the underlying crypto
 
2097
backend, if it has not been initialized before.  
1996
2098
 
1997
2099
This function increment a global counter, so that
1998
2100
@code{gnutls_global_deinit()} only releases resources when it has been
2058
2160
(@code{malloc()}, @code{free()}), are used by gnutls, to allocate both sensitive
2059
2161
and not sensitive data.  This function is provided to set the
2060
2162
memory allocation functions to something other than the defaults
2061
 
(ie the gcrypt allocation functions).
2062
2163
 
2063
2164
This function must be called before @code{gnutls_global_init()} is called.
2064
2165
This function is not thread safe.
2065
2166
@end deftypefun
2066
2167
 
 
2168
@subheading gnutls_global_set_mutex
 
2169
@anchor{gnutls_global_set_mutex}
 
2170
@deftypefun {void} {gnutls_global_set_mutex} (mutex_init_func @var{init}, mutex_deinit_func @var{deinit}, mutex_lock_func @var{lock}, mutex_unlock_func @var{unlock})
 
2171
@var{init}: mutex initialization function
 
2172
 
 
2173
@var{deinit}: mutex deinitialization function
 
2174
 
 
2175
@var{lock}: mutex locking function
 
2176
 
 
2177
@var{unlock}: mutex unlocking function
 
2178
 
 
2179
With this function you are allowed to override the default mutex
 
2180
locks used in some parts of gnutls and dependent libraries. This function
 
2181
should be used if you have complete control of your program and libraries.
 
2182
Do not call this function from a library. Instead only initialize gnutls and
 
2183
the default OS mutex locks will be used.
 
2184
 
 
2185
This function must be called before @code{gnutls_global_init()}.
 
2186
@end deftypefun
 
2187
 
 
2188
@subheading gnutls_global_set_time_function
 
2189
@anchor{gnutls_global_set_time_function}
 
2190
@deftypefun {void} {gnutls_global_set_time_function} (gnutls_time_func @var{time_func})
 
2191
@var{time_func}: it's the system time function
 
2192
 
 
2193
This is the function where you can override the default system
 
2194
time function.
 
2195
 
 
2196
gnutls_time_func is of the form,
 
2197
time_t (*gnutls_time_func)( time*);
 
2198
@end deftypefun
 
2199
 
2067
2200
@subheading gnutls_handshake_get_last_in
2068
2201
@anchor{gnutls_handshake_get_last_in}
2069
2202
@deftypefun {gnutls_handshake_description_t} {gnutls_handshake_get_last_in} (gnutls_session_t @var{session})
2115
2248
 
2116
2249
@subheading gnutls_handshake_set_post_client_hello_function
2117
2250
@anchor{gnutls_handshake_set_post_client_hello_function}
2118
 
@deftypefun {void} {gnutls_handshake_set_post_client_hello_function} (gnutls_session_t @var{session}, gnutls_handshake_post_client_hello_func        @var{func})
 
2251
@deftypefun {void} {gnutls_handshake_set_post_client_hello_function} (gnutls_session_t @var{session}, gnutls_handshake_post_client_hello_func                                                  @var{func})
2119
2252
@var{session}: is a @code{gnutls_session_t} structure.
2120
2253
 
2121
2254
@var{func}: is the function to be called
2607
2740
that the server can obtain the client's key.
2608
2741
@end deftypefun
2609
2742
 
2610
 
@subheading gnutls_oprfi_enable_client
2611
 
@anchor{gnutls_oprfi_enable_client}
2612
 
@deftypefun {void} {gnutls_oprfi_enable_client} (gnutls_session_t @var{session}, size_t @var{len}, unsigned char * @var{data})
2613
 
@var{session}: is a @code{gnutls_session_t} structure.
2614
 
 
2615
 
@var{len}: length of Opaque PRF data to use in client.
2616
 
 
2617
 
@var{data}: Opaque PRF data to use in client.
2618
 
 
2619
 
Request that the client should attempt to negotiate the Opaque PRF
2620
 
Input TLS extension, using the given data as the client's Opaque
2621
 
PRF input.
2622
 
 
2623
 
The data is copied into the session context after this call, so you
2624
 
may de-allocate it immediately after calling this function.
2625
 
@end deftypefun
2626
 
 
2627
 
@subheading gnutls_oprfi_enable_server
2628
 
@anchor{gnutls_oprfi_enable_server}
2629
 
@deftypefun {void} {gnutls_oprfi_enable_server} (gnutls_session_t @var{session}, gnutls_oprfi_callback_func @var{cb}, void * @var{userdata})
2630
 
@var{session}: is a @code{gnutls_session_t} structure.
2631
 
 
2632
 
@var{cb}: function pointer to Opaque PRF extension server callback.
2633
 
 
2634
 
@var{userdata}: hook passed to callback function for passing application state.
2635
 
 
2636
 
Request that the server should attempt to accept the Opaque PRF
2637
 
Input TLS extension.  If the client requests the extension, the
2638
 
provided callback @code{cb} will be invoked.  The callback must have the
2639
 
following prototype:
2640
 
 
2641
 
int callback (gnutls_session_t session, void *userdata,
2642
 
size_t oprfi_len, const unsigned char *in_oprfi,
2643
 
unsigned char *out_oprfi);
2644
 
 
2645
 
The callback can inspect the client-provided data in the input
2646
 
parameters, and specify its own opaque prf input data in the output
2647
 
variable.  The function must return 0 on success, otherwise the
2648
 
handshake will be aborted.
2649
 
@end deftypefun
2650
 
 
2651
2743
@subheading gnutls_pem_base64_decode_alloc
2652
2744
@anchor{gnutls_pem_base64_decode_alloc}
2653
2745
@deftypefun {int} {gnutls_pem_base64_decode_alloc} (const char * @var{header}, const gnutls_datum_t * @var{b64_data}, gnutls_datum_t * @var{result})
2752
2844
key algorithm, or @code{NULL}.
2753
2845
@end deftypefun
2754
2846
 
 
2847
@subheading gnutls_pk_bits_to_sec_param
 
2848
@anchor{gnutls_pk_bits_to_sec_param}
 
2849
@deftypefun {gnutls_sec_param_t} {gnutls_pk_bits_to_sec_param} (gnutls_pk_algorithm_t @var{algo}, unsigned int @var{bits})
 
2850
@var{algo}: is a public key algorithm
 
2851
 
 
2852
@var{bits}: is the number of bits
 
2853
 
 
2854
This is the inverse of @code{gnutls_sec_param_to_pk_bits()}. Given an algorithm
 
2855
and the number of bits, it will return the security parameter. This is
 
2856
a rough indication.
 
2857
 
 
2858
@strong{Returns:} The security parameter.
 
2859
@end deftypefun
 
2860
 
2755
2861
@subheading gnutls_pk_get_id
2756
2862
@anchor{gnutls_pk_get_id}
2757
2863
@deftypefun {gnutls_pk_algorithm_t} {gnutls_pk_get_id} (const char * @var{name})
2792
2898
@strong{Since:} 2.6.0
2793
2899
@end deftypefun
2794
2900
 
 
2901
@subheading gnutls_pkcs11_add_provider
 
2902
@anchor{gnutls_pkcs11_add_provider}
 
2903
@deftypefun {int} {gnutls_pkcs11_add_provider} (const char * @var{name}, const char * @var{params})
 
2904
@var{name}: The filename of the module
 
2905
 
 
2906
@var{params}: should be NULL
 
2907
 
 
2908
This function will load and add a PKCS 11 module to the module
 
2909
list used in gnutls. After this function is called the module will
 
2910
be used for PKCS 11 operations.
 
2911
 
 
2912
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
2913
negative error value.
 
2914
@end deftypefun
 
2915
 
 
2916
@subheading gnutls_pkcs11_copy_secret_key
 
2917
@anchor{gnutls_pkcs11_copy_secret_key}
 
2918
@deftypefun {int} {gnutls_pkcs11_copy_secret_key} (const char * @var{token_url}, gnutls_datum_t * @var{key}, const char * @var{label}, unsigned int @var{key_usage}, unsigned int @var{flags})
 
2919
@var{token_url}: A PKCS @code{11} URL specifying a token
 
2920
 
 
2921
@var{key}: The raw key
 
2922
 
 
2923
@var{label}: A name to be used for the stored data
 
2924
 
 
2925
@var{key_usage}: One of GNUTLS_KEY_*
 
2926
 
 
2927
@var{flags}: One of GNUTLS_PKCS11_OBJ_FLAG_*
 
2928
 
 
2929
This function will copy a raw secret (symmetric) key into a PKCS @code{11} 
 
2930
token specified by a URL. The key can be marked as sensitive or not.
 
2931
 
 
2932
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
2933
negative error value.
 
2934
@end deftypefun
 
2935
 
 
2936
@subheading gnutls_pkcs11_copy_x509_crt
 
2937
@anchor{gnutls_pkcs11_copy_x509_crt}
 
2938
@deftypefun {int} {gnutls_pkcs11_copy_x509_crt} (const char * @var{token_url}, gnutls_x509_crt_t @var{crt}, const char * @var{label}, unsigned int @var{flags})
 
2939
@var{token_url}: A PKCS @code{11} URL specifying a token
 
2940
 
 
2941
@var{crt}: A certificate
 
2942
 
 
2943
@var{label}: A name to be used for the stored data
 
2944
 
 
2945
@var{flags}: One of GNUTLS_PKCS11_OBJ_FLAG_*
 
2946
 
 
2947
This function will copy a certificate into a PKCS @code{11} token specified by
 
2948
a URL. The certificate can be marked as trusted or not.
 
2949
 
 
2950
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
2951
negative error value.
 
2952
@end deftypefun
 
2953
 
 
2954
@subheading gnutls_pkcs11_copy_x509_privkey
 
2955
@anchor{gnutls_pkcs11_copy_x509_privkey}
 
2956
@deftypefun {int} {gnutls_pkcs11_copy_x509_privkey} (const char * @var{token_url}, gnutls_x509_privkey_t @var{key}, const char * @var{label}, unsigned int @var{key_usage}, unsigned int @var{flags})
 
2957
@var{token_url}: A PKCS @code{11} URL specifying a token
 
2958
 
 
2959
@var{key}: A private key
 
2960
 
 
2961
@var{label}: A name to be used for the stored data
 
2962
 
 
2963
@var{key_usage}: One of GNUTLS_KEY_*
 
2964
 
 
2965
@var{flags}: One of GNUTLS_PKCS11_OBJ_* flags
 
2966
 
 
2967
This function will copy a private key into a PKCS @code{11} token specified by
 
2968
a URL. It is highly recommended flags to contain @code{GNUTLS_PKCS11_OBJ_FLAG_MARK_SENSITIVE}
 
2969
unless there is a strong reason not to.
 
2970
 
 
2971
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
2972
negative error value.
 
2973
@end deftypefun
 
2974
 
 
2975
@subheading gnutls_pkcs11_deinit
 
2976
@anchor{gnutls_pkcs11_deinit}
 
2977
@deftypefun {void} {gnutls_pkcs11_deinit} ( @var{void})
 
2978
 
 
2979
This function will deinitialize the PKCS 11 subsystem in gnutls.
 
2980
@end deftypefun
 
2981
 
 
2982
@subheading gnutls_pkcs11_delete_url
 
2983
@anchor{gnutls_pkcs11_delete_url}
 
2984
@deftypefun {int} {gnutls_pkcs11_delete_url} (const char * @var{object_url}, unsigned int @var{flags})
 
2985
@var{object_url}: The URL of the object to delete.
 
2986
 
 
2987
@var{flags}: One of GNUTLS_PKCS11_OBJ_* flags
 
2988
 
 
2989
This function will delete objects matching the given URL.
 
2990
 
 
2991
@strong{Returns:} On success, the number of objects deleted is returned, otherwise a
 
2992
negative error value.
 
2993
@end deftypefun
 
2994
 
 
2995
@subheading gnutls_pkcs11_init
 
2996
@anchor{gnutls_pkcs11_init}
 
2997
@deftypefun {int} {gnutls_pkcs11_init} (unsigned int @var{flags}, const char * @var{deprecated_config_file})
 
2998
@var{flags}: @code{GNUTLS_PKCS11_FLAG_MANUAL} or @code{GNUTLS_PKCS11_FLAG_AUTO}
 
2999
 
 
3000
@var{deprecated_config_file}: either NULL or the location of a deprecated
 
3001
configuration file
 
3002
 
 
3003
This function will initialize the PKCS 11 subsystem in gnutls. It will
 
3004
read configuration files if @code{GNUTLS_PKCS11_FLAG_AUTO} is used or allow
 
3005
you to independently load PKCS 11 modules using @code{gnutls_pkcs11_add_provider()}
 
3006
if @code{GNUTLS_PKCS11_FLAG_MANUAL} is specified.
 
3007
 
 
3008
Using a custom configfile is deprecated and will not be supported in future
 
3009
versions of gnutls.
 
3010
 
 
3011
Normally you don't need to call this function since it is being called
 
3012
by @code{gnutls_global_init()} using the @code{GNUTLS_PKCS11_FLAG_AUTO}. If you need to
 
3013
call this function, you must call it before @code{gnutls_global_init()}.
 
3014
 
 
3015
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3016
negative error value.
 
3017
@end deftypefun
 
3018
 
 
3019
@subheading gnutls_pkcs11_obj_deinit
 
3020
@anchor{gnutls_pkcs11_obj_deinit}
 
3021
@deftypefun {void} {gnutls_pkcs11_obj_deinit} (gnutls_pkcs11_obj_t @var{obj})
 
3022
@var{obj}: The structure to be initialized
 
3023
 
 
3024
This function will deinitialize a certificate structure.
 
3025
@end deftypefun
 
3026
 
 
3027
@subheading gnutls_pkcs11_obj_export_url
 
3028
@anchor{gnutls_pkcs11_obj_export_url}
 
3029
@deftypefun {int} {gnutls_pkcs11_obj_export_url} (gnutls_pkcs11_obj_t @var{obj}, gnutls_pkcs11_url_type_t @var{detailed}, char ** @var{url})
 
3030
@var{obj}: Holds the PKCS 11 certificate
 
3031
 
 
3032
@var{detailed}: non zero if a detailed URL is required
 
3033
 
 
3034
@var{url}: will contain an allocated url
 
3035
 
 
3036
This function will export a URL identifying the given certificate.
 
3037
 
 
3038
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3039
negative error value.
 
3040
@end deftypefun
 
3041
 
 
3042
@subheading gnutls_pkcs11_obj_export
 
3043
@anchor{gnutls_pkcs11_obj_export}
 
3044
@deftypefun {int} {gnutls_pkcs11_obj_export} (gnutls_pkcs11_obj_t @var{obj}, void * @var{output_data}, size_t * @var{output_data_size})
 
3045
@var{obj}: Holds the object
 
3046
 
 
3047
@var{output_data}: will contain a certificate PEM or DER encoded
 
3048
 
 
3049
@var{output_data_size}: holds the size of output_data (and will be
 
3050
replaced by the actual size of parameters)
 
3051
 
 
3052
This function will export the pkcs11 object data. It is normal
 
3053
for PKCS @code{11} data to be inaccesible and in that case @code{GNUTLS_E_INVALID_REQUEST}
 
3054
will be returned.
 
3055
 
 
3056
If the buffer provided is not long enough to hold the output, then
 
3057
*output_data_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will
 
3058
be returned.
 
3059
 
 
3060
If the structure is PEM encoded, it will have a header
 
3061
of "BEGIN CERTIFICATE".
 
3062
 
 
3063
@strong{Return value:} In case of failure a negative value will be
 
3064
returned, and 0 on success.
 
3065
@end deftypefun
 
3066
 
 
3067
@subheading gnutls_pkcs11_obj_get_info
 
3068
@anchor{gnutls_pkcs11_obj_get_info}
 
3069
@deftypefun {int} {gnutls_pkcs11_obj_get_info} (gnutls_pkcs11_obj_t @var{crt}, gnutls_pkcs11_obj_info_t @var{itype}, void * @var{output}, size_t * @var{output_size})
 
3070
@var{crt}: should contain a @code{gnutls_pkcs11_obj_t} structure
 
3071
 
 
3072
@var{itype}: Denotes the type of information requested
 
3073
 
 
3074
@var{output}: where output will be stored
 
3075
 
 
3076
@var{output_size}: contains the maximum size of the output and will be overwritten with actual
 
3077
 
 
3078
This function will return information about the PKCS 11 certificatesuch
 
3079
as the label, id as well as token information where the key is stored. When
 
3080
output is text it returns null terminated string although @code{output_size} contains
 
3081
the size of the actual data only.
 
3082
 
 
3083
@strong{Returns:} zero on success or a negative value on error.
 
3084
@end deftypefun
 
3085
 
 
3086
@subheading gnutls_pkcs11_obj_get_type
 
3087
@anchor{gnutls_pkcs11_obj_get_type}
 
3088
@deftypefun {gnutls_pkcs11_obj_type_t} {gnutls_pkcs11_obj_get_type} (gnutls_pkcs11_obj_t @var{obj})
 
3089
This function will return the type of the certificate being
 
3090
stored in the structure.
 
3091
 
 
3092
@strong{Returns:} The type of the certificate.
 
3093
@end deftypefun
 
3094
 
 
3095
@subheading gnutls_pkcs11_obj_import_url
 
3096
@anchor{gnutls_pkcs11_obj_import_url}
 
3097
@deftypefun {int} {gnutls_pkcs11_obj_import_url} (gnutls_pkcs11_obj_t @var{cert}, const char * @var{url}, unsigned int @var{flags})
 
3098
@var{cert}: The structure to store the parsed certificate
 
3099
 
 
3100
@var{url}: a PKCS 11 url identifying the key
 
3101
 
 
3102
@var{flags}: One of GNUTLS_PKCS11_OBJ_* flags
 
3103
 
 
3104
This function will "import" a PKCS 11 URL identifying a certificate
 
3105
key to the @code{gnutls_pkcs11_obj_t} structure. This does not involve any
 
3106
parsing (such as X.509 or OpenPGP) since the @code{gnutls_pkcs11_obj_t} is
 
3107
format agnostic. Only data are transferred.
 
3108
 
 
3109
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3110
negative error value.
 
3111
@end deftypefun
 
3112
 
 
3113
@subheading gnutls_pkcs11_obj_init
 
3114
@anchor{gnutls_pkcs11_obj_init}
 
3115
@deftypefun {int} {gnutls_pkcs11_obj_init} (gnutls_pkcs11_obj_t * @var{obj})
 
3116
@var{obj}: The structure to be initialized
 
3117
 
 
3118
This function will initialize a pkcs11 certificate structure.
 
3119
 
 
3120
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3121
negative error value.
 
3122
@end deftypefun
 
3123
 
 
3124
@subheading gnutls_pkcs11_obj_list_import_url
 
3125
@anchor{gnutls_pkcs11_obj_list_import_url}
 
3126
@deftypefun {int} {gnutls_pkcs11_obj_list_import_url} (gnutls_pkcs11_obj_t * @var{p_list}, unsigned int * @var{n_list}, const char * @var{url}, gnutls_pkcs11_obj_attr_t @var{attrs}, unsigned int @var{flags})
 
3127
@var{p_list}: An uninitialized object list (may be NULL)
 
3128
 
 
3129
@var{n_list}: initially should hold the maximum size of the list. Will contain the actual size.
 
3130
 
 
3131
@var{url}: A PKCS 11 url identifying a set of objects
 
3132
 
 
3133
@var{attrs}: Attributes of type @code{gnutls_pkcs11_obj_attr_t} that can be used to limit output
 
3134
 
 
3135
@var{flags}: One of GNUTLS_PKCS11_OBJ_* flags
 
3136
 
 
3137
This function will initialize and set values to an object list
 
3138
by using all objects identified by a PKCS 11 URL.
 
3139
 
 
3140
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3141
negative error value.
 
3142
@end deftypefun
 
3143
 
 
3144
@subheading gnutls_pkcs11_privkey_deinit
 
3145
@anchor{gnutls_pkcs11_privkey_deinit}
 
3146
@deftypefun {void} {gnutls_pkcs11_privkey_deinit} (gnutls_pkcs11_privkey_t @var{key})
 
3147
@var{key}: The structure to be initialized
 
3148
 
 
3149
This function will deinitialize a private key structure.
 
3150
@end deftypefun
 
3151
 
 
3152
@subheading gnutls_pkcs11_privkey_export_url
 
3153
@anchor{gnutls_pkcs11_privkey_export_url}
 
3154
@deftypefun {int} {gnutls_pkcs11_privkey_export_url} (gnutls_pkcs11_privkey_t @var{key}, gnutls_pkcs11_url_type_t @var{detailed}, char ** @var{url})
 
3155
@var{key}: Holds the PKCS 11 key
 
3156
 
 
3157
@var{detailed}: non zero if a detailed URL is required
 
3158
 
 
3159
@var{url}: will contain an allocated url
 
3160
 
 
3161
This function will export a URL identifying the given key.
 
3162
 
 
3163
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3164
negative error value.
 
3165
@end deftypefun
 
3166
 
 
3167
@subheading gnutls_pkcs11_privkey_get_info
 
3168
@anchor{gnutls_pkcs11_privkey_get_info}
 
3169
@deftypefun {int} {gnutls_pkcs11_privkey_get_info} (gnutls_pkcs11_privkey_t @var{pkey}, gnutls_pkcs11_obj_info_t @var{itype}, void * @var{output}, size_t * @var{output_size})
 
3170
@var{pkey}: should contain a @code{gnutls_pkcs11_privkey_t} structure
 
3171
 
 
3172
@var{itype}: Denotes the type of information requested
 
3173
 
 
3174
@var{output}: where output will be stored
 
3175
 
 
3176
@var{output_size}: contains the maximum size of the output and will be overwritten with actual
 
3177
 
 
3178
This function will return information about the PKCS 11 private key such
 
3179
as the label, id as well as token information where the key is stored. When
 
3180
output is text it returns null terminated string although @code{output_size} contains
 
3181
the size of the actual data only.
 
3182
 
 
3183
@strong{Returns:} zero on success or a negative value on error.
 
3184
@end deftypefun
 
3185
 
 
3186
@subheading gnutls_pkcs11_privkey_get_pk_algorithm
 
3187
@anchor{gnutls_pkcs11_privkey_get_pk_algorithm}
 
3188
@deftypefun {int} {gnutls_pkcs11_privkey_get_pk_algorithm} (gnutls_pkcs11_privkey_t @var{key}, unsigned int * @var{bits})
 
3189
@var{key}: should contain a @code{gnutls_pkcs11_privkey_t} structure
 
3190
 
 
3191
This function will return the public key algorithm of a private
 
3192
key.
 
3193
 
 
3194
@strong{Returns:} a member of the @code{gnutls_pk_algorithm_t} enumeration on
 
3195
success, or a negative value on error.
 
3196
@end deftypefun
 
3197
 
 
3198
@subheading gnutls_pkcs11_privkey_import_url
 
3199
@anchor{gnutls_pkcs11_privkey_import_url}
 
3200
@deftypefun {int} {gnutls_pkcs11_privkey_import_url} (gnutls_pkcs11_privkey_t @var{pkey}, const char * @var{url}, unsigned int @var{flags})
 
3201
@var{pkey}: The structure to store the parsed key
 
3202
 
 
3203
@var{url}: a PKCS 11 url identifying the key
 
3204
 
 
3205
@var{flags}: sequence of GNUTLS_PKCS_PRIVKEY_*
 
3206
 
 
3207
This function will "import" a PKCS 11 URL identifying a private
 
3208
key to the @code{gnutls_pkcs11_privkey_t} structure. In reality since
 
3209
in most cases keys cannot be exported, the private key structure
 
3210
is being associated with the available operations on the token.
 
3211
 
 
3212
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3213
negative error value.
 
3214
@end deftypefun
 
3215
 
 
3216
@subheading gnutls_pkcs11_privkey_init
 
3217
@anchor{gnutls_pkcs11_privkey_init}
 
3218
@deftypefun {int} {gnutls_pkcs11_privkey_init} (gnutls_pkcs11_privkey_t * @var{key})
 
3219
@var{key}: The structure to be initialized
 
3220
 
 
3221
This function will initialize an private key structure.
 
3222
 
 
3223
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3224
negative error value.
 
3225
@end deftypefun
 
3226
 
 
3227
@subheading gnutls_pkcs11_set_pin_function
 
3228
@anchor{gnutls_pkcs11_set_pin_function}
 
3229
@deftypefun {void} {gnutls_pkcs11_set_pin_function} (gnutls_pkcs11_pin_callback_t @var{fn}, void * @var{userdata})
 
3230
@var{fn}: The PIN callback
 
3231
 
 
3232
@var{userdata}: data to be supplied to callback
 
3233
 
 
3234
This function will set a callback function to be used when a PIN
 
3235
is required for PKCS 11 operations.
 
3236
 
 
3237
Callback for PKCS@code{11} PIN entry.  The callback provides the PIN code
 
3238
to unlock the token with label 'token_label', specified by the URL 
 
3239
'token_url'.
 
3240
 
 
3241
The PIN code, as a NUL-terminated ASCII string, should be copied
 
3242
into the 'pin' buffer (of maximum size pin_max), and
 
3243
return 0 to indicate success. Alternatively, the callback may
 
3244
return a negative gnutls error code to indicate failure and cancel
 
3245
PIN entry (in which case, the contents of the 'pin' parameter are ignored).
 
3246
 
 
3247
When a PIN is required, the callback will be invoked repeatedly
 
3248
(and indefinitely) until either the returned PIN code is correct,
 
3249
the callback returns failure, or the token refuses login (e.g. when
 
3250
the token is locked due to too many incorrect PINs!).  For the
 
3251
first such invocation, the 'attempt' counter will have value zero;
 
3252
it will increase by one for each subsequent attempt.
 
3253
 
 
3254
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3255
negative error value.
 
3256
@end deftypefun
 
3257
 
 
3258
@subheading gnutls_pkcs11_set_token_function
 
3259
@anchor{gnutls_pkcs11_set_token_function}
 
3260
@deftypefun {void} {gnutls_pkcs11_set_token_function} (gnutls_pkcs11_token_callback_t @var{fn}, void * @var{userdata})
 
3261
@var{fn}: The token callback
 
3262
 
 
3263
@var{userdata}: data to be supplied to callback
 
3264
 
 
3265
This function will set a callback function to be used when a token
 
3266
needs to be inserted to continue PKCS 11 operations.
 
3267
 
 
3268
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3269
negative error value.
 
3270
@end deftypefun
 
3271
 
 
3272
@subheading gnutls_pkcs11_token_get_flags
 
3273
@anchor{gnutls_pkcs11_token_get_flags}
 
3274
@deftypefun {int} {gnutls_pkcs11_token_get_flags} (const char * @var{url}, unsigned int * @var{flags})
 
3275
@var{url}: should contain a PKCS 11 URL
 
3276
 
 
3277
@var{flags}: The output flags (GNUTLS_PKCS11_TOKEN_*)
 
3278
 
 
3279
This function will return information about the PKCS 11 token flags.
 
3280
 
 
3281
@strong{Returns:} zero on success or a negative value on error.
 
3282
@end deftypefun
 
3283
 
 
3284
@subheading gnutls_pkcs11_token_get_info
 
3285
@anchor{gnutls_pkcs11_token_get_info}
 
3286
@deftypefun {int} {gnutls_pkcs11_token_get_info} (const char * @var{url}, gnutls_pkcs11_token_info_t @var{ttype}, void * @var{output}, size_t * @var{output_size})
 
3287
@var{url}: should contain a PKCS 11 URL
 
3288
 
 
3289
@var{ttype}: Denotes the type of information requested
 
3290
 
 
3291
@var{output}: where output will be stored
 
3292
 
 
3293
@var{output_size}: contains the maximum size of the output and will be overwritten with actual
 
3294
 
 
3295
This function will return information about the PKCS 11 token such
 
3296
as the label, id as well as token information where the key is stored.
 
3297
 
 
3298
@strong{Returns:} zero on success or a negative value on error.
 
3299
@end deftypefun
 
3300
 
 
3301
@subheading gnutls_pkcs11_token_get_mechanism
 
3302
@anchor{gnutls_pkcs11_token_get_mechanism}
 
3303
@deftypefun {int} {gnutls_pkcs11_token_get_mechanism} (const char * @var{url}, int @var{idx}, unsigned long * @var{mechanism})
 
3304
@var{url}: should contain a PKCS 11 URL
 
3305
 
 
3306
@var{idx}: The index of the mechanism
 
3307
 
 
3308
@var{mechanism}: The PKCS @code{11} mechanism ID
 
3309
 
 
3310
This function will return the names of the supported mechanisms
 
3311
by the token. It should be called with an increasing index until
 
3312
it return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE.
 
3313
 
 
3314
@strong{Returns:} zero on success or a negative value on error.
 
3315
@end deftypefun
 
3316
 
 
3317
@subheading gnutls_pkcs11_token_get_url
 
3318
@anchor{gnutls_pkcs11_token_get_url}
 
3319
@deftypefun {int} {gnutls_pkcs11_token_get_url} (unsigned int @var{seq}, gnutls_pkcs11_url_type_t @var{detailed}, char ** @var{url})
 
3320
@var{seq}: sequence number starting from 0
 
3321
 
 
3322
@var{detailed}: non zero if a detailed URL is required
 
3323
 
 
3324
@var{url}: will contain an allocated url
 
3325
 
 
3326
This function will return the URL for each token available
 
3327
in system. The url has to be released using @code{gnutls_free()}
 
3328
 
 
3329
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, @code{GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE}
 
3330
if the sequence number exceeds the available tokens, otherwise a negative error value.
 
3331
@end deftypefun
 
3332
 
 
3333
@subheading gnutls_pkcs11_token_init
 
3334
@anchor{gnutls_pkcs11_token_init}
 
3335
@deftypefun {int} {gnutls_pkcs11_token_init} (const char * @var{token_url}, const char * @var{so_pin}, const char * @var{label})
 
3336
@var{token_url}: A PKCS @code{11} URL specifying a token
 
3337
 
 
3338
@var{so_pin}: Security Officer's PIN
 
3339
 
 
3340
@var{label}: A name to be used for the token
 
3341
 
 
3342
This function will initialize (format) a token. If the token is
 
3343
at a factory defaults state the security officer's PIN given will be
 
3344
set to be the default. Otherwise it should match the officer's PIN.
 
3345
 
 
3346
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3347
negative error value.
 
3348
@end deftypefun
 
3349
 
 
3350
@subheading gnutls_pkcs11_token_set_pin
 
3351
@anchor{gnutls_pkcs11_token_set_pin}
 
3352
@deftypefun {int} {gnutls_pkcs11_token_set_pin} (const char * @var{token_url}, const char * @var{oldpin}, const char * @var{newpin}, unsigned int @var{flags})
 
3353
@var{token_url}: A PKCS @code{11} URL specifying a token
 
3354
 
 
3355
@var{oldpin}: old user's PIN
 
3356
 
 
3357
@var{newpin}: new user's PIN
 
3358
 
 
3359
@var{flags}: one of gnutls_pkcs11_pin_flag_t
 
3360
 
 
3361
This function will modify or set a user's PIN for the given token. 
 
3362
If it is called to set a user pin for first time the oldpin must
 
3363
be NULL.
 
3364
 
 
3365
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3366
negative error value.
 
3367
@end deftypefun
 
3368
 
2795
3369
@subheading gnutls_prf_raw
2796
3370
@anchor{gnutls_prf_raw}
2797
3371
@deftypefun {int} {gnutls_prf_raw} (gnutls_session_t @var{session}, size_t @var{label_size}, const char * @var{label}, size_t @var{seed_size}, const char * @var{seed}, size_t @var{outsize}, char * @var{out})
2884
3458
 
2885
3459
@var{err_pos}: In case of an error this will have the position in the string the error occured
2886
3460
 
2887
 
Sets priorities for the ciphers, key exchange methods, MACs and
2888
 
compression methods.  This provides a more flexible interface
2889
 
compared to the gnutls_*_priority functions.
2890
 
 
2891
 
The @code{priorities} parameter allows you to specify a colon separated
2892
 
list of the cipher priorities to enable.
2893
 
 
2894
 
Unless the first keyword is "NONE" the defaults (in preference
2895
 
order) are for TLS protocols TLS1.1, TLS1.0, SSL3.0; for
2896
 
compression NULL; for certificate types X.509, OpenPGP.
2897
 
 
2898
 
For key exchange algorithms when in NORMAL or SECURE levels the
2899
 
perfect forward secrecy algorithms take precedence of the other
2900
 
protocols.  In all cases all the supported key exchange algorithms
2901
 
are enabled (except for the RSA-EXPORT which is only enabled in
2902
 
EXPORT level).
2903
 
 
2904
 
Note that although one can select very long key sizes (such as 256
2905
 
bits) for symmetric algorithms, to actually increase security the
2906
 
public key algorithms have to use longer key sizes as well.
2907
 
 
2908
 
For all the current available algorithms and protocols use
2909
 
"gnutls-cli -l" to get a listing.
 
3461
Sets priorities for the ciphers, key exchange methods, macs and
 
3462
compression methods.
 
3463
 
 
3464
The @code{priorities} option allows you to specify a colon
 
3465
separated list of the cipher priorities to enable.
2910
3466
 
2911
3467
@strong{Common keywords:} Some keywords are defined to provide quick access
2912
3468
to common preferences.
2915
3471
limited to 128 bit ciphers and sorted by terms of speed
2916
3472
performance.
2917
3473
 
2918
 
"NORMAL" means all "secure" ciphersuites.  The 256-bit ciphers are
 
3474
"NORMAL" means all "secure" ciphersuites. The 256-bit ciphers are
2919
3475
included as a fallback only.  The ciphers are sorted by security
2920
3476
margin.
2921
3477
 
2935
3491
 
2936
3492
"+" appended with an algorithm will add this algorithm.
2937
3493
 
2938
 
"%COMPAT" will enable compatibility features for a server.
2939
 
 
2940
 
"%DISABLE_SAFE_RENEGOTIATION" will disable safe renegotiation
2941
 
completely.  Do not use unless you know what you are doing.
2942
 
Testing purposes only.
2943
 
 
2944
 
"%UNSAFE_RENEGOTIATION" will allow handshakes and rehandshakes
2945
 
without the safe renegotiation extension.  Note that for clients
2946
 
this mode is insecure (you may be under attack), and for servers it
2947
 
will allow insecure clients to connect (which could be fooled by an
2948
 
attacker).  Do not use unless you know what you are doing and want
2949
 
maximum compatibility.
2950
 
 
2951
 
"%PARTIAL_RENEGOTIATION" will allow initial handshakes to proceed,
2952
 
but not rehandshakes.  This leaves the client vulnerable to attack,
2953
 
and servers will be compatible with non-upgraded clients for
2954
 
initial handshakes.  This is currently the default for clients and
2955
 
servers, for compatibility reasons.
2956
 
 
2957
 
"%SAFE_RENEGOTIATION" will enforce safe renegotiation.  Clients and
2958
 
servers will refuse to talk to an insecure peer.  Currently this
2959
 
causes operability problems, but is required for full protection.
2960
 
 
2961
 
"%SSL3_RECORD_VERSION" will use SSL3.0 record version in client
2962
 
hello.
2963
 
 
2964
 
"%VERIFY_ALLOW_SIGN_RSA_MD5" will allow RSA-MD5 signatures in
2965
 
certificate chains.
2966
 
 
2967
 
"%VERIFY_ALLOW_X509_V1_CA_CRT" will allow V1 CAs in chains.
2968
 
 
2969
 
@strong{Namespace:} To avoid collisions in order to specify a compression algorithm in
2970
 
this string you have to prefix it with "COMP-", protocol versions
2971
 
with "VERS-", signature algorithms with "SIGN-" and certificate
2972
 
types with "CTYPE-".  Other algorithms don't need a prefix.
2973
 
 
2974
 
@strong{Examples:} "NORMAL:!AES-128-CBC" means normal ciphers except for AES-128.
2975
 
 
2976
 
"EXPORT:!VERS-TLS1.0:+COMP-DEFLATE" means that export ciphers are
2977
 
enabled, TLS 1.0 is disabled, and libz compression enabled.
2978
 
 
2979
 
"NONE:+VERS-TLS1.0:+AES-128-CBC:+RSA:+SHA1:+COMP-NULL", "NORMAL",
2980
 
"%COMPAT".
 
3494
Check the GnuTLS manual section "Priority strings" for detailed
 
3495
information.
 
3496
 
 
3497
@strong{Examples:} 
 
3498
"NONE:+VERS-TLS-ALL:+MAC-ALL:+RSA:+AES-128-CBC:+SIGN-ALL:+COMP-NULL"
 
3499
 
 
3500
"NORMAL:-ARCFOUR-128" means normal ciphers except for ARCFOUR-128.
 
3501
 
 
3502
"SECURE:-VERS-SSL3.0:+COMP-DEFLATE" means that only secure ciphers are
 
3503
enabled, SSL3.0 is disabled, and libz compression enabled.
 
3504
 
 
3505
"NONE:+VERS-TLS-ALL:+AES-128-CBC:+RSA:+SHA1:+COMP-NULL:+SIGN-RSA-SHA1", 
 
3506
 
 
3507
"NORMAL:@code{COMPAT}" is the most compatible mode.
2981
3508
 
2982
3509
@strong{Returns:} On syntax error @code{GNUTLS_E_INVALID_REQUEST} is returned,
2983
3510
@code{GNUTLS_E_SUCCESS} on success, or an error code.
3014
3541
@strong{Returns:} @code{GNUTLS_E_SUCCESS} on success, or an error code.
3015
3542
@end deftypefun
3016
3543
 
 
3544
@subheading gnutls_privkey_decrypt_data
 
3545
@anchor{gnutls_privkey_decrypt_data}
 
3546
@deftypefun {int} {gnutls_privkey_decrypt_data} (gnutls_privkey_t @var{key}, unsigned int @var{flags}, const gnutls_datum_t * @var{ciphertext}, gnutls_datum_t * @var{plaintext})
 
3547
@var{key}: Holds the key
 
3548
 
 
3549
@var{flags}: zero for now
 
3550
 
 
3551
@var{ciphertext}: holds the data to be decrypted
 
3552
 
 
3553
@var{plaintext}: will contain the decrypted data, allocated with @code{gnutls_malloc()}
 
3554
 
 
3555
This function will decrypt the given data using the algorithm
 
3556
supported by the private key.
 
3557
 
 
3558
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3559
negative error value.
 
3560
@end deftypefun
 
3561
 
 
3562
@subheading gnutls_privkey_deinit
 
3563
@anchor{gnutls_privkey_deinit}
 
3564
@deftypefun {void} {gnutls_privkey_deinit} (gnutls_privkey_t @var{key})
 
3565
@var{key}: The structure to be deinitialized
 
3566
 
 
3567
This function will deinitialize a private key structure.
 
3568
@end deftypefun
 
3569
 
 
3570
@subheading gnutls_privkey_get_pk_algorithm
 
3571
@anchor{gnutls_privkey_get_pk_algorithm}
 
3572
@deftypefun {int} {gnutls_privkey_get_pk_algorithm} (gnutls_privkey_t @var{key}, unsigned int * @var{bits})
 
3573
@var{key}: should contain a @code{gnutls_privkey_t} structure
 
3574
 
 
3575
@var{bits}: If set will return the number of bits of the parameters (may be NULL)
 
3576
 
 
3577
This function will return the public key algorithm of a private
 
3578
key and if possible will return a number of bits that indicates
 
3579
the security parameter of the key.
 
3580
 
 
3581
@strong{Returns:} a member of the @code{gnutls_pk_algorithm_t} enumeration on
 
3582
success, or a negative value on error.
 
3583
@end deftypefun
 
3584
 
 
3585
@subheading gnutls_privkey_get_type
 
3586
@anchor{gnutls_privkey_get_type}
 
3587
@deftypefun {gnutls_privkey_type_t} {gnutls_privkey_get_type} (gnutls_privkey_t @var{key})
 
3588
@var{key}: should contain a @code{gnutls_privkey_t} structure
 
3589
 
 
3590
This function will return the type of the private key. This is
 
3591
actually the type of the subsystem used to set this private key.
 
3592
 
 
3593
@strong{Returns:} a member of the @code{gnutls_privkey_type_t} enumeration on
 
3594
success, or a negative value on error.
 
3595
@end deftypefun
 
3596
 
 
3597
@subheading gnutls_privkey_import_openpgp
 
3598
@anchor{gnutls_privkey_import_openpgp}
 
3599
@deftypefun {int} {gnutls_privkey_import_openpgp} (gnutls_privkey_t @var{pkey}, gnutls_openpgp_privkey_t @var{key}, unsigned int @var{flags})
 
3600
@var{pkey}: The private key
 
3601
 
 
3602
@var{key}: The private key to be imported
 
3603
 
 
3604
@var{flags}: should be zero
 
3605
 
 
3606
This function will import the given private key to the abstract
 
3607
@code{gnutls_privkey_t} structure.
 
3608
 
 
3609
The @code{gnutls_openpgp_privkey_t} object must not be deallocated
 
3610
during the lifetime of this structure. The subkey set as
 
3611
preferred will be used, or the master key otherwise.
 
3612
 
 
3613
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3614
negative error value.
 
3615
@end deftypefun
 
3616
 
 
3617
@subheading gnutls_privkey_import_pkcs11
 
3618
@anchor{gnutls_privkey_import_pkcs11}
 
3619
@deftypefun {int} {gnutls_privkey_import_pkcs11} (gnutls_privkey_t @var{pkey}, gnutls_pkcs11_privkey_t @var{key}, unsigned int @var{flags})
 
3620
@var{pkey}: The private key
 
3621
 
 
3622
@var{key}: The private key to be imported
 
3623
 
 
3624
@var{flags}: should be zero
 
3625
 
 
3626
This function will import the given private key to the abstract
 
3627
@code{gnutls_privkey_t} structure.
 
3628
 
 
3629
The @code{gnutls_pkcs11_privkey_t} object must not be deallocated
 
3630
during the lifetime of this structure.
 
3631
 
 
3632
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3633
negative error value.
 
3634
@end deftypefun
 
3635
 
 
3636
@subheading gnutls_privkey_import_x509
 
3637
@anchor{gnutls_privkey_import_x509}
 
3638
@deftypefun {int} {gnutls_privkey_import_x509} (gnutls_privkey_t @var{pkey}, gnutls_x509_privkey_t @var{key}, unsigned int @var{flags})
 
3639
@var{pkey}: The private key
 
3640
 
 
3641
@var{key}: The private key to be imported
 
3642
 
 
3643
@var{flags}: should be zero
 
3644
 
 
3645
This function will import the given private key to the abstract
 
3646
@code{gnutls_privkey_t} structure.
 
3647
 
 
3648
The @code{gnutls_x509_privkey_t} object must not be deallocated
 
3649
during the lifetime of this structure.
 
3650
 
 
3651
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3652
negative error value.
 
3653
@end deftypefun
 
3654
 
 
3655
@subheading gnutls_privkey_init
 
3656
@anchor{gnutls_privkey_init}
 
3657
@deftypefun {int} {gnutls_privkey_init} (gnutls_privkey_t * @var{key})
 
3658
@var{key}: The structure to be initialized
 
3659
 
 
3660
This function will initialize an private key structure.
 
3661
 
 
3662
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3663
negative error value.
 
3664
@end deftypefun
 
3665
 
 
3666
@subheading gnutls_privkey_sign_data
 
3667
@anchor{gnutls_privkey_sign_data}
 
3668
@deftypefun {int} {gnutls_privkey_sign_data} (gnutls_privkey_t @var{signer}, gnutls_digest_algorithm_t @var{hash}, unsigned int @var{flags}, const gnutls_datum_t * @var{data}, gnutls_datum_t * @var{signature})
 
3669
@var{signer}: Holds the key
 
3670
 
 
3671
@var{hash}: should be a digest algorithm
 
3672
 
 
3673
@var{flags}: should be 0 for now
 
3674
 
 
3675
@var{data}: holds the data to be signed
 
3676
 
 
3677
@var{signature}: will contain the signature allocate with @code{gnutls_malloc()}
 
3678
 
 
3679
This function will sign the given data using a signature algorithm
 
3680
supported by the private key. Signature algorithms are always used
 
3681
together with a hash functions.  Different hash functions may be
 
3682
used for the RSA algorithm, but only SHA-1 for the DSA keys.
 
3683
 
 
3684
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3685
negative error value.
 
3686
 
 
3687
@strong{Since:} 2.12.0
 
3688
@end deftypefun
 
3689
 
 
3690
@subheading gnutls_privkey_sign_hash
 
3691
@anchor{gnutls_privkey_sign_hash}
 
3692
@deftypefun {int} {gnutls_privkey_sign_hash} (gnutls_privkey_t @var{signer}, gnutls_digest_algorithm_t @var{hash_algo}, unsigned int @var{flags}, const gnutls_datum_t * @var{hash_data}, gnutls_datum_t * @var{signature})
 
3693
@var{signer}: Holds the signer's key
 
3694
 
 
3695
@var{hash_algo}: The hash algorithm used
 
3696
 
 
3697
@var{flags}: zero for now
 
3698
 
 
3699
@var{hash_data}: holds the data to be signed
 
3700
 
 
3701
@var{signature}: will contain newly allocated signature
 
3702
 
 
3703
This function will sign the given hashed data using a signature algorithm
 
3704
supported by the private key. Signature algorithms are always used
 
3705
together with a hash functions.  Different hash functions may be
 
3706
used for the RSA algorithm, but only SHA-XXX for the DSA keys.
 
3707
 
 
3708
Use @code{gnutls_x509_crt_get_preferred_hash_algorithm()} to determine
 
3709
the hash algorithm.
 
3710
 
 
3711
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
3712
negative error value.
 
3713
 
 
3714
@strong{Since:} 2.12.0
 
3715
@end deftypefun
 
3716
 
3017
3717
@subheading gnutls_protocol_get_id
3018
3718
@anchor{gnutls_protocol_get_id}
3019
3719
@deftypefun {gnutls_protocol_t} {gnutls_protocol_get_id} (const char * @var{name})
3141
3841
@strong{Returns:} @code{GNUTLS_E_SUCCESS} on success, or an error code.
3142
3842
 
3143
3843
@strong{Since:} 2.4.0
 
3844
 
 
3845
@strong{Deprecated:} The need for this interface was dropped from the
 
3846
standard on publication as a RFC.  The function works now but will
 
3847
return a hard failure in a future release.
3144
3848
@end deftypefun
3145
3849
 
3146
3850
@subheading gnutls_psk_server_get_username
3156
3860
 
3157
3861
@subheading gnutls_psk_set_client_credentials_function
3158
3862
@anchor{gnutls_psk_set_client_credentials_function}
3159
 
@deftypefun {void} {gnutls_psk_set_client_credentials_function} (gnutls_psk_client_credentials_t          @var{cred}, gnutls_psk_client_credentials_function          * @var{func})
 
3863
@deftypefun {void} {gnutls_psk_set_client_credentials_function} (gnutls_psk_client_credentials_t                                             @var{cred}, gnutls_psk_client_credentials_function                                             * @var{func})
3160
3864
@var{cred}: is a @code{gnutls_psk_server_credentials_t} structure.
3161
3865
 
3162
3866
@var{func}: is the callback function
3210
3914
 
3211
3915
@subheading gnutls_psk_set_server_credentials_file
3212
3916
@anchor{gnutls_psk_set_server_credentials_file}
3213
 
@deftypefun {int} {gnutls_psk_set_server_credentials_file} (gnutls_psk_server_credentials_t      @var{res}, const char * @var{password_file})
 
3917
@deftypefun {int} {gnutls_psk_set_server_credentials_file} (gnutls_psk_server_credentials_t                                         @var{res}, const char * @var{password_file})
3214
3918
@var{res}: is a @code{gnutls_psk_server_credentials_t} structure.
3215
3919
 
3216
3920
@var{password_file}: is the PSK password file (passwd.psk)
3224
3928
 
3225
3929
@subheading gnutls_psk_set_server_credentials_function
3226
3930
@anchor{gnutls_psk_set_server_credentials_function}
3227
 
@deftypefun {void} {gnutls_psk_set_server_credentials_function} (gnutls_psk_server_credentials_t          @var{cred}, gnutls_psk_server_credentials_function          * @var{func})
 
3931
@deftypefun {void} {gnutls_psk_set_server_credentials_function} (gnutls_psk_server_credentials_t                                             @var{cred}, gnutls_psk_server_credentials_function                                             * @var{func})
3228
3932
@var{cred}: is a @code{gnutls_psk_server_credentials_t} structure.
3229
3933
 
3230
3934
@var{func}: is the callback function
3286
3990
should return zero on success.
3287
3991
@end deftypefun
3288
3992
 
 
3993
@subheading gnutls_pubkey_deinit
 
3994
@anchor{gnutls_pubkey_deinit}
 
3995
@deftypefun {void} {gnutls_pubkey_deinit} (gnutls_pubkey_t @var{key})
 
3996
@var{key}: The structure to be deinitialized
 
3997
 
 
3998
This function will deinitialize a public key structure.
 
3999
@end deftypefun
 
4000
 
 
4001
@subheading gnutls_pubkey_export
 
4002
@anchor{gnutls_pubkey_export}
 
4003
@deftypefun {int} {gnutls_pubkey_export} (gnutls_pubkey_t @var{key}, gnutls_x509_crt_fmt_t @var{format}, void * @var{output_data}, size_t * @var{output_data_size})
 
4004
@var{key}: Holds the certificate
 
4005
 
 
4006
@var{format}: the format of output params. One of PEM or DER.
 
4007
 
 
4008
@var{output_data}: will contain a certificate PEM or DER encoded
 
4009
 
 
4010
@var{output_data_size}: holds the size of output_data (and will be
 
4011
replaced by the actual size of parameters)
 
4012
 
 
4013
This function will export the certificate to DER or PEM format.
 
4014
 
 
4015
If the buffer provided is not long enough to hold the output, then
 
4016
*output_data_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will
 
4017
be returned.
 
4018
 
 
4019
If the structure is PEM encoded, it will have a header
 
4020
of "BEGIN CERTIFICATE".
 
4021
 
 
4022
@strong{Return value:} In case of failure a negative value will be
 
4023
returned, and 0 on success.
 
4024
@end deftypefun
 
4025
 
 
4026
@subheading gnutls_pubkey_get_key_id
 
4027
@anchor{gnutls_pubkey_get_key_id}
 
4028
@deftypefun {int} {gnutls_pubkey_get_key_id} (gnutls_pubkey_t @var{key}, unsigned int @var{flags}, unsigned char * @var{output_data}, size_t * @var{output_data_size})
 
4029
@var{key}: Holds the public key
 
4030
 
 
4031
@var{flags}: should be 0 for now
 
4032
 
 
4033
@var{output_data}: will contain the key ID
 
4034
 
 
4035
@var{output_data_size}: holds the size of output_data (and will be
 
4036
replaced by the actual size of parameters)
 
4037
 
 
4038
This function will return a unique ID the depends on the public
 
4039
key parameters. This ID can be used in checking whether a
 
4040
certificate corresponds to the given public key.
 
4041
 
 
4042
If the buffer provided is not long enough to hold the output, then
 
4043
*output_data_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will
 
4044
be returned.  The output will normally be a SHA-1 hash output,
 
4045
which is 20 bytes.
 
4046
 
 
4047
@strong{Return value:} In case of failure a negative value will be
 
4048
returned, and 0 on success.
 
4049
@end deftypefun
 
4050
 
 
4051
@subheading gnutls_pubkey_get_key_usage
 
4052
@anchor{gnutls_pubkey_get_key_usage}
 
4053
@deftypefun {int} {gnutls_pubkey_get_key_usage} (gnutls_pubkey_t @var{key}, unsigned int * @var{usage})
 
4054
@var{key}: should contain a @code{gnutls_pubkey_t} structure
 
4055
 
 
4056
@var{usage}: If set will return the number of bits of the parameters (may be NULL)
 
4057
 
 
4058
This function will return the key usage of the public key.
 
4059
 
 
4060
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
4061
negative error value.
 
4062
@end deftypefun
 
4063
 
 
4064
@subheading gnutls_pubkey_get_pk_algorithm
 
4065
@anchor{gnutls_pubkey_get_pk_algorithm}
 
4066
@deftypefun {int} {gnutls_pubkey_get_pk_algorithm} (gnutls_pubkey_t @var{key}, unsigned int * @var{bits})
 
4067
@var{key}: should contain a @code{gnutls_pubkey_t} structure
 
4068
 
 
4069
@var{bits}: If set will return the number of bits of the parameters (may be NULL)
 
4070
 
 
4071
This function will return the public key algorithm of a public
 
4072
key and if possible will return a number of bits that indicates
 
4073
the security parameter of the key.
 
4074
 
 
4075
@strong{Returns:} a member of the @code{gnutls_pk_algorithm_t} enumeration on
 
4076
success, or a negative value on error.
 
4077
@end deftypefun
 
4078
 
 
4079
@subheading gnutls_pubkey_get_pk_dsa_raw
 
4080
@anchor{gnutls_pubkey_get_pk_dsa_raw}
 
4081
@deftypefun {int} {gnutls_pubkey_get_pk_dsa_raw} (gnutls_pubkey_t @var{key}, gnutls_datum_t * @var{p}, gnutls_datum_t * @var{q}, gnutls_datum_t * @var{g}, gnutls_datum_t * @var{y})
 
4082
@var{key}: Holds the public key
 
4083
 
 
4084
@var{p}: will hold the p
 
4085
 
 
4086
@var{q}: will hold the q
 
4087
 
 
4088
@var{g}: will hold the g
 
4089
 
 
4090
@var{y}: will hold the y
 
4091
 
 
4092
This function will export the DSA public key's parameters found in
 
4093
the given certificate.  The new parameters will be allocated using
 
4094
@code{gnutls_malloc()} and will be stored in the appropriate datum.
 
4095
 
 
4096
@strong{Returns:} @code{GNUTLS_E_SUCCESS} on success, otherwise an error.
 
4097
@end deftypefun
 
4098
 
 
4099
@subheading gnutls_pubkey_get_pk_rsa_raw
 
4100
@anchor{gnutls_pubkey_get_pk_rsa_raw}
 
4101
@deftypefun {int} {gnutls_pubkey_get_pk_rsa_raw} (gnutls_pubkey_t @var{key}, gnutls_datum_t * @var{m}, gnutls_datum_t * @var{e})
 
4102
@var{key}: Holds the certificate
 
4103
 
 
4104
@var{m}: will hold the modulus
 
4105
 
 
4106
@var{e}: will hold the public exponent
 
4107
 
 
4108
This function will export the RSA public key's parameters found in
 
4109
the given structure.  The new parameters will be allocated using
 
4110
@code{gnutls_malloc()} and will be stored in the appropriate datum.
 
4111
 
 
4112
@strong{Returns:} @code{GNUTLS_E_SUCCESS} on success, otherwise an error.
 
4113
@end deftypefun
 
4114
 
 
4115
@subheading gnutls_pubkey_get_preferred_hash_algorithm
 
4116
@anchor{gnutls_pubkey_get_preferred_hash_algorithm}
 
4117
@deftypefun {int} {gnutls_pubkey_get_preferred_hash_algorithm} (gnutls_pubkey_t @var{key}, gnutls_digest_algorithm_t *                                             @var{hash}, unsigned int * @var{mand})
 
4118
@var{key}: Holds the certificate
 
4119
 
 
4120
@var{hash}: The result of the call with the hash algorithm used for signature
 
4121
 
 
4122
@var{mand}: If non zero it means that the algorithm MUST use this hash. May be NULL.
 
4123
 
 
4124
This function will read the certifcate and return the appropriate digest
 
4125
algorithm to use for signing with this certificate. Some certificates (i.e.
 
4126
DSA might not be able to sign without the preferred algorithm).
 
4127
 
 
4128
@strong{Returns:} the 0 if the hash algorithm is found. A negative value is
 
4129
returned on error.
 
4130
 
 
4131
@strong{Since:} 2.11.0
 
4132
@end deftypefun
 
4133
 
 
4134
@subheading gnutls_pubkey_get_verify_algorithm
 
4135
@anchor{gnutls_pubkey_get_verify_algorithm}
 
4136
@deftypefun {int} {gnutls_pubkey_get_verify_algorithm} (gnutls_pubkey_t @var{key}, const gnutls_datum_t * @var{signature}, gnutls_digest_algorithm_t * @var{hash})
 
4137
@var{key}: Holds the certificate
 
4138
 
 
4139
@var{signature}: contains the signature
 
4140
 
 
4141
@var{hash}: The result of the call with the hash algorithm used for signature
 
4142
 
 
4143
This function will read the certifcate and the signed data to
 
4144
determine the hash algorithm used to generate the signature.
 
4145
 
 
4146
@strong{Returns:} the 0 if the hash algorithm is found. A negative value is
 
4147
returned on error.
 
4148
@end deftypefun
 
4149
 
 
4150
@subheading gnutls_pubkey_import_dsa_raw
 
4151
@anchor{gnutls_pubkey_import_dsa_raw}
 
4152
@deftypefun {int} {gnutls_pubkey_import_dsa_raw} (gnutls_pubkey_t @var{key}, const gnutls_datum_t * @var{p}, const gnutls_datum_t * @var{q}, const gnutls_datum_t * @var{g}, const gnutls_datum_t * @var{y})
 
4153
@var{key}: The structure to store the parsed key
 
4154
 
 
4155
@var{p}: holds the p
 
4156
 
 
4157
@var{q}: holds the q
 
4158
 
 
4159
@var{g}: holds the g
 
4160
 
 
4161
@var{y}: holds the y
 
4162
 
 
4163
This function will convert the given DSA raw parameters to the
 
4164
native @code{gnutls_pubkey_t} format.  The output will be stored
 
4165
in @code{key}.
 
4166
 
 
4167
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
4168
negative error value.
 
4169
@end deftypefun
 
4170
 
 
4171
@subheading gnutls_pubkey_import_openpgp
 
4172
@anchor{gnutls_pubkey_import_openpgp}
 
4173
@deftypefun {int} {gnutls_pubkey_import_openpgp} (gnutls_pubkey_t @var{key}, gnutls_openpgp_crt_t @var{crt}, unsigned int @var{flags})
 
4174
@var{key}: The public key
 
4175
 
 
4176
@var{crt}: The certificate to be imported
 
4177
 
 
4178
@var{flags}: should be zero
 
4179
 
 
4180
This function will import the given public key to the abstract
 
4181
@code{gnutls_pubkey_t} structure. The subkey set as preferred will be
 
4182
imported or the master key otherwise.
 
4183
 
 
4184
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
4185
negative error value.
 
4186
@end deftypefun
 
4187
 
 
4188
@subheading gnutls_pubkey_import_pkcs11_url
 
4189
@anchor{gnutls_pubkey_import_pkcs11_url}
 
4190
@deftypefun {int} {gnutls_pubkey_import_pkcs11_url} (gnutls_pubkey_t @var{key}, const char * @var{url}, unsigned int @var{flags})
 
4191
@var{key}: A key of type @code{gnutls_pubkey_t}
 
4192
 
 
4193
@var{url}: A PKCS 11 url
 
4194
 
 
4195
@var{flags}: One of GNUTLS_PKCS11_OBJ_* flags
 
4196
 
 
4197
This function will import a PKCS 11 certificate to a @code{gnutls_pubkey_t}
 
4198
structure.
 
4199
 
 
4200
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
4201
negative error value.
 
4202
@end deftypefun
 
4203
 
 
4204
@subheading gnutls_pubkey_import_pkcs11
 
4205
@anchor{gnutls_pubkey_import_pkcs11}
 
4206
@deftypefun {int} {gnutls_pubkey_import_pkcs11} (gnutls_pubkey_t @var{key}, gnutls_pkcs11_obj_t @var{obj}, unsigned int @var{flags})
 
4207
@var{key}: The public key
 
4208
 
 
4209
@var{obj}: The parameters to be imported
 
4210
 
 
4211
@var{flags}: should be zero
 
4212
 
 
4213
This function will import the given public key to the abstract
 
4214
@code{gnutls_pubkey_t} structure.
 
4215
 
 
4216
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
4217
negative error value.
 
4218
@end deftypefun
 
4219
 
 
4220
@subheading gnutls_pubkey_import_privkey
 
4221
@anchor{gnutls_pubkey_import_privkey}
 
4222
@deftypefun {int} {gnutls_pubkey_import_privkey} (gnutls_pubkey_t @var{key}, gnutls_privkey_t @var{pkey}, unsigned int @var{usage}, unsigned int @var{flags})
 
4223
@var{key}: The public key
 
4224
 
 
4225
@var{pkey}: The private key
 
4226
 
 
4227
@var{usage}: GNUTLS_KEY_* key usage flags.
 
4228
 
 
4229
@var{flags}: should be zero
 
4230
 
 
4231
This function will import the given public key to the abstract
 
4232
@code{gnutls_pubkey_t} structure.
 
4233
 
 
4234
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
4235
negative error value.
 
4236
 
 
4237
@strong{Since:} 2.12.0
 
4238
@end deftypefun
 
4239
 
 
4240
@subheading gnutls_pubkey_import_rsa_raw
 
4241
@anchor{gnutls_pubkey_import_rsa_raw}
 
4242
@deftypefun {int} {gnutls_pubkey_import_rsa_raw} (gnutls_pubkey_t @var{key}, const gnutls_datum_t * @var{m}, const gnutls_datum_t * @var{e})
 
4243
@var{key}: Is a structure will hold the parameters
 
4244
 
 
4245
@var{m}: holds the modulus
 
4246
 
 
4247
@var{e}: holds the public exponent
 
4248
 
 
4249
This function will replace the parameters in the given structure.
 
4250
The new parameters should be stored in the appropriate
 
4251
gnutls_datum.
 
4252
 
 
4253
@strong{Returns:} @code{GNUTLS_E_SUCCESS} on success, or an negative error code.
 
4254
@end deftypefun
 
4255
 
 
4256
@subheading gnutls_pubkey_import_x509
 
4257
@anchor{gnutls_pubkey_import_x509}
 
4258
@deftypefun {int} {gnutls_pubkey_import_x509} (gnutls_pubkey_t @var{key}, gnutls_x509_crt_t @var{crt}, unsigned int @var{flags})
 
4259
@var{key}: The public key
 
4260
 
 
4261
@var{crt}: The certificate to be imported
 
4262
 
 
4263
@var{flags}: should be zero
 
4264
 
 
4265
This function will import the given public key to the abstract
 
4266
@code{gnutls_pubkey_t} structure.
 
4267
 
 
4268
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
4269
negative error value.
 
4270
@end deftypefun
 
4271
 
 
4272
@subheading gnutls_pubkey_import
 
4273
@anchor{gnutls_pubkey_import}
 
4274
@deftypefun {int} {gnutls_pubkey_import} (gnutls_pubkey_t @var{key}, const gnutls_datum_t * @var{data}, gnutls_x509_crt_fmt_t @var{format})
 
4275
@var{key}: The structure to store the parsed public key. 
 
4276
 
 
4277
@var{data}: The DER or PEM encoded certificate. 
 
4278
 
 
4279
@var{format}: One of DER or PEM 
 
4280
 
 
4281
This function will convert the given DER or PEM encoded Public key 
 
4282
to the native gnutls_pubkey_t format.The output will be stored * in @ key. 
 
4283
If the Certificate is PEM encoded it should have a header of "PUBLIC KEY". 
 
4284
 
 
4285
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
4286
negative error value.
 
4287
@end deftypefun
 
4288
 
 
4289
@subheading gnutls_pubkey_init
 
4290
@anchor{gnutls_pubkey_init}
 
4291
@deftypefun {int} {gnutls_pubkey_init} (gnutls_pubkey_t * @var{key})
 
4292
@var{key}: The structure to be initialized
 
4293
 
 
4294
This function will initialize an public key structure.
 
4295
 
 
4296
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
4297
negative error value.
 
4298
@end deftypefun
 
4299
 
 
4300
@subheading gnutls_pubkey_set_key_usage
 
4301
@anchor{gnutls_pubkey_set_key_usage}
 
4302
@deftypefun {int} {gnutls_pubkey_set_key_usage} (gnutls_pubkey_t @var{key}, unsigned int @var{usage})
 
4303
@var{key}: a certificate of type @code{gnutls_x509_crt_t}
 
4304
 
 
4305
@var{usage}: an ORed sequence of the GNUTLS_KEY_* elements.
 
4306
 
 
4307
This function will set the key usage flags of the public key. This
 
4308
is only useful if the key is to be exported to a certificate or
 
4309
certificate request.
 
4310
 
 
4311
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
4312
negative error value.
 
4313
@end deftypefun
 
4314
 
 
4315
@subheading gnutls_pubkey_verify_data
 
4316
@anchor{gnutls_pubkey_verify_data}
 
4317
@deftypefun {int} {gnutls_pubkey_verify_data} (gnutls_pubkey_t @var{pubkey}, unsigned int @var{flags}, const gnutls_datum_t * @var{data}, const gnutls_datum_t * @var{signature})
 
4318
@var{pubkey}: Holds the public key
 
4319
 
 
4320
@var{flags}: should be 0 for now
 
4321
 
 
4322
@var{data}: holds the data to be signed
 
4323
 
 
4324
@var{signature}: contains the signature
 
4325
 
 
4326
This function will verify the given signed data, using the
 
4327
parameters from the certificate.
 
4328
 
 
4329
@strong{Returns:} In case of a verification failure
 
4330
@code{GNUTLS_E_PK_SIG_VERIFY_FAILED} is returned, and a positive code
 
4331
on success.
 
4332
 
 
4333
@strong{Since:} 2.12.0
 
4334
@end deftypefun
 
4335
 
 
4336
@subheading gnutls_pubkey_verify_hash
 
4337
@anchor{gnutls_pubkey_verify_hash}
 
4338
@deftypefun {int} {gnutls_pubkey_verify_hash} (gnutls_pubkey_t @var{key}, unsigned int @var{flags}, const gnutls_datum_t * @var{hash}, const gnutls_datum_t * @var{signature})
 
4339
@var{key}: Holds the certificate
 
4340
 
 
4341
@var{flags}: should be 0 for now
 
4342
 
 
4343
@var{hash}: holds the hash digest to be verified
 
4344
 
 
4345
@var{signature}: contains the signature
 
4346
 
 
4347
This function will verify the given signed digest, using the
 
4348
parameters from the certificate.
 
4349
 
 
4350
@strong{Returns:} In case of a verification failure @code{GNUTLS_E_PK_SIG_VERIFY_FAILED} 
 
4351
is returned, and a positive code on success.
 
4352
@end deftypefun
 
4353
 
3289
4354
@subheading gnutls_record_check_pending
3290
4355
@anchor{gnutls_record_check_pending}
3291
4356
@deftypefun {size_t} {gnutls_record_check_pending} (gnutls_session_t @var{session})
3294
4359
This function checks if there are any data to receive in the gnutls
3295
4360
buffers.
3296
4361
 
3297
 
Notice that you may also use @code{select()} to check for data in a TCP
3298
 
connection, instead of this function.  GnuTLS leaves some data in
3299
 
the tcp buffer in order for select to work.
3300
 
 
3301
4362
@strong{Returns:} the size of that data or 0.
3302
4363
@end deftypefun
3303
4364
 
3465
4526
@strong{Returns:} @code{GNUTLS_E_SUCCESS} on success, otherwise an error.
3466
4527
@end deftypefun
3467
4528
 
 
4529
@subheading gnutls_rnd
 
4530
@anchor{gnutls_rnd}
 
4531
@deftypefun {int} {gnutls_rnd} (gnutls_rnd_level_t @var{level}, void * @var{data}, size_t @var{len})
 
4532
@var{level}: a security level
 
4533
 
 
4534
@var{data}: place to store random bytes
 
4535
 
 
4536
@var{len}: The requested size
 
4537
 
 
4538
This function will generate random data and store it
 
4539
to output buffer.
 
4540
 
 
4541
@strong{Returns:} Zero or a negative value on error.
 
4542
@end deftypefun
 
4543
 
3468
4544
@subheading gnutls_rsa_export_get_modulus_bits
3469
4545
@anchor{gnutls_rsa_export_get_modulus_bits}
3470
4546
@deftypefun {int} {gnutls_rsa_export_get_modulus_bits} (gnutls_session_t @var{session})
3646
4722
@strong{Since:} 2.10.0
3647
4723
@end deftypefun
3648
4724
 
 
4725
@subheading gnutls_sec_param_get_name
 
4726
@anchor{gnutls_sec_param_get_name}
 
4727
@deftypefun {const char *} {gnutls_sec_param_get_name} (gnutls_sec_param_t @var{param})
 
4728
@var{param}: is a security parameter
 
4729
 
 
4730
Convert a @code{gnutls_sec_param_t} value to a string.
 
4731
 
 
4732
@strong{Returns:} a pointer to a string that contains the name of the
 
4733
specified public key algorithm, or @code{NULL}.
 
4734
@end deftypefun
 
4735
 
 
4736
@subheading gnutls_sec_param_to_pk_bits
 
4737
@anchor{gnutls_sec_param_to_pk_bits}
 
4738
@deftypefun {unsigned int} {gnutls_sec_param_to_pk_bits} (gnutls_pk_algorithm_t @var{algo}, gnutls_sec_param_t @var{param})
 
4739
@var{algo}: is a public key algorithm
 
4740
 
 
4741
@var{param}: is a security parameter
 
4742
 
 
4743
When generating private and public key pairs a difficult question
 
4744
is which size of "bits" the modulus will be in RSA and the group size
 
4745
in DSA. The easy answer is 1024, which is also wrong. This function
 
4746
will convert a human understandable security parameter to an
 
4747
appropriate size for the specific algorithm.
 
4748
 
 
4749
@strong{Returns:} The number of bits, or zero.
 
4750
@end deftypefun
 
4751
 
3649
4752
@subheading gnutls_server_name_get
3650
4753
@anchor{gnutls_server_name_get}
3651
4754
@deftypefun {int} {gnutls_server_name_get} (gnutls_session_t @var{session}, void * @var{data}, size_t * @var{data_length}, unsigned int * @var{type}, unsigned int @var{indx})
3705
4808
otherwise an error code is returned.
3706
4809
@end deftypefun
3707
4810
 
 
4811
@subheading gnutls_session_channel_binding
 
4812
@anchor{gnutls_session_channel_binding}
 
4813
@deftypefun {int} {gnutls_session_channel_binding} (gnutls_session_t @var{session}, gnutls_channel_binding_t @var{cbtype}, gnutls_datum_t * @var{cb})
 
4814
@var{session}: is a @code{gnutls_session_t} structure.
 
4815
 
 
4816
@var{cbtype}: an @code{gnutls_channel_binding_t} enumeration type
 
4817
 
 
4818
@var{cb}: output buffer array with data
 
4819
 
 
4820
Extract given channel binding data of the @code{cbtype} (e.g.,
 
4821
@code{GNUTLS_CB_TLS_UNIQUE}) type.
 
4822
 
 
4823
@strong{Returns:} @code{GNUTLS_E_SUCCESS} on success,
 
4824
@code{GNUTLS_E_UNIMPLEMENTED_FEATURE} if the @code{cbtype} is unsupported,
 
4825
@code{GNUTLS_E_CHANNEL_BINDING_NOT_AVAILABLE} if the data is not
 
4826
currently available, or an error code.
 
4827
 
 
4828
@strong{Since:} 2.12.0
 
4829
@end deftypefun
 
4830
 
3708
4831
@subheading gnutls_session_enable_compatibility_mode
3709
4832
@anchor{gnutls_session_enable_compatibility_mode}
3710
4833
@deftypefun {void} {gnutls_session_enable_compatibility_mode} (gnutls_session_t @var{session})
3719
4842
everything out there, need to call this function.
3720
4843
@end deftypefun
3721
4844
 
3722
 
@subheading gnutls_session_get_client_random
3723
 
@anchor{gnutls_session_get_client_random}
3724
 
@deftypefun {const void *} {gnutls_session_get_client_random} (gnutls_session_t @var{session})
3725
 
@var{session}: is a @code{gnutls_session_t} structure.
3726
 
 
3727
 
Return a pointer to the 32-byte client random field used in the
3728
 
session.  The pointer must not be modified or deallocated.
3729
 
 
3730
 
If a client random value has not yet been established, the output
3731
 
will be garbage; in particular, a @code{NULL} return value should not be
3732
 
expected.
3733
 
 
3734
 
@strong{Returns:} pointer to client random data.
3735
 
@end deftypefun
3736
 
 
3737
4845
@subheading gnutls_session_get_data2
3738
4846
@anchor{gnutls_session_get_data2}
3739
4847
@deftypefun {int} {gnutls_session_get_data2} (gnutls_session_t @var{session}, gnutls_datum_t * @var{data})
3799
4907
an error code is returned.
3800
4908
@end deftypefun
3801
4909
 
3802
 
@subheading gnutls_session_get_master_secret
3803
 
@anchor{gnutls_session_get_master_secret}
3804
 
@deftypefun {const void *} {gnutls_session_get_master_secret} (gnutls_session_t @var{session})
3805
 
@var{session}: is a @code{gnutls_session_t} structure.
3806
 
 
3807
 
Return a pointer to the 48-byte master secret in the session.  The
3808
 
pointer must not be modified or deallocated.
3809
 
 
3810
 
If a master secret value has not yet been established, the output
3811
 
will be garbage; in particular, a @code{NULL} return value should not be
3812
 
expected.
3813
 
 
3814
 
Consider using @code{gnutls_prf()} rather than extracting the master
3815
 
secret and use it to derive further data.
3816
 
 
3817
 
@strong{Returns:} pointer to master secret data.
3818
 
@end deftypefun
3819
 
 
3820
4910
@subheading gnutls_session_get_ptr
3821
4911
@anchor{gnutls_session_get_ptr}
3822
4912
@deftypefun {void *} {gnutls_session_get_ptr} (gnutls_session_t @var{session})
3829
4919
@code{NULL} if it was never set.
3830
4920
@end deftypefun
3831
4921
 
3832
 
@subheading gnutls_session_get_server_random
3833
 
@anchor{gnutls_session_get_server_random}
3834
 
@deftypefun {const void *} {gnutls_session_get_server_random} (gnutls_session_t @var{session})
3835
 
@var{session}: is a @code{gnutls_session_t} structure.
3836
 
 
3837
 
Return a pointer to the 32-byte server random field used in the
3838
 
session.  The pointer must not be modified or deallocated.
3839
 
 
3840
 
If a server random value has not yet been established, the output
3841
 
will be garbage; in particular, a @code{NULL} return value should not be
3842
 
expected.
3843
 
 
3844
 
@strong{Returns:} pointer to server random data.
3845
 
@end deftypefun
3846
 
 
3847
4922
@subheading gnutls_session_is_resumed
3848
4923
@anchor{gnutls_session_is_resumed}
3849
4924
@deftypefun {int} {gnutls_session_is_resumed} (gnutls_session_t @var{session})
3877
4952
an error code is returned.
3878
4953
@end deftypefun
3879
4954
 
3880
 
@subheading gnutls_session_set_finished_function
3881
 
@anchor{gnutls_session_set_finished_function}
3882
 
@deftypefun {void} {gnutls_session_set_finished_function} (gnutls_session_t @var{session}, gnutls_finished_callback_func @var{func})
3883
 
@var{session}: is a @code{gnutls_session_t} structure.
3884
 
 
3885
 
@var{func}: a @code{gnutls_finished_callback_func} callback.
3886
 
 
3887
 
Register a callback function for the session that will be called
3888
 
when a TLS Finished message has been generated.  The function is
3889
 
typically used to copy away the TLS finished message for later use
3890
 
as a channel binding or similar purpose.
3891
 
 
3892
 
@strong{The callback should follow this prototype:} 
3893
 
void callback (gnutls_session_t @code{session}, const void *@code{finished}, size_t @code{len});
3894
 
 
3895
 
The @code{finished} parameter will contain the binary TLS finished
3896
 
message, and @code{len} will contains its length.  For SSLv3 connections,
3897
 
the @code{len} parameter will be 36 and for TLS connections it will be
3898
 
12.
3899
 
 
3900
 
It is recommended that the function returns quickly in order to not
3901
 
delay the handshake.  Use the function to store a copy of the TLS
3902
 
finished message for later use.
3903
 
 
3904
 
@strong{Since:} 2.6.0
3905
 
@end deftypefun
3906
 
 
3907
4955
@subheading gnutls_session_set_ptr
3908
4956
@anchor{gnutls_session_set_ptr}
3909
4957
@deftypefun {void} {gnutls_session_set_ptr} (gnutls_session_t @var{session}, void * @var{ptr})
4049
5097
 
4050
5098
@strong{Returns:} The function pointer set by @code{gnutls_sign_callback_set()}, or
4051
5099
if not set, @code{NULL}.
 
5100
 
 
5101
@strong{Deprecated:} Use the PKCS 11 interfaces instead.
4052
5102
@end deftypefun
4053
5103
 
4054
5104
@subheading gnutls_sign_callback_set
4072
5122
The @code{userdata} parameter is passed to the @code{sign_func} verbatim, and
4073
5123
can be used to store application-specific data needed in the
4074
5124
callback function.  See also @code{gnutls_sign_callback_get()}.
 
5125
 
 
5126
@strong{Deprecated:} Use the PKCS 11 interfaces instead.
4075
5127
@end deftypefun
4076
5128
 
4077
5129
@subheading gnutls_sign_get_id
4244
5296
 
4245
5297
@subheading gnutls_srp_set_client_credentials_function
4246
5298
@anchor{gnutls_srp_set_client_credentials_function}
4247
 
@deftypefun {void} {gnutls_srp_set_client_credentials_function} (gnutls_srp_client_credentials_t          @var{cred}, gnutls_srp_client_credentials_function          * @var{func})
 
5299
@deftypefun {void} {gnutls_srp_set_client_credentials_function} (gnutls_srp_client_credentials_t                                             @var{cred}, gnutls_srp_client_credentials_function                                             * @var{func})
4248
5300
@var{cred}: is a @code{gnutls_srp_server_credentials_t} structure.
4249
5301
 
4250
5302
@var{func}: is the callback function
4329
5381
 
4330
5382
@subheading gnutls_srp_set_server_credentials_function
4331
5383
@anchor{gnutls_srp_set_server_credentials_function}
4332
 
@deftypefun {void} {gnutls_srp_set_server_credentials_function} (gnutls_srp_server_credentials_t          @var{cred}, gnutls_srp_server_credentials_function          * @var{func})
 
5384
@deftypefun {void} {gnutls_srp_set_server_credentials_function} (gnutls_srp_server_credentials_t                                             @var{cred}, gnutls_srp_server_credentials_function                                             * @var{func})
4333
5385
@var{cred}: is a @code{gnutls_srp_server_credentials_t} structure.
4334
5386
 
4335
5387
@var{func}: is the callback function
4454
5506
@strong{Returns:} first argument of the transport function.
4455
5507
@end deftypefun
4456
5508
 
 
5509
@subheading gnutls_transport_set_errno_function
 
5510
@anchor{gnutls_transport_set_errno_function}
 
5511
@deftypefun {void} {gnutls_transport_set_errno_function} (gnutls_session_t @var{session}, gnutls_errno_func @var{errno_func})
 
5512
@var{session}: is a @code{gnutls_session_t} structure.
 
5513
 
 
5514
@var{errno_func}: a callback function similar to @code{write()}
 
5515
 
 
5516
This is the function where you set a function to retrieve errno
 
5517
after a failed push or pull operation.
 
5518
 
 
5519
errno_func is of the form,
 
5520
int (*gnutls_errno_func)(gnutls_transport_ptr_t);
 
5521
and should return the errno.
 
5522
@end deftypefun
 
5523
 
4457
5524
@subheading gnutls_transport_set_errno
4458
5525
@anchor{gnutls_transport_set_errno}
4459
5526
@deftypefun {void} {gnutls_transport_set_errno} (gnutls_session_t @var{session}, int @var{err})
4544
5611
@subheading gnutls_transport_set_pull_function
4545
5612
@anchor{gnutls_transport_set_pull_function}
4546
5613
@deftypefun {void} {gnutls_transport_set_pull_function} (gnutls_session_t @var{session}, gnutls_pull_func @var{pull_func})
4547
 
@var{session}: gnutls session
 
5614
@var{session}: is a @code{gnutls_session_t} structure.
4548
5615
 
4549
5616
@var{pull_func}: a callback function similar to @code{read()}
4550
5617
 
4559
5626
@subheading gnutls_transport_set_push_function
4560
5627
@anchor{gnutls_transport_set_push_function}
4561
5628
@deftypefun {void} {gnutls_transport_set_push_function} (gnutls_session_t @var{session}, gnutls_push_func @var{push_func})
4562
 
@var{session}: gnutls session
 
5629
@var{session}: is a @code{gnutls_session_t} structure.
4563
5630
 
4564
5631
@var{push_func}: a callback function similar to @code{write()}
4565
5632
 
4571
5638
 
4572
5639
PUSH_FUNC is of the form,
4573
5640
ssize_t (*gnutls_push_func)(gnutls_transport_ptr_t, const void*, size_t);
 
5641
@end deftypefun
 
5642
 
 
5643
@subheading gnutls_transport_set_vec_push_function
 
5644
@anchor{gnutls_transport_set_vec_push_function}
 
5645
@deftypefun {void} {gnutls_transport_set_vec_push_function} (gnutls_session_t @var{session}, gnutls_vec_push_func @var{vec_func})
 
5646
@var{session}: is a @code{gnutls_session_t} structure.
 
5647
 
 
5648
@var{vec_func}: a callback function similar to @code{writev()}
 
5649
 
 
5650
This is the function where you set a push function for gnutls to
 
5651
use in order to send data.  If you are going to use berkeley style
 
5652
sockets, you do not need to use this function since the default
 
5653
(send(2)) will probably be ok.  Otherwise you should specify this
 
5654
function for gnutls to be able to send data.
 
5655
 
 
5656
PUSH_FUNC is of the form,
 
5657
ssize_t (*gnutls_push_func)(gnutls_transport_ptr_t, const void*, size_t);
 
5658
@end deftypefun
 
5659
 
 
5660
@subheading gnutls_x509_crq_set_pubkey
 
5661
@anchor{gnutls_x509_crq_set_pubkey}
 
5662
@deftypefun {int} {gnutls_x509_crq_set_pubkey} (gnutls_x509_crq_t @var{crq}, gnutls_pubkey_t @var{key})
 
5663
@var{crq}: should contain a @code{gnutls_x509_crq_t} structure
 
5664
 
 
5665
@var{key}: holds a public key
 
5666
 
 
5667
This function will set the public parameters from the given public
 
5668
key to the request.
 
5669
 
 
5670
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
5671
negative error value.
 
5672
@end deftypefun
 
5673
 
 
5674
@subheading gnutls_x509_crt_import_pkcs11_url
 
5675
@anchor{gnutls_x509_crt_import_pkcs11_url}
 
5676
@deftypefun {int} {gnutls_x509_crt_import_pkcs11_url} (gnutls_x509_crt_t @var{crt}, const char * @var{url}, unsigned int @var{flags})
 
5677
@var{crt}: A certificate of type @code{gnutls_x509_crt_t}
 
5678
 
 
5679
@var{url}: A PKCS 11 url
 
5680
 
 
5681
@var{flags}: One of GNUTLS_PKCS11_OBJ_* flags
 
5682
 
 
5683
This function will import a PKCS 11 certificate directly from a token
 
5684
without involving the @code{gnutls_pkcs11_obj_t} structure. This function will
 
5685
fail if the certificate stored is not of X.509 type.
 
5686
 
 
5687
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
5688
negative error value.
 
5689
@end deftypefun
 
5690
 
 
5691
@subheading gnutls_x509_crt_import_pkcs11
 
5692
@anchor{gnutls_x509_crt_import_pkcs11}
 
5693
@deftypefun {int} {gnutls_x509_crt_import_pkcs11} (gnutls_x509_crt_t @var{crt}, gnutls_pkcs11_obj_t @var{pkcs11_crt})
 
5694
@var{crt}: A certificate of type @code{gnutls_x509_crt_t}
 
5695
 
 
5696
@var{pkcs11_crt}: A PKCS 11 object that contains a certificate
 
5697
 
 
5698
This function will import a PKCS 11 certificate to a @code{gnutls_x509_crt_t}
 
5699
structure.
 
5700
 
 
5701
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
5702
negative error value.
 
5703
@end deftypefun
 
5704
 
 
5705
@subheading gnutls_x509_crt_list_import_pkcs11
 
5706
@anchor{gnutls_x509_crt_list_import_pkcs11}
 
5707
@deftypefun {int} {gnutls_x509_crt_list_import_pkcs11} (gnutls_x509_crt_t * @var{certs}, unsigned int @var{cert_max}, gnutls_pkcs11_obj_t * const @var{objs}, unsigned int @var{flags})
 
5708
@var{certs}: A list of certificates of type @code{gnutls_x509_crt_t}
 
5709
 
 
5710
@var{cert_max}: The maximum size of the list
 
5711
 
 
5712
@var{objs}: A list of PKCS 11 objects
 
5713
 
 
5714
@var{flags}: 0 for now
 
5715
 
 
5716
This function will import a PKCS 11 certificate list to a list of 
 
5717
@code{gnutls_x509_crt_t} structure. These must not be initialized.
 
5718
 
 
5719
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
5720
negative error value.
 
5721
@end deftypefun
 
5722
 
 
5723
@subheading gnutls_x509_crt_set_pubkey
 
5724
@anchor{gnutls_x509_crt_set_pubkey}
 
5725
@deftypefun {int} {gnutls_x509_crt_set_pubkey} (gnutls_x509_crt_t @var{crt}, gnutls_pubkey_t @var{key})
 
5726
@var{crt}: should contain a @code{gnutls_x509_crt_t} structure
 
5727
 
 
5728
@var{key}: holds a public key
 
5729
 
 
5730
This function will set the public parameters from the given public
 
5731
key to the request.
 
5732
 
 
5733
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} is returned, otherwise a
 
5734
negative error value.
4574
5735
@end deftypefun
 
 
b'\\ No newline at end of file'