1=pod
2
3=head1 NAME
4
5OSSL_CRMF_MSG_get0_regCtrl_regToken,
6OSSL_CRMF_MSG_set1_regCtrl_regToken,
7OSSL_CRMF_MSG_get0_regCtrl_authenticator,
8OSSL_CRMF_MSG_set1_regCtrl_authenticator,
9OSSL_CRMF_MSG_PKIPublicationInfo_push0_SinglePubInfo,
10OSSL_CRMF_MSG_set0_SinglePubInfo,
11OSSL_CRMF_MSG_set_PKIPublicationInfo_action,
12OSSL_CRMF_MSG_get0_regCtrl_pkiPublicationInfo,
13OSSL_CRMF_MSG_set1_regCtrl_pkiPublicationInfo,
14OSSL_CRMF_MSG_get0_regCtrl_protocolEncrKey,
15OSSL_CRMF_MSG_set1_regCtrl_protocolEncrKey,
16OSSL_CRMF_MSG_get0_regCtrl_oldCertID,
17OSSL_CRMF_MSG_set1_regCtrl_oldCertID,
18OSSL_CRMF_CERTID_gen
19- functions getting or setting CRMF Registration Controls
20
21=head1 SYNOPSIS
22
23 #include <openssl/crmf.h>
24
25 ASN1_UTF8STRING
26    *OSSL_CRMF_MSG_get0_regCtrl_regToken(const OSSL_CRMF_MSG *msg);
27 int OSSL_CRMF_MSG_set1_regCtrl_regToken(OSSL_CRMF_MSG *msg,
28                                         const ASN1_UTF8STRING *tok);
29 ASN1_UTF8STRING
30    *OSSL_CRMF_MSG_get0_regCtrl_authenticator(const OSSL_CRMF_MSG *msg);
31 int OSSL_CRMF_MSG_set1_regCtrl_authenticator(OSSL_CRMF_MSG *msg,
32                                              const ASN1_UTF8STRING *auth);
33 int OSSL_CRMF_MSG_PKIPublicationInfo_push0_SinglePubInfo(
34                                  OSSL_CRMF_PKIPUBLICATIONINFO *pi,
35                                  OSSL_CRMF_SINGLEPUBINFO *spi);
36 int OSSL_CRMF_MSG_set0_SinglePubInfo(OSSL_CRMF_SINGLEPUBINFO *spi,
37                                      int method, GENERAL_NAME *nm);
38 int OSSL_CRMF_MSG_set_PKIPublicationInfo_action(
39                                  OSSL_CRMF_PKIPUBLICATIONINFO *pi, int action);
40 OSSL_CRMF_PKIPUBLICATIONINFO
41    *OSSL_CRMF_MSG_get0_regCtrl_pkiPublicationInfo(const OSSL_CRMF_MSG *msg);
42 int OSSL_CRMF_MSG_set1_regCtrl_pkiPublicationInfo(OSSL_CRMF_MSG *msg,
43                                        const OSSL_CRMF_PKIPUBLICATIONINFO *pi);
44 X509_PUBKEY
45    *OSSL_CRMF_MSG_get0_regCtrl_protocolEncrKey(const OSSL_CRMF_MSG *msg);
46 int OSSL_CRMF_MSG_set1_regCtrl_protocolEncrKey(OSSL_CRMF_MSG *msg,
47                                                const X509_PUBKEY *pubkey);
48 OSSL_CRMF_CERTID
49    *OSSL_CRMF_MSG_get0_regCtrl_oldCertID(const OSSL_CRMF_MSG *msg);
50 int OSSL_CRMF_MSG_set1_regCtrl_oldCertID(OSSL_CRMF_MSG *msg,
51                                          const OSSL_CRMF_CERTID *cid);
52 OSSL_CRMF_CERTID *OSSL_CRMF_CERTID_gen(const X509_NAME *issuer,
53                                        const ASN1_INTEGER *serial);
54
55=head1 DESCRIPTION
56
57Each of the OSSL_CRMF_MSG_get0_regCtrl_X() functions
58returns the respective control X in the given I<msg>, if present.
59
60OSSL_CRMF_MSG_set1_regCtrl_regToken() sets the regToken control in the given
61I<msg> copying the given I<tok> as value. See RFC 4211, section 6.1.
62
63OSSL_CRMF_MSG_set1_regCtrl_authenticator() sets the authenticator control in
64the given I<msg> copying the given I<auth> as value. See RFC 4211, section 6.2.
65
66OSSL_CRMF_MSG_PKIPublicationInfo_push0_SinglePubInfo() pushes the given I<spi>
67to I<si>. Consumes the I<spi> pointer.
68
69OSSL_CRMF_MSG_set0_SinglePubInfo() sets in the given SinglePubInfo I<spi>
70the I<method> and publication location, in the form of a GeneralName, I<nm>.
71The publication location is optional, and therefore I<nm> may be NULL.
72The function consumes the I<nm> pointer if present.
73Available methods are:
74 # define OSSL_CRMF_PUB_METHOD_DONTCARE 0
75 # define OSSL_CRMF_PUB_METHOD_X500     1
76 # define OSSL_CRMF_PUB_METHOD_WEB      2
77 # define OSSL_CRMF_PUB_METHOD_LDAP     3
78
79OSSL_CRMF_MSG_set_PKIPublicationInfo_action() sets the action in the given I<pi>
80using the given I<action> as value. See RFC 4211, section 6.3.
81Available actions are:
82 # define OSSL_CRMF_PUB_ACTION_DONTPUBLISH   0
83 # define OSSL_CRMF_PUB_ACTION_PLEASEPUBLISH 1
84
85OSSL_CRMF_MSG_set1_regCtrl_pkiPublicationInfo() sets the pkiPublicationInfo
86control in the given I<msg> copying the given I<tok> as value. See RFC 4211,
87section 6.3.
88
89OSSL_CRMF_MSG_set1_regCtrl_protocolEncrKey() sets the protocolEncrKey control in
90the given I<msg> copying the given I<pubkey> as value. See RFC 4211 section 6.6.
91
92OSSL_CRMF_MSG_set1_regCtrl_oldCertID() sets the B<oldCertID> regToken control in
93the given I<msg> copying the given I<cid> as value. See RFC 4211, section 6.5.
94
95OSSL_CRMF_CERTID_gen produces an OSSL_CRMF_CERTID_gen structure copying the
96given I<issuer> name and I<serial> number.
97
98=head1 RETURN VALUES
99
100All OSSL_CRMF_MSG_get0_*() functions
101return the respective pointer value or NULL if not present and on error.
102
103All OSSL_CRMF_MSG_set1_*() functions return 1 on success, 0 on error.
104
105OSSL_CRMF_CERTID_gen() returns a pointer to the resulting structure
106or NULL on error.
107
108=head1 NOTES
109
110A function OSSL_CRMF_MSG_set1_regCtrl_pkiArchiveOptions() for setting an
111Archive Options Control is not yet implemented due to missing features to
112create the needed OSSL_CRMF_PKIARCHIVEOPTINS content.
113
114=head1 SEE ALSO
115
116RFC 4211
117
118=head1 HISTORY
119
120The OpenSSL CRMF support was added in OpenSSL 3.0.
121
122=head1 COPYRIGHT
123
124Copyright 2007-2022 The OpenSSL Project Authors. All Rights Reserved.
125
126Licensed under the Apache License 2.0 (the "License").  You may not use
127this file except in compliance with the License.  You can obtain a copy
128in the file LICENSE in the source distribution or at
129L<https://www.openssl.org/source/license.html>.
130
131=cut
132