Blame doc/functions/gnutls_privkey_sign_hash
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
@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})
|
|
Packit Service |
4684c1 |
@var{signer}: Holds the signer's key
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
@var{hash_algo}: The hash algorithm used
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
@var{flags}: Zero or one of @code{gnutls_privkey_flags_t}
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
@var{hash_data}: holds the data to be signed
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
@var{signature}: will contain newly allocated signature
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
This function will sign the given hashed data using a signature algorithm
|
|
Packit Service |
4684c1 |
supported by the private key. Signature algorithms are always used
|
|
Packit Service |
4684c1 |
together with a hash functions. Different hash functions may be
|
|
Packit Service |
4684c1 |
used for the RSA algorithm, but only SHA-XXX for the DSA keys.
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
You may use @code{gnutls_pubkey_get_preferred_hash_algorithm()} to determine
|
|
Packit Service |
4684c1 |
the hash algorithm.
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
The flags may be @code{GNUTLS_PRIVKEY_SIGN_FLAG_TLS1_RSA} or @code{GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS} .
|
|
Packit Service |
4684c1 |
In the former case this function will ignore @code{hash_algo} and perform a raw PKCS1 signature,
|
|
Packit Service |
4684c1 |
and in the latter an RSA-PSS signature will be generated.
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
Note that, not all algorithm support signing already hashed data. When
|
|
Packit Service |
4684c1 |
signing with Ed25519, @code{gnutls_privkey_sign_data()} should be used.
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} (0) is returned, otherwise a
|
|
Packit Service |
4684c1 |
negative error value.
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
@strong{Since:} 2.12.0
|
|
Packit Service |
4684c1 |
@end deftypefun
|