| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "OSSL_CMP_MSG_GET0_HEADER 3SSL" |
| 58 |
.TH OSSL_CMP_MSG_GET0_HEADER 3SSL 2026-04-07 3.6.2 OpenSSL |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
OSSL_CMP_MSG_get0_header, |
| 65 |
OSSL_CMP_MSG_get_bodytype, |
| 66 |
OSSL_CMP_MSG_get0_certreq_publickey, |
| 67 |
OSSL_CMP_MSG_update_transactionID, |
| 68 |
OSSL_CMP_MSG_update_recipNonce, |
| 69 |
OSSL_CMP_CTX_setup_CRM, |
| 70 |
OSSL_CMP_MSG_read, |
| 71 |
OSSL_CMP_MSG_write, |
| 72 |
d2i_OSSL_CMP_MSG_bio, |
| 73 |
i2d_OSSL_CMP_MSG_bio |
| 74 |
\&\- function(s) manipulating CMP messages |
| 75 |
.SH SYNOPSIS |
| 76 |
.IX Header "SYNOPSIS" |
| 77 |
.Vb 1 |
| 78 |
\& #include <openssl/cmp.h> |
| 79 |
\& |
| 80 |
\& OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg); |
| 81 |
\& int OSSL_CMP_MSG_get_bodytype(const OSSL_CMP_MSG *msg); |
| 82 |
\& X509_PUBKEY *OSSL_CMP_MSG_get0_certreq_publickey(const OSSL_CMP_MSG *msg); |
| 83 |
\& int OSSL_CMP_MSG_update_transactionID(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg); |
| 84 |
\& int OSSL_CMP_MSG_update_recipNonce(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg); |
| 85 |
\& OSSL_CRMF_MSG *OSSL_CMP_CTX_setup_CRM(OSSL_CMP_CTX *ctx, int for_KUR, int rid); |
| 86 |
\& OSSL_CMP_MSG *OSSL_CMP_MSG_read(const char *file, OSSL_LIB_CTX *libctx, const char *propq); |
| 87 |
\& int OSSL_CMP_MSG_write(const char *file, const OSSL_CMP_MSG *msg); |
| 88 |
\& OSSL_CMP_MSG *d2i_OSSL_CMP_MSG_bio(BIO *bio, OSSL_CMP_MSG **msg); |
| 89 |
\& int i2d_OSSL_CMP_MSG_bio(BIO *bio, const OSSL_CMP_MSG *msg); |
| 90 |
.Ve |
| 91 |
.SH DESCRIPTION |
| 92 |
.IX Header "DESCRIPTION" |
| 93 |
\&\fBOSSL_CMP_MSG_get0_header()\fR returns the header of the given CMP message. |
| 94 |
.PP |
| 95 |
\&\fBOSSL_CMP_MSG_get_bodytype()\fR returns the body type of the given CMP message. |
| 96 |
.PP |
| 97 |
\&\fBOSSL_CMP_MSG_get0_certreq_publickey()\fR expects that \fImsg\fR is a certificate request |
| 98 |
message and returns the public key in its certificate template if present. |
| 99 |
.PP |
| 100 |
\&\fBOSSL_CMP_MSG_update_transactionID()\fR updates the transactionID field |
| 101 |
in the header of the given message according to the CMP_CTX. |
| 102 |
If \fIctx\fR does not contain a transaction ID, a fresh one is created before. |
| 103 |
The message gets re-protected (if protecting requests is required). |
| 104 |
.PP |
| 105 |
\&\fBOSSL_CMP_MSG_update_recipNonce()\fR updates the recipNonce field |
| 106 |
in the header of the given message according to the CMP_CTX. |
| 107 |
The message gets re-protected (if protecting requests is required). |
| 108 |
.PP |
| 109 |
\&\fBOSSL_CMP_CTX_setup_CRM()\fR creates a CRMF certificate request message |
| 110 |
from various information provided in the CMP context argument \fIctx\fR |
| 111 |
for inclusion in a CMP request message based on details contained in \fIctx\fR. |
| 112 |
The \fIrid\fR argument defines the request identifier to use, which typically is 0. |
| 113 |
.PP |
| 114 |
The subject DN included in the certificate template is |
| 115 |
the first available value of these: |
| 116 |
.IP "any subject name in \fIctx\fR set via \fBOSSL_CMP_CTX_set1_subjectName\fR\|(3) \- if it is the NULL-DN (i.e., any empty sequence of RDNs), no subject is included," 4 |
| 117 |
.IX Item "any subject name in ctx set via OSSL_CMP_CTX_set1_subjectName - if it is the NULL-DN (i.e., any empty sequence of RDNs), no subject is included," |
| 118 |
.PD 0 |
| 119 |
.IP "the subject field of any PKCS#10 CSR set in \fIctx\fR via \fBOSSL_CMP_CTX_set1_p10CSR\fR\|(3)," 4 |
| 120 |
.IX Item "the subject field of any PKCS#10 CSR set in ctx via OSSL_CMP_CTX_set1_p10CSR," |
| 121 |
.IP "the subject field of any reference certificate given in \fIctx\fR (see \fBOSSL_CMP_CTX_set1_oldCert\fR\|(3)), but only if \fIfor_KUR\fR is nonzero or the \fIctx\fR does not include a Subject Alternative Name." 4 |
| 122 |
.IX Item "the subject field of any reference certificate given in ctx (see OSSL_CMP_CTX_set1_oldCert), but only if for_KUR is nonzero or the ctx does not include a Subject Alternative Name." |
| 123 |
.PD |
| 124 |
.PP |
| 125 |
The public key included is the first available value of these: |
| 126 |
.IP "the public key derived from any key set via \fBOSSL_CMP_CTX_set0_newPkey\fR\|(3)," 4 |
| 127 |
.IX Item "the public key derived from any key set via OSSL_CMP_CTX_set0_newPkey," |
| 128 |
.PD 0 |
| 129 |
.IP "the public key of any PKCS#10 CSR given in \fIctx\fR," 4 |
| 130 |
.IX Item "the public key of any PKCS#10 CSR given in ctx," |
| 131 |
.IP "the public key of any reference certificate given in \fIctx\fR (see \fBOSSL_CMP_CTX_set1_oldCert\fR\|(3))," 4 |
| 132 |
.IX Item "the public key of any reference certificate given in ctx (see OSSL_CMP_CTX_set1_oldCert)," |
| 133 |
.IP "the public key derived from any client's private key set via \fBOSSL_CMP_CTX_set1_pkey\fR\|(3)." 4 |
| 134 |
.IX Item "the public key derived from any client's private key set via OSSL_CMP_CTX_set1_pkey." |
| 135 |
.PD |
| 136 |
.PP |
| 137 |
The set of X.509 extensions to include is computed as follows. |
| 138 |
If a PKCS#10 CSR is present in \fIctx\fR, default extensions are taken from there, |
| 139 |
otherwise the empty set is taken as the initial value. |
| 140 |
If there is a reference certificate in \fIctx\fR and contains Subject Alternative |
| 141 |
Names (SANs) and \fBOSSL_CMP_OPT_SUBJECTALTNAME_NODEFAULT\fR is not set, |
| 142 |
these override any SANs from the PKCS#10 CSR. |
| 143 |
The extensions are further augmented or overridden by any extensions with the |
| 144 |
same OIDs included in the \fIctx\fR via \fBOSSL_CMP_CTX_set0_reqExtensions\fR\|(3). |
| 145 |
The SANs are further overridden by any SANs included in \fIctx\fR via |
| 146 |
\&\fBOSSL_CMP_CTX_push1_subjectAltName\fR\|(3). |
| 147 |
Finally, policies are overridden by any policies included in \fIctx\fR via |
| 148 |
\&\fBOSSL_CMP_CTX_push0_policy\fR\|(3). |
| 149 |
.PP |
| 150 |
\&\fBOSSL_CMP_CTX_setup_CRM()\fR also sets the sets the regToken control \fBoldCertID\fR |
| 151 |
for KUR messages using the issuer name and serial number of the reference |
| 152 |
certificate, if present. |
| 153 |
.PP |
| 154 |
\&\fBOSSL_CMP_MSG_read()\fR loads a DER-encoded OSSL_CMP_MSG from \fIfile\fR. |
| 155 |
.PP |
| 156 |
\&\fBOSSL_CMP_MSG_write()\fR stores the given OSSL_CMP_MSG to \fIfile\fR in DER encoding. |
| 157 |
.PP |
| 158 |
\&\fBd2i_OSSL_CMP_MSG_bio()\fR parses an ASN.1\-encoded OSSL_CMP_MSG from the BIO \fIbio\fR. |
| 159 |
It assigns a pointer to the new structure to \fI*msg\fR if \fImsg\fR is not NULL. |
| 160 |
.PP |
| 161 |
\&\fBi2d_OSSL_CMP_MSG_bio()\fR writes the OSSL_CMP_MSG \fImsg\fR in ASN.1 encoding |
| 162 |
to BIO \fIbio\fR. |
| 163 |
.SH NOTES |
| 164 |
.IX Header "NOTES" |
| 165 |
CMP is defined in RFC 9810. |
| 166 |
.SH "RETURN VALUES" |
| 167 |
.IX Header "RETURN VALUES" |
| 168 |
\&\fBOSSL_CMP_MSG_get0_header()\fR returns the intended pointer value as described above |
| 169 |
or NULL if the respective entry does not exist and on error. |
| 170 |
.PP |
| 171 |
\&\fBOSSL_CMP_MSG_get_bodytype()\fR returns the body type or \-1 on error. |
| 172 |
.PP |
| 173 |
\&\fBOSSL_CMP_MSG_get0_certreq_publickey()\fR returns a public key or NULL on error. |
| 174 |
.PP |
| 175 |
\&\fBOSSL_CMP_CTX_setup_CRM()\fR returns a pointer to a \fBOSSL_CRMF_MSG\fR on success, |
| 176 |
NULL on error. |
| 177 |
.PP |
| 178 |
\&\fBd2i_OSSL_CMP_MSG_bio()\fR returns the parsed message or NULL on error. |
| 179 |
.PP |
| 180 |
\&\fBOSSL_CMP_MSG_read()\fR and \fBd2i_OSSL_CMP_MSG_bio()\fR |
| 181 |
return the parsed CMP message or NULL on error. |
| 182 |
.PP |
| 183 |
\&\fBOSSL_CMP_MSG_write()\fR returns the number of bytes successfully encoded or a |
| 184 |
negative value if an error occurs. |
| 185 |
.PP |
| 186 |
\&\fBi2d_OSSL_CMP_MSG_bio()\fR, \fBOSSL_CMP_MSG_update_transactionID()\fR, |
| 187 |
and \fBOSSL_CMP_MSG_update_recipNonce()\fR |
| 188 |
return 1 on success, 0 on error. |
| 189 |
.SH "SEE ALSO" |
| 190 |
.IX Header "SEE ALSO" |
| 191 |
\&\fBOSSL_CMP_CTX_set1_subjectName\fR\|(3), \fBOSSL_CMP_CTX_set1_p10CSR\fR\|(3), |
| 192 |
\&\fBOSSL_CMP_CTX_set1_oldCert\fR\|(3), \fBOSSL_CMP_CTX_set0_newPkey\fR\|(3), |
| 193 |
\&\fBOSSL_CMP_CTX_set1_pkey\fR\|(3), \fBOSSL_CMP_CTX_set0_reqExtensions\fR\|(3), |
| 194 |
\&\fBOSSL_CMP_CTX_push1_subjectAltName\fR\|(3), \fBOSSL_CMP_CTX_push0_policy\fR\|(3) |
| 195 |
.SH HISTORY |
| 196 |
.IX Header "HISTORY" |
| 197 |
The OpenSSL CMP support was added in OpenSSL 3.0. |
| 198 |
.PP |
| 199 |
\&\fBOSSL_CMP_MSG_update_recipNonce()\fR was added in OpenSSL 3.0.9. |
| 200 |
.PP |
| 201 |
\&\fBOSSL_CMP_MSG_get0_certreq_publickey()\fR was added in OpenSSL 3.3. |
| 202 |
.SH COPYRIGHT |
| 203 |
.IX Header "COPYRIGHT" |
| 204 |
Copyright 2007\-2024 The OpenSSL Project Authors. All Rights Reserved. |
| 205 |
.PP |
| 206 |
Licensed under the Apache License 2.0 (the "License"). You may not use |
| 207 |
this file except in compliance with the License. You can obtain a copy |
| 208 |
in the file LICENSE in the source distribution or at |
| 209 |
<https://www.openssl.org/source/license.html>. |