Rename OPENSSL_CTX prefix to OSSL_LIB_CTX
[openssl.git] / doc / internal / man3 / ossl_cmp_mock_srv_new.pod
1 =pod
2
3 =head1 NAME
4
5 ossl_cmp_mock_srv_new,
6 ossl_cmp_mock_srv_free,
7 ossl_cmp_mock_srv_set1_certOut,
8 ossl_cmp_mock_srv_set1_chainOut,
9 ossl_cmp_mock_srv_set1_caPubsOut,
10 ossl_cmp_mock_srv_set_statusInfo,
11 ossl_cmp_mock_srv_set_send_error,
12 ossl_cmp_mock_srv_set_pollCount,
13 ossl_cmp_mock_srv_set_checkAfterTime
14 - functions used for testing with CMP mock server
15
16 =head1 SYNOPSIS
17
18  #include "apps/cmp_mock_srv.h"
19
20  OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(OSSL_LIB_CTX *libctx, const char *propq);
21  void ossl_cmp_mock_srv_free(OSSL_CMP_SRV_CTX *srv_ctx);
22
23  int ossl_cmp_mock_srv_set1_certOut(OSSL_CMP_SRV_CTX *srv_ctx, X509 *cert);
24  int ossl_cmp_mock_srv_set1_chainOut(OSSL_CMP_SRV_CTX *srv_ctx,
25                                      STACK_OF(X509) *chain);
26  int ossl_cmp_mock_srv_set1_caPubsOut(OSSL_CMP_SRV_CTX *srv_ctx,
27                                       STACK_OF(X509) *caPubs);
28  int ossl_cmp_mock_srv_set_statusInfo(OSSL_CMP_SRV_CTX *srv_ctx, int status,
29                                       int fail_info, const char *text);
30  int ossl_cmp_mock_srv_set_send_error(OSSL_CMP_SRV_CTX *srv_ctx, int val);
31  int ossl_cmp_mock_srv_set_pollCount(OSSL_CMP_SRV_CTX *srv_ctx, int count);
32  int ossl_cmp_mock_srv_set_checkAfterTime(OSSL_CMP_SRV_CTX *srv_ctx, int sec);
33
34 =head1 DESCRIPTION
35
36 ossl_cmp_mock_srv_new() allocates the contexts for the CMP mock server
37 associated with the library context I<libctx> and property query string
38 I<propq>, both of which may be NULL to select the defaults.
39
40 ossl_cmp_mock_srv_free() deallocates the contexts for the CMP mock server.
41
42 OSSL_CMP_SRV_CTX_set1_certOut() sets the certificate to be returned in
43 cp/ip/kup.
44
45 OSSL_CMP_SRV_CTX_set1_chainOut() sets the certificate chain to be added to
46 the extraCerts in a cp/ip/kup.
47 It should to useful to validate B<certOut>.
48
49 OSSL_CMP_SRV_CTX_set1_caPubsOut() sets the caPubs to be returned in an ip.
50
51 OSSL_CMP_SRV_CTX_set_statusInfo() sets the status info to be returned.
52
53 OSSL_CMP_SRV_CTX_set_send_error() enables enforcement of error responses.
54
55 OSSL_CMP_SRV_CTX_set_pollCount() sets the number of polls before cert response.
56
57 OSSL_CMP_SRV_CTX_set_checkAfterTime() sets the number of seconds
58 the client should wait for the next poll.
59
60
61 =head1 NOTES
62
63 CMP is defined in RFC 4210 (and CRMF in RFC 4211).
64
65 =head1 RETURN VALUES
66
67 ossl_cmp_mock_srv() returns a B<OSSL_CMP_SRV_CTX> structure on success,
68 NULL on error.
69
70 ossl_cmp_mock_srv_free() does not return a value.
71
72 All other functions return 1 on success, 0 on error.
73
74 =head1 HISTORY
75
76 The OpenSSL CMP support was added in OpenSSL 3.0.
77
78 =head1 COPYRIGHT
79
80 Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
81
82 Licensed under the Apache License 2.0 (the "License").  You may not use
83 this file except in compliance with the License.  You can obtain a copy
84 in the file LICENSE in the source distribution or at
85 L<https://www.openssl.org/source/license.html>.
86
87 =cut