4 * \brief X.509 certificate parsing and writing
6 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
7 * SPDX-License-Identifier: GPL-2.0
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 * This file is part of mbed TLS (https://tls.mbed.org)
25 #ifndef MBEDTLS_X509_CRT_H
26 #define MBEDTLS_X509_CRT_H
28 #if !defined(MBEDTLS_CONFIG_FILE)
31 #include MBEDTLS_CONFIG_FILE
38 * \addtogroup x509_module
47 * \name Structures and functions for parsing and writing X.509 certificates
52 * Container for an X.509 certificate. The certificate may be chained.
54 typedef struct mbedtls_x509_crt
56 mbedtls_x509_buf raw
; /**< The raw certificate data (DER). */
57 mbedtls_x509_buf tbs
; /**< The raw certificate body (DER). The part that is To Be Signed. */
59 int version
; /**< The X.509 version. (1=v1, 2=v2, 3=v3) */
60 mbedtls_x509_buf serial
; /**< Unique id for certificate issued by a specific CA. */
61 mbedtls_x509_buf sig_oid
; /**< Signature algorithm, e.g. sha1RSA */
63 mbedtls_x509_buf issuer_raw
; /**< The raw issuer data (DER). Used for quick comparison. */
64 mbedtls_x509_buf subject_raw
; /**< The raw subject data (DER). Used for quick comparison. */
66 mbedtls_x509_name issuer
; /**< The parsed issuer data (named information object). */
67 mbedtls_x509_name subject
; /**< The parsed subject data (named information object). */
69 mbedtls_x509_time valid_from
; /**< Start time of certificate validity. */
70 mbedtls_x509_time valid_to
; /**< End time of certificate validity. */
72 mbedtls_pk_context pk
; /**< Container for the public key context. */
74 mbedtls_x509_buf issuer_id
; /**< Optional X.509 v2/v3 issuer unique identifier. */
75 mbedtls_x509_buf subject_id
; /**< Optional X.509 v2/v3 subject unique identifier. */
76 mbedtls_x509_buf v3_ext
; /**< Optional X.509 v3 extensions. */
77 mbedtls_x509_sequence subject_alt_names
; /**< Optional list of Subject Alternative Names (Only dNSName supported). */
79 int ext_types
; /**< Bit string containing detected and parsed extensions */
80 int ca_istrue
; /**< Optional Basic Constraint extension value: 1 if this certificate belongs to a CA, 0 otherwise. */
81 int max_pathlen
; /**< Optional Basic Constraint extension value: The maximum path length to the root certificate. Path length is 1 higher than RFC 5280 'meaning', so 1+ */
83 unsigned int key_usage
; /**< Optional key usage extension value: See the values in x509.h */
85 mbedtls_x509_sequence ext_key_usage
; /**< Optional list of extended key usage OIDs. */
87 unsigned char ns_cert_type
; /**< Optional Netscape certificate type extension value: See the values in x509.h */
89 mbedtls_x509_buf sig
; /**< Signature: hash of the tbs part signed with the private key. */
90 mbedtls_md_type_t sig_md
; /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */
91 mbedtls_pk_type_t sig_pk
; /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */
92 void *sig_opts
; /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */
94 struct mbedtls_x509_crt
*next
; /**< Next certificate in the CA-chain. */
99 * Build flag from an algorithm/curve identifier (pk, md, ecp)
100 * Since 0 is always XXX_NONE, ignore it.
102 #define MBEDTLS_X509_ID_FLAG( id ) ( 1 << ( id - 1 ) )
105 * Security profile for certificate verification.
107 * All lists are bitfields, built by ORing flags from MBEDTLS_X509_ID_FLAG().
111 uint32_t allowed_mds
; /**< MDs for signatures */
112 uint32_t allowed_pks
; /**< PK algs for signatures */
113 uint32_t allowed_curves
; /**< Elliptic curves for ECDSA */
114 uint32_t rsa_min_bitlen
; /**< Minimum size for RSA keys */
116 mbedtls_x509_crt_profile
;
118 #define MBEDTLS_X509_CRT_VERSION_1 0
119 #define MBEDTLS_X509_CRT_VERSION_2 1
120 #define MBEDTLS_X509_CRT_VERSION_3 2
122 #define MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN 32
123 #define MBEDTLS_X509_RFC5280_UTC_TIME_LEN 15
125 #if !defined( MBEDTLS_X509_MAX_FILE_PATH_LEN )
126 #define MBEDTLS_X509_MAX_FILE_PATH_LEN 512
130 * Container for writing a certificate (CRT)
132 typedef struct mbedtls_x509write_cert
136 mbedtls_pk_context
*subject_key
;
137 mbedtls_pk_context
*issuer_key
;
138 mbedtls_asn1_named_data
*subject
;
139 mbedtls_asn1_named_data
*issuer
;
140 mbedtls_md_type_t md_alg
;
141 char not_before
[MBEDTLS_X509_RFC5280_UTC_TIME_LEN
+ 1];
142 char not_after
[MBEDTLS_X509_RFC5280_UTC_TIME_LEN
+ 1];
143 mbedtls_asn1_named_data
*extensions
;
145 mbedtls_x509write_cert
;
147 #if defined(MBEDTLS_X509_CRT_PARSE_C)
149 * Default security profile. Should provide a good balance between security
150 * and compatibility with current deployments.
152 extern const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_default
;
155 * Expected next default profile. Recommended for new deployments.
156 * Currently targets a 128-bit security level, except for RSA-2048.
158 extern const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_next
;
161 * NSA Suite B profile.
163 extern const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_suiteb
;
166 * \brief Parse a single DER formatted certificate and add it
167 * to the chained list.
169 * \param chain points to the start of the chain
170 * \param buf buffer holding the certificate DER data
171 * \param buflen size of the buffer
173 * \return 0 if successful, or a specific X509 or PEM error code
175 int mbedtls_x509_crt_parse_der( mbedtls_x509_crt
*chain
, const unsigned char *buf
,
179 * \brief Parse one or more certificates and add them
180 * to the chained list. Parses permissively. If some
181 * certificates can be parsed, the result is the number
182 * of failed certificates it encountered. If none complete
183 * correctly, the first error is returned.
185 * \param chain points to the start of the chain
186 * \param buf buffer holding the certificate data in PEM or DER format
187 * \param buflen size of the buffer
188 * (including the terminating null byte for PEM data)
190 * \return 0 if all certificates parsed successfully, a positive number
191 * if partly successful or a specific X509 or PEM error code
193 int mbedtls_x509_crt_parse( mbedtls_x509_crt
*chain
, const unsigned char *buf
, size_t buflen
);
195 #if defined(MBEDTLS_FS_IO)
197 * \brief Load one or more certificates and add them
198 * to the chained list. Parses permissively. If some
199 * certificates can be parsed, the result is the number
200 * of failed certificates it encountered. If none complete
201 * correctly, the first error is returned.
203 * \param chain points to the start of the chain
204 * \param path filename to read the certificates from
206 * \return 0 if all certificates parsed successfully, a positive number
207 * if partly successful or a specific X509 or PEM error code
209 int mbedtls_x509_crt_parse_file( mbedtls_x509_crt
*chain
, const char *path
);
212 * \brief Load one or more certificate files from a path and add them
213 * to the chained list. Parses permissively. If some
214 * certificates can be parsed, the result is the number
215 * of failed certificates it encountered. If none complete
216 * correctly, the first error is returned.
218 * \param chain points to the start of the chain
219 * \param path directory / folder to read the certificate files from
221 * \return 0 if all certificates parsed successfully, a positive number
222 * if partly successful or a specific X509 or PEM error code
224 int mbedtls_x509_crt_parse_path( mbedtls_x509_crt
*chain
, const char *path
);
225 #endif /* MBEDTLS_FS_IO */
228 * \brief Returns an informational string about the
231 * \param buf Buffer to write to
232 * \param size Maximum size of buffer
233 * \param prefix A line prefix
234 * \param crt The X509 certificate to represent
236 * \return The length of the string written (not including the
237 * terminated nul byte), or a negative error code.
239 int mbedtls_x509_crt_info( char *buf
, size_t size
, const char *prefix
,
240 const mbedtls_x509_crt
*crt
);
243 * \brief Returns an informational string about the
244 * verification status of a certificate.
246 * \param buf Buffer to write to
247 * \param size Maximum size of buffer
248 * \param prefix A line prefix
249 * \param flags Verification flags created by mbedtls_x509_crt_verify()
251 * \return The length of the string written (not including the
252 * terminated nul byte), or a negative error code.
254 int mbedtls_x509_crt_verify_info( char *buf
, size_t size
, const char *prefix
,
258 * \brief Verify the certificate signature
260 * The verify callback is a user-supplied callback that
261 * can clear / modify / add flags for a certificate. If set,
262 * the verification callback is called for each
263 * certificate in the chain (from the trust-ca down to the
264 * presented crt). The parameters for the callback are:
265 * (void *parameter, mbedtls_x509_crt *crt, int certificate_depth,
266 * int *flags). With the flags representing current flags for
267 * that specific certificate and the certificate depth from
268 * the bottom (Peer cert depth = 0).
270 * All flags left after returning from the callback
271 * are also returned to the application. The function should
272 * return 0 for anything (including invalid certificates)
273 * other than fatal error, as a non-zero return code
274 * immediately aborts the verification process. For fatal
275 * errors, a specific error code should be used (different
276 * from MBEDTLS_ERR_X509_CERT_VERIFY_FAILED which should not
277 * be returned at this point), or MBEDTLS_ERR_X509_FATAL_ERROR
278 * can be used if no better code is available.
280 * \note In case verification failed, the results can be displayed
281 * using \c mbedtls_x509_crt_verify_info()
283 * \note Same as \c mbedtls_x509_crt_verify_with_profile() with the
284 * default security profile.
286 * \note It is your responsibility to provide up-to-date CRLs for
287 * all trusted CAs. If no CRL is provided for the CA that was
288 * used to sign the certificate, CRL verification is skipped
289 * silently, that is *without* setting any flag.
291 * \param crt a certificate (chain) to be verified
292 * \param trust_ca the list of trusted CAs
293 * \param ca_crl the list of CRLs for trusted CAs (see note above)
294 * \param cn expected Common Name (can be set to
295 * NULL if the CN must not be verified)
296 * \param flags result of the verification
297 * \param f_vrfy verification function
298 * \param p_vrfy verification parameter
300 * \return 0 (and flags set to 0) if the chain was verified and valid,
301 * MBEDTLS_ERR_X509_CERT_VERIFY_FAILED if the chain was verified
302 * but found to be invalid, in which case *flags will have one
303 * or more MBEDTLS_X509_BADCERT_XXX or MBEDTLS_X509_BADCRL_XXX
304 * flags set, or another error (and flags set to 0xffffffff)
305 * in case of a fatal error encountered during the
306 * verification process.
308 int mbedtls_x509_crt_verify( mbedtls_x509_crt
*crt
,
309 mbedtls_x509_crt
*trust_ca
,
310 mbedtls_x509_crl
*ca_crl
,
311 const char *cn
, uint32_t *flags
,
312 int (*f_vrfy
)(void *, mbedtls_x509_crt
*, int, uint32_t *),
316 * \brief Verify the certificate signature according to profile
318 * \note Same as \c mbedtls_x509_crt_verify(), but with explicit
321 * \note The restrictions on keys (RSA minimum size, allowed curves
322 * for ECDSA) apply to all certificates: trusted root,
323 * intermediate CAs if any, and end entity certificate.
325 * \param crt a certificate (chain) to be verified
326 * \param trust_ca the list of trusted CAs
327 * \param ca_crl the list of CRLs for trusted CAs
328 * \param profile security profile for verification
329 * \param cn expected Common Name (can be set to
330 * NULL if the CN must not be verified)
331 * \param flags result of the verification
332 * \param f_vrfy verification function
333 * \param p_vrfy verification parameter
335 * \return 0 if successful or MBEDTLS_ERR_X509_CERT_VERIFY_FAILED
336 * in which case *flags will have one or more
337 * MBEDTLS_X509_BADCERT_XXX or MBEDTLS_X509_BADCRL_XXX flags
339 * or another error in case of a fatal error encountered
340 * during the verification process.
342 int mbedtls_x509_crt_verify_with_profile( mbedtls_x509_crt
*crt
,
343 mbedtls_x509_crt
*trust_ca
,
344 mbedtls_x509_crl
*ca_crl
,
345 const mbedtls_x509_crt_profile
*profile
,
346 const char *cn
, uint32_t *flags
,
347 int (*f_vrfy
)(void *, mbedtls_x509_crt
*, int, uint32_t *),
350 #if defined(MBEDTLS_X509_CHECK_KEY_USAGE)
352 * \brief Check usage of certificate against keyUsage extension.
354 * \param crt Leaf certificate used.
355 * \param usage Intended usage(s) (eg MBEDTLS_X509_KU_KEY_ENCIPHERMENT
356 * before using the certificate to perform an RSA key
359 * \note Except for decipherOnly and encipherOnly, a bit set in the
360 * usage argument means this bit MUST be set in the
361 * certificate. For decipherOnly and encipherOnly, it means
362 * that bit MAY be set.
364 * \return 0 is these uses of the certificate are allowed,
365 * MBEDTLS_ERR_X509_BAD_INPUT_DATA if the keyUsage extension
366 * is present but does not match the usage argument.
368 * \note You should only call this function on leaf certificates, on
369 * (intermediate) CAs the keyUsage extension is automatically
370 * checked by \c mbedtls_x509_crt_verify().
372 int mbedtls_x509_crt_check_key_usage( const mbedtls_x509_crt
*crt
,
373 unsigned int usage
);
374 #endif /* MBEDTLS_X509_CHECK_KEY_USAGE) */
376 #if defined(MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE)
378 * \brief Check usage of certificate against extentedJeyUsage.
380 * \param crt Leaf certificate used.
381 * \param usage_oid Intended usage (eg MBEDTLS_OID_SERVER_AUTH or MBEDTLS_OID_CLIENT_AUTH).
382 * \param usage_len Length of usage_oid (eg given by MBEDTLS_OID_SIZE()).
384 * \return 0 if this use of the certificate is allowed,
385 * MBEDTLS_ERR_X509_BAD_INPUT_DATA if not.
387 * \note Usually only makes sense on leaf certificates.
389 int mbedtls_x509_crt_check_extended_key_usage( const mbedtls_x509_crt
*crt
,
390 const char *usage_oid
,
392 #endif /* MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE) */
394 #if defined(MBEDTLS_X509_CRL_PARSE_C)
396 * \brief Verify the certificate revocation status
398 * \param crt a certificate to be verified
399 * \param crl the CRL to verify against
401 * \return 1 if the certificate is revoked, 0 otherwise
404 int mbedtls_x509_crt_is_revoked( const mbedtls_x509_crt
*crt
, const mbedtls_x509_crl
*crl
);
405 #endif /* MBEDTLS_X509_CRL_PARSE_C */
408 * \brief Initialize a certificate (chain)
410 * \param crt Certificate chain to initialize
412 void mbedtls_x509_crt_init( mbedtls_x509_crt
*crt
);
415 * \brief Unallocate all certificate data
417 * \param crt Certificate chain to free
419 void mbedtls_x509_crt_free( mbedtls_x509_crt
*crt
);
420 #endif /* MBEDTLS_X509_CRT_PARSE_C */
423 /* \} addtogroup x509_module */
425 #if defined(MBEDTLS_X509_CRT_WRITE_C)
427 * \brief Initialize a CRT writing context
429 * \param ctx CRT context to initialize
431 void mbedtls_x509write_crt_init( mbedtls_x509write_cert
*ctx
);
434 * \brief Set the verion for a Certificate
435 * Default: MBEDTLS_X509_CRT_VERSION_3
437 * \param ctx CRT context to use
438 * \param version version to set (MBEDTLS_X509_CRT_VERSION_1, MBEDTLS_X509_CRT_VERSION_2 or
439 * MBEDTLS_X509_CRT_VERSION_3)
441 void mbedtls_x509write_crt_set_version( mbedtls_x509write_cert
*ctx
, int version
);
444 * \brief Set the serial number for a Certificate.
446 * \param ctx CRT context to use
447 * \param serial serial number to set
449 * \return 0 if successful
451 int mbedtls_x509write_crt_set_serial( mbedtls_x509write_cert
*ctx
, const mbedtls_mpi
*serial
);
454 * \brief Set the validity period for a Certificate
455 * Timestamps should be in string format for UTC timezone
456 * i.e. "YYYYMMDDhhmmss"
457 * e.g. "20131231235959" for December 31st 2013
460 * \param ctx CRT context to use
461 * \param not_before not_before timestamp
462 * \param not_after not_after timestamp
464 * \return 0 if timestamp was parsed successfully, or
465 * a specific error code
467 int mbedtls_x509write_crt_set_validity( mbedtls_x509write_cert
*ctx
, const char *not_before
,
468 const char *not_after
);
471 * \brief Set the issuer name for a Certificate
472 * Issuer names should contain a comma-separated list
473 * of OID types and values:
474 * e.g. "C=UK,O=ARM,CN=mbed TLS CA"
476 * \param ctx CRT context to use
477 * \param issuer_name issuer name to set
479 * \return 0 if issuer name was parsed successfully, or
480 * a specific error code
482 int mbedtls_x509write_crt_set_issuer_name( mbedtls_x509write_cert
*ctx
,
483 const char *issuer_name
);
486 * \brief Set the subject name for a Certificate
487 * Subject names should contain a comma-separated list
488 * of OID types and values:
489 * e.g. "C=UK,O=ARM,CN=mbed TLS Server 1"
491 * \param ctx CRT context to use
492 * \param subject_name subject name to set
494 * \return 0 if subject name was parsed successfully, or
495 * a specific error code
497 int mbedtls_x509write_crt_set_subject_name( mbedtls_x509write_cert
*ctx
,
498 const char *subject_name
);
501 * \brief Set the subject public key for the certificate
503 * \param ctx CRT context to use
504 * \param key public key to include
506 void mbedtls_x509write_crt_set_subject_key( mbedtls_x509write_cert
*ctx
, mbedtls_pk_context
*key
);
509 * \brief Set the issuer key used for signing the certificate
511 * \param ctx CRT context to use
512 * \param key private key to sign with
514 void mbedtls_x509write_crt_set_issuer_key( mbedtls_x509write_cert
*ctx
, mbedtls_pk_context
*key
);
517 * \brief Set the MD algorithm to use for the signature
518 * (e.g. MBEDTLS_MD_SHA1)
520 * \param ctx CRT context to use
521 * \param md_alg MD algorithm to use
523 void mbedtls_x509write_crt_set_md_alg( mbedtls_x509write_cert
*ctx
, mbedtls_md_type_t md_alg
);
526 * \brief Generic function to add to or replace an extension in the
529 * \param ctx CRT context to use
530 * \param oid OID of the extension
531 * \param oid_len length of the OID
532 * \param critical if the extension is critical (per the RFC's definition)
533 * \param val value of the extension OCTET STRING
534 * \param val_len length of the value data
536 * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED
538 int mbedtls_x509write_crt_set_extension( mbedtls_x509write_cert
*ctx
,
539 const char *oid
, size_t oid_len
,
541 const unsigned char *val
, size_t val_len
);
544 * \brief Set the basicConstraints extension for a CRT
546 * \param ctx CRT context to use
547 * \param is_ca is this a CA certificate
548 * \param max_pathlen maximum length of certificate chains below this
549 * certificate (only for CA certificates, -1 is
552 * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED
554 int mbedtls_x509write_crt_set_basic_constraints( mbedtls_x509write_cert
*ctx
,
555 int is_ca
, int max_pathlen
);
557 #if defined(MBEDTLS_SHA1_C)
559 * \brief Set the subjectKeyIdentifier extension for a CRT
560 * Requires that mbedtls_x509write_crt_set_subject_key() has been
563 * \param ctx CRT context to use
565 * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED
567 int mbedtls_x509write_crt_set_subject_key_identifier( mbedtls_x509write_cert
*ctx
);
570 * \brief Set the authorityKeyIdentifier extension for a CRT
571 * Requires that mbedtls_x509write_crt_set_issuer_key() has been
574 * \param ctx CRT context to use
576 * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED
578 int mbedtls_x509write_crt_set_authority_key_identifier( mbedtls_x509write_cert
*ctx
);
579 #endif /* MBEDTLS_SHA1_C */
582 * \brief Set the Key Usage Extension flags
583 * (e.g. MBEDTLS_X509_KU_DIGITAL_SIGNATURE | MBEDTLS_X509_KU_KEY_CERT_SIGN)
585 * \param ctx CRT context to use
586 * \param key_usage key usage flags to set
588 * \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED
590 int mbedtls_x509write_crt_set_key_usage( mbedtls_x509write_cert
*ctx
,
591 unsigned int key_usage
);
594 * \brief Set the Netscape Cert Type flags
595 * (e.g. MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT | MBEDTLS_X509_NS_CERT_TYPE_EMAIL)
597 * \param ctx CRT context to use
598 * \param ns_cert_type Netscape Cert Type flags to set
600 * \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED
602 int mbedtls_x509write_crt_set_ns_cert_type( mbedtls_x509write_cert
*ctx
,
603 unsigned char ns_cert_type
);
606 * \brief Free the contents of a CRT write context
608 * \param ctx CRT context to free
610 void mbedtls_x509write_crt_free( mbedtls_x509write_cert
*ctx
);
613 * \brief Write a built up certificate to a X509 DER structure
614 * Note: data is written at the end of the buffer! Use the
615 * return value to determine where you should start
618 * \param ctx certificate to write away
619 * \param buf buffer to write to
620 * \param size size of the buffer
621 * \param f_rng RNG function (for signature, see note)
622 * \param p_rng RNG parameter
624 * \return length of data written if successful, or a specific
627 * \note f_rng may be NULL if RSA is used for signature and the
628 * signature is made offline (otherwise f_rng is desirable
629 * for countermeasures against timing attacks).
630 * ECDSA signatures always require a non-NULL f_rng.
632 int mbedtls_x509write_crt_der( mbedtls_x509write_cert
*ctx
, unsigned char *buf
, size_t size
,
633 int (*f_rng
)(void *, unsigned char *, size_t),
636 #if defined(MBEDTLS_PEM_WRITE_C)
638 * \brief Write a built up certificate to a X509 PEM string
640 * \param ctx certificate to write away
641 * \param buf buffer to write to
642 * \param size size of the buffer
643 * \param f_rng RNG function (for signature, see note)
644 * \param p_rng RNG parameter
646 * \return 0 if successful, or a specific error code
648 * \note f_rng may be NULL if RSA is used for signature and the
649 * signature is made offline (otherwise f_rng is desirable
650 * for countermeasures against timing attacks).
651 * ECDSA signatures always require a non-NULL f_rng.
653 int mbedtls_x509write_crt_pem( mbedtls_x509write_cert
*ctx
, unsigned char *buf
, size_t size
,
654 int (*f_rng
)(void *, unsigned char *, size_t),
656 #endif /* MBEDTLS_PEM_WRITE_C */
657 #endif /* MBEDTLS_X509_CRT_WRITE_C */
663 #endif /* mbedtls_x509_crt.h */