Blob Blame History Raw




@deftypefun {int} {gnutls_x509_trust_list_add_named_crt} (gnutls_x509_trust_list_t @var{list}, gnutls_x509_crt_t @var{cert}, const void * @var{name}, size_t @var{name_size}, unsigned int @var{flags})
@var{list}: The list

@var{cert}: A certificate

@var{name}: An identifier for the certificate

@var{name_size}: The size of the identifier

@var{flags}: should be 0.

This function will add the given certificate to the trusted
list and associate it with a name. The certificate will not be
be used for verification with @code{gnutls_x509_trust_list_verify_crt()} 
but with @code{gnutls_x509_trust_list_verify_named_crt()}  or
@code{gnutls_x509_trust_list_verify_crt2()}  - the latter only since
GnuTLS 3.4.0 and if a hostname is provided.

In principle this function can be used to set individual "server"
certificates that are trusted by the user for that specific server
but for no other purposes.

The certificate  @code{cert} must not be deinitialized during the lifetime
of the  @code{list} .

@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
negative error value.

@strong{Since:} 3.0.0
@end deftypefun