]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/internal/man3/ossl_cmp_mock_srv_new.pod
Copyright year updates
[thirdparty/openssl.git] / doc / internal / man3 / ossl_cmp_mock_srv_new.pod
CommitLineData
62dcd2aa
DDO
1=pod
2
3=head1 NAME
4
5ossl_cmp_mock_srv_new,
6ossl_cmp_mock_srv_free,
b971d419 7ossl_cmp_mock_srv_set1_refCert,
62dcd2aa
DDO
8ossl_cmp_mock_srv_set1_certOut,
9ossl_cmp_mock_srv_set1_chainOut,
10ossl_cmp_mock_srv_set1_caPubsOut,
01b04851
DDO
11ossl_cmp_mock_srv_set1_newWithNew,
12ossl_cmp_mock_srv_set1_newWithOld,
13ossl_cmp_mock_srv_set1_oldWithNew,
62dcd2aa 14ossl_cmp_mock_srv_set_statusInfo,
6f88876d 15ossl_cmp_mock_srv_set_sendError,
62dcd2aa
DDO
16ossl_cmp_mock_srv_set_pollCount,
17ossl_cmp_mock_srv_set_checkAfterTime
18- functions used for testing with CMP mock server
19
20=head1 SYNOPSIS
21
1a7cd250 22 #include "apps/cmp_mock_srv.h"
62dcd2aa 23
b4250010 24 OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(OSSL_LIB_CTX *libctx, const char *propq);
62dcd2aa
DDO
25 void ossl_cmp_mock_srv_free(OSSL_CMP_SRV_CTX *srv_ctx);
26
01b04851
DDO
27 int ossl_cmp_mock_srv_set1_refCert(OSSL_CMP_SRV_CTX *ctx, const X509 *cert);
28 int ossl_cmp_mock_srv_set1_certOut(OSSL_CMP_SRV_CTX *ctx, const X509 *cert);
62dcd2aa 29 int ossl_cmp_mock_srv_set1_chainOut(OSSL_CMP_SRV_CTX *srv_ctx,
01b04851 30 const STACK_OF(X509) *chain);
62dcd2aa 31 int ossl_cmp_mock_srv_set1_caPubsOut(OSSL_CMP_SRV_CTX *srv_ctx,
01b04851
DDO
32 const STACK_OF(X509) *caPubs);
33 int ossl_cmp_mock_srv_set1_newWithNew(OSSL_CMP_SRV_CTX *ctx, const X509 *cert);
34 int ossl_cmp_mock_srv_set1_newWithOld(OSSL_CMP_SRV_CTX *ctx, const X509 *cert);
35 int ossl_cmp_mock_srv_set1_oldWithNew(OSSL_CMP_SRV_CTX *ctx, const X509 *cert);
62dcd2aa
DDO
36 int ossl_cmp_mock_srv_set_statusInfo(OSSL_CMP_SRV_CTX *srv_ctx, int status,
37 int fail_info, const char *text);
6f88876d 38 int ossl_cmp_mock_srv_set_sendError(OSSL_CMP_SRV_CTX *srv_ctx, int bodytype);
62dcd2aa
DDO
39 int ossl_cmp_mock_srv_set_pollCount(OSSL_CMP_SRV_CTX *srv_ctx, int count);
40 int ossl_cmp_mock_srv_set_checkAfterTime(OSSL_CMP_SRV_CTX *srv_ctx, int sec);
41
42=head1 DESCRIPTION
43
1a7cd250
DDO
44ossl_cmp_mock_srv_new() allocates the contexts for the CMP mock server
45associated with the library context I<libctx> and property query string
46I<propq>, both of which may be NULL to select the defaults.
62dcd2aa
DDO
47
48ossl_cmp_mock_srv_free() deallocates the contexts for the CMP mock server.
49
01b04851
DDO
50ossl_cmp_mock_srv_set1_refCert() sets the reference certificate (or NULL)
51to be expected for rr messages and for any oldCertID included in kur messages.
b971d419 52
01b04851
DDO
53ossl_cmp_mock_srv_set1_certOut() sets the certificate (or NULL)
54to be returned in cp/ip/kup messages.
b971d419
DDO
55Note that on each certificate request the mock server does not produce
56a fresh certificate but just returns the same pre-existing certificate.
62dcd2aa 57
01b04851
DDO
58ossl_cmp_mock_srv_set1_chainOut() sets the certificate chain (or NULL)
59to be added to the extraCerts in a cp/ip/kup message.
b971d419 60It should be useful for the validation of the certificate given via
a6e1e9eb 61ossl_cmp_mock_srv_set1_certOut().
62dcd2aa 62
01b04851
DDO
63ossl_cmp_mock_srv_set1_caPubsOut() sets list of certificates (or NULL) to be
64returned in the caPubs field an ip message and in a genp of infoType caCerts.
65
66ossl_cmp_mock_srv_set1_newWithNew() sets the value (which may be NULL)
67of the newWithNew field to be returned in a genp of infoType rootCaKeyUpdate.
68
69ossl_cmp_mock_srv_set1_newWithOld() sets the value (which may be NULL)
70of the newWithOld field to be returned in a genp of infoType rootCaKeyUpdate.
71
72ossl_cmp_mock_srv_set1_oldWithNew() sets the value (which may be NULL)
73of the oldWithNew field to be returned in a genp of infoType rootCaKeyUpdate.
62dcd2aa 74
a6e1e9eb 75ossl_cmp_mock_srv_set_statusInfo() sets the status info to be returned.
62dcd2aa 76
6f88876d
DDO
77ossl_cmp_mock_srv_set_sendError() enables enforcement of error responses
78for requests of the given I<bodytype>, or for all requests if I<bodytype> is 1.
79A I<bodytype> of -1 can be used to disable this feature, which is the default.
62dcd2aa 80
a6e1e9eb 81ossl_cmp_mock_srv_set_pollCount() sets the number of polls before cert response.
62dcd2aa 82
a6e1e9eb 83ossl_cmp_mock_srv_set_checkAfterTime() sets the number of seconds
62dcd2aa
DDO
84the client should wait for the next poll.
85
62dcd2aa
DDO
86=head1 NOTES
87
88CMP is defined in RFC 4210 (and CRMF in RFC 4211).
89
90=head1 RETURN VALUES
91
92ossl_cmp_mock_srv() returns a B<OSSL_CMP_SRV_CTX> structure on success,
93NULL on error.
94
95ossl_cmp_mock_srv_free() does not return a value.
96
97All other functions return 1 on success, 0 on error.
98
99=head1 HISTORY
100
101The OpenSSL CMP support was added in OpenSSL 3.0.
102
103=head1 COPYRIGHT
104
da1c088f 105Copyright 2007-2023 The OpenSSL Project Authors. All Rights Reserved.
62dcd2aa
DDO
106
107Licensed under the Apache License 2.0 (the "License"). You may not use
108this file except in compliance with the License. You can obtain a copy
109in the file LICENSE in the source distribution or at
110L<https://www.openssl.org/source/license.html>.
111
112=cut