1gnutls_privkey_derive_secret(3) gnutls gnutls_privkey_derive_secret(3)
2
3
4
6 gnutls_privkey_derive_secret - API function
7
9 #include <gnutls/abstract.h>
10
11 int gnutls_privkey_derive_secret(gnutls_privkey_t privkey, gnutls_pub‐
12 key_t pubkey, const gnutls_datum_t * nonce, gnutls_datum_t * secret,
13 unsigned int flags);
14
16 gnutls_privkey_t privkey
17 a private key of type gnutls_privkey_t
18
19 gnutls_pubkey_t pubkey
20 a public key of type gnutls_pubkey_t
21
22 const gnutls_datum_t * nonce
23 an optional nonce value
24
25 gnutls_datum_t * secret
26 where shared secret will be stored
27
28 unsigned int flags
29 must be zero
30
32 This function will calculate a shared secret from our privkey and
33 peer's pubkey . The result will be stored in secret , whose data mem‐
34 ber should be freed after use using gnutls_free(). privkey and
35 pubkey must be backed by the X.509 keys.
36
38 On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative er‐
39 ror value.
40
42 3.8.2
43
45 Report bugs to <bugs@gnutls.org>.
46 Home page: https://www.gnutls.org
47
48
50 Copyright © 2001-2023 Free Software Foundation, Inc., and others.
51 Copying and distribution of this file, with or without modification,
52 are permitted in any medium without royalty provided the copyright no‐
53 tice and this notice are preserved.
54
56 The full documentation for gnutls is maintained as a Texinfo manual.
57 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
58 visit
59
60 https://www.gnutls.org/manual/
61
62gnutls 3.8.2 gnutls_privkey_derive_secret(3)