1gnutls_x509_privkey_sign_data(3) gnutls gnutls_x509_privkey_sign_data(3)
2
3
4
6 gnutls_x509_privkey_sign_data - API function
7
9 #include <gnutls/compat.h>
10
11 int gnutls_x509_privkey_sign_data(gnutls_x509_privkey_t key,
12 gnutls_digest_algorithm_t digest, unsigned int flags, const
13 gnutls_datum_t * data, void * signature, size_t * signature_size);
14
16 gnutls_x509_privkey_t key
17 Holds the key
18
19 gnutls_digest_algorithm_t digest
20 should be MD5 or SHA1
21
22 unsigned int flags
23 should be 0 for now
24
25 const gnutls_datum_t * data
26 holds the data to be signed
27
28 void * signature
29 will contain the signature
30
31 size_t * signature_size
32 holds the size of signature (and will be replaced by the
33 new size)
34
36 This function will sign the given data using a signature algorithm sup‐
37 ported by the private key. Signature algorithms are always used
38 together with a hash functions. Different hash functions may be used
39 for the RSA algorithm, but only SHA-1 for the DSA keys.
40
41 If the buffer provided is not long enough to hold the output, then *
42 signature_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will be
43 returned.
44
45 Use gnutls_x509_crt_get_preferred_hash_algorithm() to determine the
46 hash algorithm.
47
49 On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative
50 error value.
51
53 Use gnutls_privkey_sign_data().
54
56 Report bugs to <bugs@gnutls.org>.
57 Home page: http://www.gnutls.org
58
59
61 Copyright © 2001-2014 Free Software Foundation, Inc..
62 Copying and distribution of this file, with or without modification,
63 are permitted in any medium without royalty provided the copyright
64 notice and this notice are preserved.
65
67 The full documentation for gnutls is maintained as a Texinfo manual.
68 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
69 visit
70
71 http://www.gnutls.org/manual/
72
73gnutls 3.3.29 gnutls_x509_privkey_sign_data(3)