1gnutls_x509_privkey_sign_data(3)    gnutls    gnutls_x509_privkey_sign_data(3)
2
3
4

NAME

6       gnutls_x509_privkey_sign_data - sign data using the private key
7

SYNOPSIS

9       #include <gnutls/x509.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

ARGUMENTS

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

DESCRIPTION

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

RETURNS

46       On  success,  GNUTLS_E_SUCCESS  is returned, otherwise a negative error
47       value.
48

REPORTING BUGS

50       Report   bugs   to    <bug-gnutls@gnu.org>.     GnuTLS    home    page:
51       http://www.gnu.org/software/gnutls/  General  help  using GNU software:
52       http://www.gnu.org/gethelp/
53
55       Copyright © 2008 Free Software Foundation.
56       Copying and distribution of this file, with  or  without  modification,
57       are  permitted  in  any  medium  without royalty provided the copyright
58       notice and this notice are preserved.
59

SEE ALSO

61       The full documentation for gnutls is maintained as  a  Texinfo  manual.
62       If  the  info  and gnutls programs are properly installed at your site,
63       the command
64
65              info gnutls
66
67       should give you access to the complete manual.
68
69
70
71gnutls                               2.8.6    gnutls_x509_privkey_sign_data(3)
Impressum