blob: 08e585f3f39e636ec6e4926c3c98b411aaee50e9 [file] [log] [blame]
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001/**
Simon Butcher5b331b92016-01-03 16:14:14 +00002 * \file x509_csr.h
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003 *
4 * \brief X.509 certificate signing request parsing and writing
Darryl Greena40a1012018-01-05 15:33:17 +00005 */
6/*
Bence Szépkúti1e148272020-08-07 13:07:28 +02007 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +00008 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Paul Bakker7c6b2c32013-09-16 13:49:26 +02009 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020010#ifndef MBEDTLS_X509_CSR_H
11#define MBEDTLS_X509_CSR_H
Mateusz Starzyk846f0212021-05-19 19:44:07 +020012#include "mbedtls/private_access.h"
Paul Bakker7c6b2c32013-09-16 13:49:26 +020013
Bence Szépkútic662b362021-05-27 11:25:03 +020014#include "mbedtls/build_info.h"
Paul Bakker7c6b2c32013-09-16 13:49:26 +020015
Jaeden Amero6609aef2019-07-04 20:01:14 +010016#include "mbedtls/x509.h"
Paul Bakker7c6b2c32013-09-16 13:49:26 +020017
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22/**
23 * \addtogroup x509_module
24 * \{ */
25
26/**
27 * \name Structures and functions for X.509 Certificate Signing Requests (CSR)
28 * \{
29 */
30
31/**
32 * Certificate Signing Request (CSR) structure.
Gilles Peskine842edf42021-08-04 21:56:10 +020033 *
34 * Some fields of this structure are publicly readable. Do not modify
35 * them except via Mbed TLS library functions: the effect of modifying
Gilles Peskine44ffc792021-08-31 22:59:35 +020036 * those fields or the data that those fields point to is unspecified.
Paul Bakker7c6b2c32013-09-16 13:49:26 +020037 */
Gilles Peskine449bd832023-01-11 14:50:10 +010038typedef struct mbedtls_x509_csr {
Gilles Peskine842edf42021-08-04 21:56:10 +020039 mbedtls_x509_buf raw; /**< The raw CSR data (DER). */
40 mbedtls_x509_buf cri; /**< The raw CertificateRequestInfo body (DER). */
Paul Bakker7c6b2c32013-09-16 13:49:26 +020041
Gilles Peskine842edf42021-08-04 21:56:10 +020042 int version; /**< CSR version (1=v1). */
Paul Bakker7c6b2c32013-09-16 13:49:26 +020043
Gilles Peskine842edf42021-08-04 21:56:10 +020044 mbedtls_x509_buf subject_raw; /**< The raw subject data (DER). */
45 mbedtls_x509_name subject; /**< The parsed subject data (named information object). */
Paul Bakker7c6b2c32013-09-16 13:49:26 +020046
Gilles Peskine842edf42021-08-04 21:56:10 +020047 mbedtls_pk_context pk; /**< Container for the public key context. */
Paul Bakker7c6b2c32013-09-16 13:49:26 +020048
Jens Alfke2d9e3592019-10-29 15:03:37 -070049 unsigned int key_usage; /**< Optional key usage extension value: See the values in x509.h */
50 unsigned char ns_cert_type; /**< Optional Netscape certificate type extension value: See the values in x509.h */
Andrzej Kurek17473042023-04-30 14:11:23 -040051 mbedtls_x509_sequence subject_alt_names; /**< Optional list of raw entries of Subject Alternative Names extension. These can be later parsed by mbedtls_x509_parse_subject_alt_name. */
Jens Alfke2d9e3592019-10-29 15:03:37 -070052
Przemek Stekielcbaf3162023-01-12 12:58:02 +010053 int MBEDTLS_PRIVATE(ext_types); /**< Bit string containing detected and parsed extensions */
54
Gilles Peskine842edf42021-08-04 21:56:10 +020055 mbedtls_x509_buf sig_oid;
Mateusz Starzyk846f0212021-05-19 19:44:07 +020056 mbedtls_x509_buf MBEDTLS_PRIVATE(sig);
57 mbedtls_md_type_t MBEDTLS_PRIVATE(sig_md); /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */
58 mbedtls_pk_type_t MBEDTLS_PRIVATE(sig_pk); /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */
59 void *MBEDTLS_PRIVATE(sig_opts); /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */
Paul Bakker7c6b2c32013-09-16 13:49:26 +020060}
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020061mbedtls_x509_csr;
Paul Bakker7c6b2c32013-09-16 13:49:26 +020062
63/**
64 * Container for writing a CSR
65 */
Gilles Peskine449bd832023-01-11 14:50:10 +010066typedef struct mbedtls_x509write_csr {
Mateusz Starzyk846f0212021-05-19 19:44:07 +020067 mbedtls_pk_context *MBEDTLS_PRIVATE(key);
68 mbedtls_asn1_named_data *MBEDTLS_PRIVATE(subject);
69 mbedtls_md_type_t MBEDTLS_PRIVATE(md_alg);
70 mbedtls_asn1_named_data *MBEDTLS_PRIVATE(extensions);
Paul Bakker7c6b2c32013-09-16 13:49:26 +020071}
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020072mbedtls_x509write_csr;
Paul Bakker7c6b2c32013-09-16 13:49:26 +020073
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020074#if defined(MBEDTLS_X509_CSR_PARSE_C)
Paul Bakker7c6b2c32013-09-16 13:49:26 +020075/**
Manuel Pégourié-Gonnardf3b47242014-06-16 18:06:48 +020076 * \brief Load a Certificate Signing Request (CSR) in DER format
77 *
Matthias Schulzc55b5002023-11-07 16:47:37 +010078 * \note Any unsupported requested extensions are silently
79 * ignored, unless the critical flag is set, in which case
80 * the CSR is rejected.
Manuel Pégourié-Gonnard986bbf22016-02-24 14:36:05 +000081 *
Janos Follath582ecd02024-11-19 16:17:07 +000082 * \note The PSA crypto subsystem must have been initialized by
83 * calling psa_crypto_init() before calling this function.
Gilles Peskine5b7e1642022-08-04 23:44:59 +020084 *
Manuel Pégourié-Gonnardf3b47242014-06-16 18:06:48 +020085 * \param csr CSR context to fill
86 * \param buf buffer holding the CRL data
87 * \param buflen size of the buffer
88 *
89 * \return 0 if successful, or a specific X509 error code
90 */
Gilles Peskine449bd832023-01-11 14:50:10 +010091int mbedtls_x509_csr_parse_der(mbedtls_x509_csr *csr,
92 const unsigned char *buf, size_t buflen);
Manuel Pégourié-Gonnardf3b47242014-06-16 18:06:48 +020093
94/**
Matthias Schulzab408222023-10-18 13:20:59 +020095 * \brief The type of certificate extension callbacks.
96 *
97 * Callbacks of this type are passed to and used by the
98 * mbedtls_x509_csr_parse_der_with_ext_cb() routine when
99 * it encounters either an unsupported extension.
100 * Future versions of the library may invoke the callback
101 * in other cases, if and when the need arises.
102 *
103 * \param p_ctx An opaque context passed to the callback.
104 * \param csr The CSR being parsed.
105 * \param oid The OID of the extension.
106 * \param critical Whether the extension is critical.
107 * \param p Pointer to the start of the extension value
108 * (the content of the OCTET STRING).
109 * \param end End of extension value.
110 *
111 * \note The callback must fail and return a negative error code
112 * if it can not parse or does not support the extension.
113 * When the callback fails to parse a critical extension
114 * mbedtls_x509_csr_parse_der_with_ext_cb() also fails.
115 * When the callback fails to parse a non critical extension
116 * mbedtls_x509_csr_parse_der_with_ext_cb() simply skips
117 * the extension and continues parsing.
118 *
119 * \return \c 0 on success.
120 * \return A negative error code on failure.
121 */
122typedef int (*mbedtls_x509_csr_ext_cb_t)(void *p_ctx,
123 mbedtls_x509_csr const *csr,
124 mbedtls_x509_buf const *oid,
125 int critical,
126 const unsigned char *p,
127 const unsigned char *end);
128
129/**
130 * \brief Load a Certificate Signing Request (CSR) in DER format
131 *
Matthias Schulzc55b5002023-11-07 16:47:37 +0100132 * \note Any unsupported requested extensions are silently
133 * ignored, unless the critical flag is set, in which case
134 * the result of the callback function decides whether
135 * CSR is rejected.
Matthias Schulzab408222023-10-18 13:20:59 +0200136 *
Janos Follath582ecd02024-11-19 16:17:07 +0000137 * \note The PSA crypto subsystem must have been initialized by
138 * calling psa_crypto_init() before calling this function.
Matthias Schulzab408222023-10-18 13:20:59 +0200139 *
140 * \param csr CSR context to fill
141 * \param buf buffer holding the CRL data
142 * \param buflen size of the buffer
143 * \param cb A callback invoked for every unsupported certificate
144 * extension.
145 * \param p_ctx An opaque context passed to the callback.
146 *
147 * \return 0 if successful, or a specific X509 error code
148 */
149int mbedtls_x509_csr_parse_der_with_ext_cb(mbedtls_x509_csr *csr,
Matthias Schulzedc32ea2023-10-19 16:09:08 +0200150 const unsigned char *buf, size_t buflen,
151 mbedtls_x509_csr_ext_cb_t cb,
152 void *p_ctx);
Matthias Schulzab408222023-10-18 13:20:59 +0200153
154/**
Manuel Pégourié-Gonnardf3b47242014-06-16 18:06:48 +0200155 * \brief Load a Certificate Signing Request (CSR), DER or PEM format
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200156 *
Manuel Pégourié-Gonnard986bbf22016-02-24 14:36:05 +0000157 * \note See notes for \c mbedtls_x509_csr_parse_der()
158 *
Janos Follath582ecd02024-11-19 16:17:07 +0000159 * \note The PSA crypto subsystem must have been initialized by
160 * calling psa_crypto_init() before calling this function.
Gilles Peskine5b7e1642022-08-04 23:44:59 +0200161 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200162 * \param csr CSR context to fill
163 * \param buf buffer holding the CRL data
164 * \param buflen size of the buffer
Manuel Pégourié-Gonnard43b37cb2015-05-12 11:20:10 +0200165 * (including the terminating null byte for PEM data)
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200166 *
167 * \return 0 if successful, or a specific X509 or PEM error code
168 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100169int mbedtls_x509_csr_parse(mbedtls_x509_csr *csr, const unsigned char *buf, size_t buflen);
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200170
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200171#if defined(MBEDTLS_FS_IO)
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200172/**
173 * \brief Load a Certificate Signing Request (CSR)
174 *
Manuel Pégourié-Gonnard986bbf22016-02-24 14:36:05 +0000175 * \note See notes for \c mbedtls_x509_csr_parse()
176 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200177 * \param csr CSR context to fill
178 * \param path filename to read the CSR from
179 *
180 * \return 0 if successful, or a specific X509 or PEM error code
181 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100182int mbedtls_x509_csr_parse_file(mbedtls_x509_csr *csr, const char *path);
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200183#endif /* MBEDTLS_FS_IO */
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200184
Hanno Becker612a2f12020-10-09 09:19:39 +0100185#if !defined(MBEDTLS_X509_REMOVE_INFO)
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200186/**
187 * \brief Returns an informational string about the
188 * CSR.
189 *
190 * \param buf Buffer to write to
191 * \param size Maximum size of buffer
192 * \param prefix A line prefix
193 * \param csr The X509 CSR to represent
194 *
Manuel Pégourié-Gonnarde244f9f2015-06-23 12:10:45 +0200195 * \return The length of the string written (not including the
196 * terminated nul byte), or a negative error code.
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200197 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100198int mbedtls_x509_csr_info(char *buf, size_t size, const char *prefix,
199 const mbedtls_x509_csr *csr);
Hanno Becker88c2bf32019-06-14 17:21:24 +0100200#endif /* !MBEDTLS_X509_REMOVE_INFO */
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200201
202/**
Paul Bakker369d2eb2013-09-18 11:58:25 +0200203 * \brief Initialize a CSR
204 *
205 * \param csr CSR to initialize
206 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100207void mbedtls_x509_csr_init(mbedtls_x509_csr *csr);
Paul Bakker369d2eb2013-09-18 11:58:25 +0200208
209/**
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200210 * \brief Unallocate all CSR data
211 *
212 * \param csr CSR to free
213 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100214void mbedtls_x509_csr_free(mbedtls_x509_csr *csr);
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200215#endif /* MBEDTLS_X509_CSR_PARSE_C */
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200216
Andrzej Kurek38d4fdd2021-12-28 16:22:52 +0100217/** \} name Structures and functions for X.509 Certificate Signing Requests (CSR) */
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200218
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200219#if defined(MBEDTLS_X509_CSR_WRITE_C)
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200220/**
221 * \brief Initialize a CSR context
222 *
223 * \param ctx CSR context to initialize
224 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100225void mbedtls_x509write_csr_init(mbedtls_x509write_csr *ctx);
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200226
227/**
228 * \brief Set the subject name for a CSR
229 * Subject names should contain a comma-separated list
230 * of OID types and values:
Gilles Peskinee820c0a2023-08-03 17:45:20 +0200231 * e.g. "C=UK,O=ARM,CN=Mbed TLS Server 1"
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200232 *
233 * \param ctx CSR context to use
234 * \param subject_name subject name to set
235 *
236 * \return 0 if subject name was parsed successfully, or
237 * a specific error code
238 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100239int mbedtls_x509write_csr_set_subject_name(mbedtls_x509write_csr *ctx,
240 const char *subject_name);
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200241
242/**
243 * \brief Set the key for a CSR (public key will be included,
244 * private key used to sign the CSR when writing it)
245 *
246 * \param ctx CSR context to use
Shaun Case8b0ecbc2021-12-20 21:14:10 -0800247 * \param key Asymmetric key to include
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200248 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100249void mbedtls_x509write_csr_set_key(mbedtls_x509write_csr *ctx, mbedtls_pk_context *key);
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200250
251/**
252 * \brief Set the MD algorithm to use for the signature
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200253 * (e.g. MBEDTLS_MD_SHA1)
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200254 *
255 * \param ctx CSR context to use
256 * \param md_alg MD algorithm to use
257 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100258void mbedtls_x509write_csr_set_md_alg(mbedtls_x509write_csr *ctx, mbedtls_md_type_t md_alg);
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200259
260/**
261 * \brief Set the Key Usage Extension flags
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200262 * (e.g. MBEDTLS_X509_KU_DIGITAL_SIGNATURE | MBEDTLS_X509_KU_KEY_CERT_SIGN)
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200263 *
264 * \param ctx CSR context to use
265 * \param key_usage key usage flags to set
266 *
Manuel Pégourié-Gonnard6a8ca332015-05-28 09:33:39 +0200267 * \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED
Andres Amaya Garciad8233f72018-10-08 19:44:55 +0100268 *
269 * \note The <code>decipherOnly</code> flag from the Key Usage
270 * extension is represented by bit 8 (i.e.
271 * <code>0x8000</code>), which cannot typically be represented
272 * in an unsigned char. Therefore, the flag
273 * <code>decipherOnly</code> (i.e.
274 * #MBEDTLS_X509_KU_DECIPHER_ONLY) cannot be set using this
275 * function.
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200276 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100277int mbedtls_x509write_csr_set_key_usage(mbedtls_x509write_csr *ctx, unsigned char key_usage);
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200278
279/**
Hannes Tschofenig6b108602022-12-28 18:38:53 +0100280 * \brief Set Subject Alternative Name
281 *
282 * \param ctx CSR context to use
283 * \param san_list List of SAN values
284 *
285 * \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED
286 *
287 * \note Only "dnsName", "uniformResourceIdentifier" and "otherName",
288 * as defined in RFC 5280, are supported.
289 */
290int mbedtls_x509write_csr_set_subject_alternative_name(mbedtls_x509write_csr *ctx,
291 const mbedtls_x509_san_list *san_list);
292
293/**
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200294 * \brief Set the Netscape Cert Type flags
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200295 * (e.g. MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT | MBEDTLS_X509_NS_CERT_TYPE_EMAIL)
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200296 *
297 * \param ctx CSR context to use
298 * \param ns_cert_type Netscape Cert Type flags to set
299 *
Manuel Pégourié-Gonnard6a8ca332015-05-28 09:33:39 +0200300 * \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200301 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100302int mbedtls_x509write_csr_set_ns_cert_type(mbedtls_x509write_csr *ctx,
303 unsigned char ns_cert_type);
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200304
305/**
Paul Bakkerb9e4e2c2014-05-01 14:18:25 +0200306 * \brief Generic function to add to or replace an extension in the
307 * CSR
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200308 *
309 * \param ctx CSR context to use
310 * \param oid OID of the extension
311 * \param oid_len length of the OID
Christoph Reiter95273f42021-01-21 13:31:23 +0100312 * \param critical Set to 1 to mark the extension as critical, 0 otherwise.
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200313 * \param val value of the extension OCTET STRING
314 * \param val_len length of the value data
315 *
Manuel Pégourié-Gonnard6a8ca332015-05-28 09:33:39 +0200316 * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200317 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100318int mbedtls_x509write_csr_set_extension(mbedtls_x509write_csr *ctx,
319 const char *oid, size_t oid_len,
320 int critical,
321 const unsigned char *val, size_t val_len);
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200322
323/**
324 * \brief Free the contents of a CSR context
325 *
326 * \param ctx CSR context to free
327 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100328void mbedtls_x509write_csr_free(mbedtls_x509write_csr *ctx);
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200329
330/**
331 * \brief Write a CSR (Certificate Signing Request) to a
332 * DER structure
333 * Note: data is written at the end of the buffer! Use the
334 * return value to determine where you should start
335 * using the buffer
336 *
337 * \param ctx CSR to write away
338 * \param buf buffer to write to
339 * \param size size of the buffer
Manuel Pégourié-Gonnardc305b722021-06-15 11:29:26 +0200340 * \param f_rng RNG function. This must not be \c NULL.
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200341 * \param p_rng RNG parameter
342 *
343 * \return length of data written if successful, or a specific
344 * error code
345 *
Manuel Pégourié-Gonnardc305b722021-06-15 11:29:26 +0200346 * \note \p f_rng is used for the signature operation.
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200347 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100348int mbedtls_x509write_csr_der(mbedtls_x509write_csr *ctx, unsigned char *buf, size_t size,
349 int (*f_rng)(void *, unsigned char *, size_t),
350 void *p_rng);
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200351
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200352#if defined(MBEDTLS_PEM_WRITE_C)
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200353/**
354 * \brief Write a CSR (Certificate Signing Request) to a
355 * PEM string
356 *
357 * \param ctx CSR to write away
358 * \param buf buffer to write to
359 * \param size size of the buffer
Manuel Pégourié-Gonnardc305b722021-06-15 11:29:26 +0200360 * \param f_rng RNG function. This must not be \c NULL.
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200361 * \param p_rng RNG parameter
362 *
Manuel Pégourié-Gonnard81abefd2015-05-29 12:53:47 +0200363 * \return 0 if successful, or a specific error code
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200364 *
Manuel Pégourié-Gonnardc305b722021-06-15 11:29:26 +0200365 * \note \p f_rng is used for the signature operation.
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200366 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100367int mbedtls_x509write_csr_pem(mbedtls_x509write_csr *ctx, unsigned char *buf, size_t size,
368 int (*f_rng)(void *, unsigned char *, size_t),
369 void *p_rng);
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200370#endif /* MBEDTLS_PEM_WRITE_C */
371#endif /* MBEDTLS_X509_CSR_WRITE_C */
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200372
Andrzej Kureka0defed2021-12-30 12:33:31 +0100373/** \} addtogroup x509_module */
374
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200375#ifdef __cplusplus
376}
377#endif
378
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200379#endif /* mbedtls_x509_csr.h */