1OSSL_CMP_MSG_GET0_HEADER(3ossl)     OpenSSL    OSSL_CMP_MSG_GET0_HEADER(3ossl)
2
3
4

NAME

6       OSSL_CMP_MSG_get0_header, OSSL_CMP_MSG_get_bodytype,
7       OSSL_CMP_MSG_update_transactionID, OSSL_CMP_CTX_setup_CRM,
8       OSSL_CMP_MSG_read, OSSL_CMP_MSG_write, d2i_OSSL_CMP_MSG_bio,
9       i2d_OSSL_CMP_MSG_bio - function(s) manipulating CMP messages
10

SYNOPSIS

12         #include <openssl/cmp.h>
13
14         OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg);
15         int OSSL_CMP_MSG_get_bodytype(const OSSL_CMP_MSG *msg);
16         int OSSL_CMP_MSG_update_transactionID(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg);
17         OSSL_CRMF_MSG *OSSL_CMP_CTX_setup_CRM(OSSL_CMP_CTX *ctx, int for_KUR, int rid);
18         OSSL_CMP_MSG *OSSL_CMP_MSG_read(const char *file, OSSL_LIB_CTX *libctx, const char *propq);
19         int OSSL_CMP_MSG_write(const char *file, const OSSL_CMP_MSG *msg);
20         OSSL_CMP_MSG *d2i_OSSL_CMP_MSG_bio(BIO *bio, OSSL_CMP_MSG **msg);
21         int i2d_OSSL_CMP_MSG_bio(BIO *bio, const OSSL_CMP_MSG *msg);
22

DESCRIPTION

24       OSSL_CMP_MSG_get0_header() returns the header of the given CMP message.
25
26       OSSL_CMP_MSG_get_bodytype() returns the body type of the given CMP
27       message.
28
29       OSSL_CMP_MSG_update_transactionID() updates the transactionID field in
30       the header of the given message according to the CMP_CTX.  This
31       requires re-protecting the message (if it was protected).
32
33       OSSL_CMP_CTX_setup_CRM() creates a CRMF certificate request message
34       from various information provided in the CMP context argument ctx for
35       inclusion in a CMP request message based on details contained in ctx.
36       The rid argument defines the request identifier to use, which typically
37       is 0.
38
39       The subject DN included in the certificate template is the first
40       available value of these:
41
42       any subject name in ctx set via OSSL_CMP_CTX_set1_subjectName(3),
43       the subject field of any PKCS#10 CSR is given in ctx, or
44       the subject field of any reference certificate given in ctx (see
45       OSSL_CMP_CTX_set1_oldCert(3)), if for_KUR is nonzero or the ctx does
46       not include a Subject Alternative Name.
47
48       The public key included is the first available value of these:
49
50       the public key derived from any key set via
51       OSSL_CMP_CTX_set0_newPkey(3),
52       the public key of any PKCS#10 CSR is given in ctx,
53       the public key of any reference certificate given in ctx, or
54       the public key derived from any client's private key set via
55       OSSL_CMP_CTX_set1_pkey(3).
56
57       The set of X.509 extensions to include is computed as follows.  If a
58       PKCS#10 CSR is present in ctx, default extensions are taken from there,
59       otherwise the empty set is taken as the initial value.  If there is a
60       reference certificate in ctx and contains Subject Alternative Names
61       (SANs) and OSSL_CMP_OPT_SUBJECTALTNAME_NODEFAULT is not set, these
62       override any SANs from the PKCS#10 CSR.  The extensions are further
63       augmented or overridden by any extensions with the same OIDs included
64       in the ctx via OSSL_CMP_CTX_set0_reqExtensions(3).  The SANs are
65       further overridden by any SANs included in ctx via
66       OSSL_CMP_CTX_push1_subjectAltName(3).  Finally, policies are overridden
67       by any policies included in ctx via OSSL_CMP_CTX_push0_policy(3).
68
69       OSSL_CMP_CTX_setup_CRM() also sets the sets the regToken control
70       oldCertID for KUR messages using the issuer name and serial number of
71       the reference certificate, if present.
72
73       OSSL_CMP_MSG_read() loads a DER-encoded OSSL_CMP_MSG from file.
74
75       OSSL_CMP_MSG_write() stores the given OSSL_CMP_MSG to file in DER
76       encoding.
77
78       d2i_OSSL_CMP_MSG_bio() parses an ASN.1-encoded OSSL_CMP_MSG from the
79       BIO bio.  It assigns a pointer to the new structure to *msg if msg is
80       not NULL.
81
82       i2d_OSSL_CMP_MSG_bio() writes the OSSL_CMP_MSG msg in ASN.1 encoding to
83       BIO bio.
84

NOTES

86       CMP is defined in RFC 4210.
87

RETURN VALUES

89       OSSL_CMP_MSG_get0_header() returns the intended pointer value as
90       described above or NULL if the respective entry does not exist and on
91       error.
92
93       OSSL_CMP_MSG_get_bodytype() returns the body type or -1 on error.
94
95       OSSL_CMP_CTX_setup_CRM() returns a pointer to a OSSL_CRMF_MSG on
96       success, NULL on error.
97
98       d2i_OSSL_CMP_MSG_bio() returns the parsed message or NULL on error.
99
100       OSSL_CMP_MSG_read() and d2i_OSSL_CMP_MSG_bio() return the parsed CMP
101       message or NULL on error.
102
103       OSSL_CMP_MSG_write() and i2d_OSSL_CMP_MSG_bio() return the number of
104       bytes successfully encoded or a negative value if an error occurs.
105
106       OSSL_CMP_MSG_update_transactionID() returns 1 on success, 0 on error.
107

HISTORY

109       The OpenSSL CMP support was added in OpenSSL 3.0.
110
112       Copyright 2007-2022 The OpenSSL Project Authors. All Rights Reserved.
113
114       Licensed under the Apache License 2.0 (the "License").  You may not use
115       this file except in compliance with the License.  You can obtain a copy
116       in the file LICENSE in the source distribution or at
117       <https://www.openssl.org/source/license.html>.
118
119
120
1213.0.5                             2022-07-05   OSSL_CMP_MSG_GET0_HEADER(3ossl)
Impressum