1gnutls_privkey_sign_data(3) gnutls gnutls_privkey_sign_data(3)
2
3
4
6 gnutls_privkey_sign_data - API function
7
9 #include <gnutls/abstract.h>
10
11 int gnutls_privkey_sign_data(gnutls_privkey_t signer,
12 gnutls_digest_algorithm_t hash, unsigned int flags, const
13 gnutls_datum_t * data, gnutls_datum_t * signature);
14
16 gnutls_privkey_t signer
17 Holds the key
18
19 gnutls_digest_algorithm_t hash
20 should be a digest algorithm
21
22 unsigned int flags
23 Zero or one of gnutls_privkey_flags_t
24
25 const gnutls_datum_t * data
26 holds the data to be signed
27
28 gnutls_datum_t * signature
29 will contain the signature allocated with gnutls_malloc()
30
32 This function will sign the given data using a signature algorithm sup‐
33 ported by the private key. Signature algorithms are always used
34 together with a hash functions. Different hash functions may be used
35 for the RSA algorithm, but only the SHA family for the DSA keys.
36
37 You may use gnutls_pubkey_get_preferred_hash_algorithm() to determine
38 the hash algorithm.
39
41 On success, GNUTLS_E_SUCCESS [22m(0) is returned, otherwise a negative
42 error value.
43
45 2.12.0
46
48 Report bugs to <bugs@gnutls.org>.
49 Home page: http://www.gnutls.org
50
51
53 Copyright © 2001-2018 Free Software Foundation, Inc., and others.
54 Copying and distribution of this file, with or without modification,
55 are permitted in any medium without royalty provided the copyright
56 notice and this notice are preserved.
57
59 The full documentation for gnutls is maintained as a Texinfo manual.
60 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
61 visit
62
63 http://www.gnutls.org/manual/
64
65gnutls 3.6.5 gnutls_privkey_sign_data(3)