Sets the needed credentials for the specified type. E.g.
username, password - or public and private keys etc. The cred
parameter is a structure that depends on the specified type and
on the current session (client or server).
In order to minimize memory usage, and share credentials between
several threads gnutls keeps a pointer to cred, and not the whole
cred structure. Thus you will have to keep the structure
allocated until you call gnutls_deinit().
For GNUTLS_CRD_ANON, cred should be
gnutls_anon_client_credentials_t in case of a client. In case of
a server it should be gnutls_anon_server_credentials_t.
For GNUTLS_CRD_SRP, cred should be
gnutls_srp_client_credentials_t in case of a client, and
gnutls_srp_server_credentials_t, in case of a server.
For GNUTLS_CRD_CERTIFICATE, cred should be
This page is part of the GnuTLS (GnuTLS Transport Layer Security
Library) project. Information about the project can be found at
⟨http://www.gnutls.org/⟩. If you have a bug report for this
manual page, send it to email@example.com. This page was obtained
from the tarball gnutls-3.7.1.tar.xz fetched from
⟨http://www.gnutls.org/download.html⟩ on 2021-04-01. If you
discover any rendering problems in this HTML version of the page,
or you believe there is a better or more up-to-date source for
the page, or you have corrections or improvements to the
information in this COLOPHON (which is not part of the original
manual page), send a mail to firstname.lastname@example.org
gnutls 3.7.1 gnutls_credentials_set(3)