Debian Codegraph @

doc/functions/gnutls_privkey_sign_data

raw
1
2
3
4
5 @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})
6 @var{signer}: Holds the key
7
8 @var{hash}: should be a digest algorithm
9
10 @var{flags}: Zero or one of @code{gnutls_privkey_flags_t}
11
12 @var{data}: holds the data to be signed
13
14 @var{signature}: will contain the signature allocated with @code{gnutls_malloc()}
15
16 This function will sign the given data using a signature algorithm
17 supported by the private key. Signature algorithms are always used
18 together with a hash functions. Different hash functions may be
19 used for the RSA algorithm, but only the SHA family for the DSA keys.
20
21 You may use @code{gnutls_pubkey_get_preferred_hash_algorithm()} to determine
22 the hash algorithm.
23
24 @strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} (0) is returned, otherwise a
25 negative error value.
26
27 @strong{Since:} 2.12.0
28 @end deftypefun