Most TLS sessions make use of ephemeral DH parameters to effect the key exchange between the client and the server. These objects are created on the server side of a TLS session.
#include <x/gnutls/dhparams.H> #include <x/gnutls/pkparams.H> x::gnutls::dhparams dh(x::gnutls::dhparams::create()); dh->generate(2048); serverCert->set_dh_params(dh);
x::gnutls::dhparams
is a
reference to a
reference-counted object that represents
an ephemeral DH parameter.
x::gnutls::pkparams
is a reference to a generic superclass that implements the public
key parameter interface, for future extensibility, such as
generate
(), which generates a new parameter.
At this time, the only subclass is
x::gnutls::dhparams
; the temporary RSA parameter
implementation has been obsoleted.
get_pk_algorithm
() returns
GNUTLS_PK_DSA
,
that indicates the implementing subclass of
x::gnutls::pkparams
.