1
2
3
4
5@deftypefun {int} {gnutls_certificate_set_ocsp_status_request_mem} (gnutls_certificate_credentials_t @var{sc}, const gnutls_datum_t * @var{resp_data}, unsigned @var{idx}, gnutls_x509_crt_fmt_t @var{fmt})
6@var{sc}: is a credentials structure.
7
8@var{resp_data}: a memory buffer holding an OCSP response
9
10@var{idx}: is a certificate index as returned by @code{gnutls_certificate_set_key()}  and friends
11
12@var{fmt}: is PEM or DER
13
14This function sets the OCSP responses to be sent to the
15peer for the certificate chain specified by  @code{idx} . When  @code{fmt} is set
16to PEM, multiple responses can be loaded.
17
18@strong{Note:} the ability to set multiple OCSP responses per credential
19structure via the index  @code{idx} was added in version 3.5.6. To keep
20backwards compatibility, it requires using @code{gnutls_certificate_set_flags()}
21with the @code{GNUTLS_CERTIFICATE_API_V2}  flag to make the set certificate
22functions return an index usable by this function.
23
24This function must be called after setting any certificates, and
25cannot be used for certificates that are provided via a callback --
26that is when @code{gnutls_certificate_set_retrieve_function()}  is used.
27
28This function can be called multiple times when multiple responses which
29apply to the certificate chain are available.
30If the response provided does not match any certificates present
31in the chain, the code @code{GNUTLS_E_OCSP_MISMATCH_WITH_CERTS}  is returned.
32If the response is already expired at the time of loading the code
33@code{GNUTLS_E_EXPIRED}  is returned.
34
35@strong{Returns:} On success, the number of loaded responses is returned,
36otherwise a negative error code.
37
38@strong{Since:} 3.6.3
39@end deftypefun
40