



@deftypefun {gnutls_certificate_type_t} {gnutls_certificate_type_get2} (gnutls_session_t @var{session}, gnutls_ctype_target_t @var{target})
@var{session}: is a @code{gnutls_session_t}  type.

@var{target}: is a @code{gnutls_ctype_target_t}  type.

The raw public-key extension (RFC7250) introduces a mechanism
to specifcy different certificate types for the client and server. We
therefore distinguish between negotiated certificate types for the
client and server. The  @code{target} parameter specifies whether you want
the negotiated certificate type for the client (GNUTLS_CTYPE_CLIENT)
or for the server (GNUTLS_CTYPE_SERVER). Additionally, in P2P mode
connection set up where you don't know in advance who will be client
and who will be server you can use the flag (GNUTLS_CTYPE_OURS) and
(GNUTLS_CTYPE_PEERS) to retrieve the corresponding certificate types.

In case no certificate types were explicitly set via the priority
strings to be negotiated during the handshake, then this function
will return the default certificate type (X.509) for both the
client and the server.

@strong{Returns:} the currently used @code{gnutls_certificate_type_t}  certificate
type for the client or the server.

@strong{Since:} 3.6.4
@end deftypefun
