Mbed TLS v4.1.1
Loading...
Searching...
No Matches
x509_crt.h
Go to the documentation of this file.
1
6/*
7 * Copyright The Mbed TLS Contributors
8 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
9 */
10#ifndef MBEDTLS_X509_CRT_H
11#define MBEDTLS_X509_CRT_H
12#include "mbedtls/private_access.h"
13
14#include "mbedtls/build_info.h"
15
16#include "mbedtls/x509.h"
17#include "mbedtls/x509_crl.h"
18
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
32
40typedef struct mbedtls_x509_crt {
41 int MBEDTLS_PRIVATE(own_buffer);
45
46 int version;
49
52
55
58
61
68
70
71 int MBEDTLS_PRIVATE(ext_types);
72 int MBEDTLS_PRIVATE(ca_istrue);
73 int MBEDTLS_PRIVATE(max_pathlen);
74
75 unsigned int MBEDTLS_PRIVATE(key_usage);
76
78
79 unsigned char MBEDTLS_PRIVATE(ns_cert_type);
80
81 mbedtls_x509_buf MBEDTLS_PRIVATE(sig);
82 mbedtls_md_type_t MBEDTLS_PRIVATE(sig_md);
83 mbedtls_pk_sigalg_t MBEDTLS_PRIVATE(sig_pk);
84
85 /* Unused field reserved for future use */
86 union {
87 size_t number;
88 void *ptr;
89 } MBEDTLS_PRIVATE(unused);
90
95}
97
102#define MBEDTLS_X509_ID_FLAG(id) (1 << ((id) - 1))
103
130 uint32_t allowed_mds;
131 uint32_t allowed_pks;
134 uint32_t allowed_curves;
135 uint32_t rsa_min_bitlen;
136}
138
139#define MBEDTLS_X509_CRT_VERSION_1 0
140#define MBEDTLS_X509_CRT_VERSION_2 1
141#define MBEDTLS_X509_CRT_VERSION_3 2
142
143#define MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN 20
144#define MBEDTLS_X509_RFC5280_UTC_TIME_LEN 15
145
146#if !defined(MBEDTLS_X509_MAX_FILE_PATH_LEN)
147#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512
148#endif
149
150/* This macro unfolds to the concatenation of macro invocations
151 * X509_CRT_ERROR_INFO( error code,
152 * error code as string,
153 * human readable description )
154 * where X509_CRT_ERROR_INFO is defined by the user.
155 * See x509_crt.c for an example of how to use this. */
156#define MBEDTLS_X509_CRT_ERROR_INFO_LIST \
157 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_EXPIRED, \
158 "MBEDTLS_X509_BADCERT_EXPIRED", \
159 "The certificate validity has expired") \
160 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_REVOKED, \
161 "MBEDTLS_X509_BADCERT_REVOKED", \
162 "The certificate has been revoked (is on a CRL)") \
163 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_CN_MISMATCH, \
164 "MBEDTLS_X509_BADCERT_CN_MISMATCH", \
165 "The certificate Common Name (CN) does not match with the expected CN") \
166 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_NOT_TRUSTED, \
167 "MBEDTLS_X509_BADCERT_NOT_TRUSTED", \
168 "The certificate is not correctly signed by the trusted CA") \
169 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCRL_NOT_TRUSTED, \
170 "MBEDTLS_X509_BADCRL_NOT_TRUSTED", \
171 "The CRL is not correctly signed by the trusted CA") \
172 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCRL_EXPIRED, \
173 "MBEDTLS_X509_BADCRL_EXPIRED", \
174 "The CRL is expired") \
175 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_MISSING, \
176 "MBEDTLS_X509_BADCERT_MISSING", \
177 "Certificate was missing") \
178 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_SKIP_VERIFY, \
179 "MBEDTLS_X509_BADCERT_SKIP_VERIFY", \
180 "Certificate verification was skipped") \
181 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_OTHER, \
182 "MBEDTLS_X509_BADCERT_OTHER", \
183 "Other reason (can be used by verify callback)") \
184 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_FUTURE, \
185 "MBEDTLS_X509_BADCERT_FUTURE", \
186 "The certificate validity starts in the future") \
187 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCRL_FUTURE, \
188 "MBEDTLS_X509_BADCRL_FUTURE", \
189 "The CRL is from the future") \
190 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_KEY_USAGE, \
191 "MBEDTLS_X509_BADCERT_KEY_USAGE", \
192 "Usage does not match the keyUsage extension") \
193 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_EXT_KEY_USAGE, \
194 "MBEDTLS_X509_BADCERT_EXT_KEY_USAGE", \
195 "Usage does not match the extendedKeyUsage extension") \
196 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_NS_CERT_TYPE, \
197 "MBEDTLS_X509_BADCERT_NS_CERT_TYPE", \
198 "Usage does not match the nsCertType extension") \
199 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_BAD_MD, \
200 "MBEDTLS_X509_BADCERT_BAD_MD", \
201 "The certificate is signed with an unacceptable hash.") \
202 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_BAD_PK, \
203 "MBEDTLS_X509_BADCERT_BAD_PK", \
204 "The certificate is signed with an unacceptable PK alg (eg RSA vs ECDSA).") \
205 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_BAD_KEY, \
206 "MBEDTLS_X509_BADCERT_BAD_KEY", \
207 "The certificate is signed with an unacceptable key (eg bad curve, RSA too short).") \
208 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCRL_BAD_MD, \
209 "MBEDTLS_X509_BADCRL_BAD_MD", \
210 "The CRL is signed with an unacceptable hash.") \
211 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCRL_BAD_PK, \
212 "MBEDTLS_X509_BADCRL_BAD_PK", \
213 "The CRL is signed with an unacceptable PK alg (eg RSA vs ECDSA).") \
214 X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCRL_BAD_KEY, \
215 "MBEDTLS_X509_BADCRL_BAD_KEY", \
216 "The CRL is signed with an unacceptable key (eg bad curve, RSA too short).")
217
222 int MBEDTLS_PRIVATE(version);
223 unsigned char MBEDTLS_PRIVATE(serial)[MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN];
224 size_t MBEDTLS_PRIVATE(serial_len);
225 mbedtls_pk_context *MBEDTLS_PRIVATE(subject_key);
226 mbedtls_pk_context *MBEDTLS_PRIVATE(issuer_key);
227 mbedtls_asn1_named_data *MBEDTLS_PRIVATE(subject);
228 mbedtls_asn1_named_data *MBEDTLS_PRIVATE(issuer);
229 mbedtls_md_type_t MBEDTLS_PRIVATE(md_alg);
230 char MBEDTLS_PRIVATE(not_before)[MBEDTLS_X509_RFC5280_UTC_TIME_LEN + 1];
231 char MBEDTLS_PRIVATE(not_after)[MBEDTLS_X509_RFC5280_UTC_TIME_LEN + 1];
232 mbedtls_asn1_named_data *MBEDTLS_PRIVATE(extensions);
233}
235
249 const mbedtls_x509_san_list *san_list);
250
254typedef struct {
255 mbedtls_x509_crt *MBEDTLS_PRIVATE(crt);
256 uint32_t MBEDTLS_PRIVATE(flags);
258
262#define MBEDTLS_X509_MAX_VERIFY_CHAIN_SIZE (MBEDTLS_X509_MAX_INTERMEDIATE_CA + 2)
263
267typedef struct {
269 unsigned MBEDTLS_PRIVATE(len);
270
271#if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK)
272 /* This stores the list of potential trusted signers obtained from
273 * the CA callback used for the CRT verification, if configured.
274 * We must track it somewhere because the callback passes its
275 * ownership to the caller. */
276 mbedtls_x509_crt *MBEDTLS_PRIVATE(trust_ca_cb_result);
277#endif /* MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK */
279
280#if defined(MBEDTLS_ECP_RESTARTABLE)
281
285typedef struct {
286 /* for check_signature() */
287 mbedtls_pk_restart_ctx MBEDTLS_PRIVATE(pk);
288
289 /* for find_parent_in() */
290 mbedtls_x509_crt *MBEDTLS_PRIVATE(parent); /* non-null iff parent_in in progress */
291 mbedtls_x509_crt *MBEDTLS_PRIVATE(fallback_parent);
292 int MBEDTLS_PRIVATE(fallback_signature_is_good);
293
294 /* for find_parent() */
295 int MBEDTLS_PRIVATE(parent_is_trusted); /* -1 if find_parent is not in progress */
296
297 /* for verify_chain() */
298 enum {
299 x509_crt_rs_none,
300 x509_crt_rs_find_parent,
301 } MBEDTLS_PRIVATE(in_progress); /* none if no operation is in progress */
302 int MBEDTLS_PRIVATE(self_cnt);
303 mbedtls_x509_crt_verify_chain MBEDTLS_PRIVATE(ver_chain);
304
306
307#else /* MBEDTLS_ECP_RESTARTABLE */
308
309/* Now we can declare functions that take a pointer to that */
311
312#endif /* MBEDTLS_ECP_RESTARTABLE */
313
314#if defined(MBEDTLS_X509_CRT_PARSE_C)
329
336
341
347
372 const unsigned char *buf,
373 size_t buflen);
374
405typedef int (*mbedtls_x509_crt_ext_cb_t)(void *p_ctx,
406 mbedtls_x509_crt const *crt,
407 mbedtls_x509_buf const *oid,
408 int critical,
409 const unsigned char *p,
410 const unsigned char *end);
411
456 const unsigned char *buf,
457 size_t buflen,
458 int make_copy,
460 void *p_ctx);
461
493 const unsigned char *buf,
494 size_t buflen);
495
529int mbedtls_x509_crt_parse(mbedtls_x509_crt *chain, const unsigned char *buf, size_t buflen);
530
531#if defined(MBEDTLS_FS_IO)
548int mbedtls_x509_crt_parse_file(mbedtls_x509_crt *chain, const char *path);
549
563int mbedtls_x509_crt_parse_path(mbedtls_x509_crt *chain, const char *path);
564
565#endif /* MBEDTLS_FS_IO */
566
567#if !defined(MBEDTLS_X509_REMOVE_INFO)
580int mbedtls_x509_crt_info(char *buf, size_t size, const char *prefix,
581 const mbedtls_x509_crt *crt);
582
595int mbedtls_x509_crt_verify_info(char *buf, size_t size, const char *prefix,
596 uint32_t flags);
597#endif /* !MBEDTLS_X509_REMOVE_INFO */
598
670 mbedtls_x509_crt *trust_ca,
671 mbedtls_x509_crl *ca_crl,
672 const char *cn, uint32_t *flags,
673 int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
674 void *p_vrfy);
675
711 mbedtls_x509_crt *trust_ca,
712 mbedtls_x509_crl *ca_crl,
713 const mbedtls_x509_crt_profile *profile,
714 const char *cn, uint32_t *flags,
715 int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
716 void *p_vrfy);
717
745 mbedtls_x509_crt *trust_ca,
746 mbedtls_x509_crl *ca_crl,
747 const mbedtls_x509_crt_profile *profile,
748 const char *cn, uint32_t *flags,
749 int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
750 void *p_vrfy,
752
783typedef int (*mbedtls_x509_crt_ca_cb_t)(void *p_ctx,
784 mbedtls_x509_crt const *child,
785 mbedtls_x509_crt **candidate_cas);
786
787#if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK)
810int mbedtls_x509_crt_verify_with_ca_cb(mbedtls_x509_crt *crt,
812 void *p_ca_cb,
813 const mbedtls_x509_crt_profile *profile,
814 const char *cn, uint32_t *flags,
815 int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
816 void *p_vrfy);
817
818#endif /* MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK */
819
842 unsigned int usage);
843
858 const char *usage_oid,
859 size_t usage_len);
860
861#if defined(MBEDTLS_X509_CRL_PARSE_C)
872#endif /* MBEDTLS_X509_CRL_PARSE_C */
873
880
887
888#if defined(MBEDTLS_ECP_RESTARTABLE)
892void mbedtls_x509_crt_restart_init(mbedtls_x509_crt_restart_ctx *ctx);
893
897void mbedtls_x509_crt_restart_free(mbedtls_x509_crt_restart_ctx *ctx);
898#endif /* MBEDTLS_ECP_RESTARTABLE */
899#endif /* MBEDTLS_X509_CRT_PARSE_C */
900
913 int ext_type)
914{
915 return ctx->MBEDTLS_PRIVATE(ext_types) & ext_type;
916}
917
929
931
932#if defined(MBEDTLS_X509_CRT_WRITE_C)
939
949
964 const unsigned char *serial, size_t serial_len);
965
981 const char *not_after);
982
996 const char *issuer_name);
997
1011 const char *subject_name);
1012
1020
1028
1037
1052 const char *oid, size_t oid_len,
1053 int critical,
1054 const unsigned char *val, size_t val_len);
1055
1068 int is_ca, int max_pathlen);
1069
1070#if defined(PSA_WANT_ALG_SHA_1)
1081
1092#endif /* PSA_WANT_ALG_SHA_1 */
1093
1104 unsigned int key_usage);
1105
1117 const mbedtls_asn1_sequence *exts);
1118
1129 unsigned char ns_cert_type);
1130
1137
1151int mbedtls_x509write_crt_der(mbedtls_x509write_cert *ctx, unsigned char *buf, size_t size);
1152
1153#if defined(MBEDTLS_PEM_WRITE_C)
1164int mbedtls_x509write_crt_pem(mbedtls_x509write_cert *ctx, unsigned char *buf, size_t size);
1165#endif /* MBEDTLS_PEM_WRITE_C */
1166#endif /* MBEDTLS_X509_CRT_WRITE_C */
1167
1169
1170#ifdef __cplusplus
1171}
1172#endif
1173
1174#endif /* mbedtls_x509_crt.h */
int mbedtls_x509_crt_parse_der(mbedtls_x509_crt *chain, const unsigned char *buf, size_t buflen)
Parse a single DER formatted certificate and add it to the end of the provided chained list.
int mbedtls_x509_crt_parse_der_nocopy(mbedtls_x509_crt *chain, const unsigned char *buf, size_t buflen)
Parse a single DER formatted certificate and add it to the end of the provided chained list....
void mbedtls_x509_crt_init(mbedtls_x509_crt *crt)
Initialize a certificate (chain).
int mbedtls_x509_crt_parse(mbedtls_x509_crt *chain, const unsigned char *buf, size_t buflen)
Parse one DER-encoded or one or more concatenated PEM-encoded certificates and add them to the chaine...
int mbedtls_x509write_crt_set_subject_key_identifier(mbedtls_x509write_cert *ctx)
Set the subjectKeyIdentifier extension for a CRT Requires that mbedtls_x509write_crt_set_subject_key(...
int mbedtls_x509_crt_check_key_usage(const mbedtls_x509_crt *crt, unsigned int usage)
Check usage of certificate against keyUsage extension.
int mbedtls_x509_crt_is_revoked(const mbedtls_x509_crt *crt, const mbedtls_x509_crl *crl)
Verify the certificate revocation status.
void mbedtls_x509write_crt_set_subject_key(mbedtls_x509write_cert *ctx, mbedtls_pk_context *key)
Set the subject public key for the certificate.
#define MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN
Definition x509_crt.h:143
mbedtls_asn1_named_data mbedtls_x509_name
Definition x509.h:220
int mbedtls_x509write_crt_set_ext_key_usage(mbedtls_x509write_cert *ctx, const mbedtls_asn1_sequence *exts)
Set the Extended Key Usage Extension (e.g. MBEDTLS_OID_SERVER_AUTH).
int mbedtls_x509write_crt_set_subject_name(mbedtls_x509write_cert *ctx, const char *subject_name)
Set the subject name for a Certificate Subject names should contain a comma-separated list of OID typ...
void mbedtls_x509_crt_restart_ctx
Definition x509_crt.h:310
int mbedtls_x509_crt_verify_restartable(mbedtls_x509_crt *crt, mbedtls_x509_crt *trust_ca, mbedtls_x509_crl *ca_crl, const mbedtls_x509_crt_profile *profile, const char *cn, uint32_t *flags, int(*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *), void *p_vrfy, mbedtls_x509_crt_restart_ctx *rs_ctx)
Restartable version of mbedtls_crt_verify_with_profile().
void mbedtls_x509write_crt_set_issuer_key(mbedtls_x509write_cert *ctx, mbedtls_pk_context *key)
Set the issuer key used for signing the certificate.
int(* mbedtls_x509_crt_ext_cb_t)(void *p_ctx, mbedtls_x509_crt const *crt, mbedtls_x509_buf const *oid, int critical, const unsigned char *p, const unsigned char *end)
The type of certificate extension callbacks.
Definition x509_crt.h:405
mbedtls_asn1_buf mbedtls_x509_buf
Definition x509.h:209
static int mbedtls_x509_crt_has_ext_type(const mbedtls_x509_crt *ctx, int ext_type)
Query certificate for given extension type.
Definition x509_crt.h:912
#define MBEDTLS_X509_RFC5280_UTC_TIME_LEN
Definition x509_crt.h:144
int mbedtls_x509write_crt_set_issuer_name(mbedtls_x509write_cert *ctx, const char *issuer_name)
Set the issuer name for a Certificate Issuer names should contain a comma-separated list of OID types...
#define MBEDTLS_X509_MAX_VERIFY_CHAIN_SIZE
Definition x509_crt.h:262
int mbedtls_x509_crt_parse_path(mbedtls_x509_crt *chain, const char *path)
Load one or more certificate files from a path and add them to the chained list. Parses permissively....
int mbedtls_x509write_crt_set_extension(mbedtls_x509write_cert *ctx, const char *oid, size_t oid_len, int critical, const unsigned char *val, size_t val_len)
Generic function to add to or replace an extension in the CRT.
int mbedtls_x509write_crt_set_key_usage(mbedtls_x509write_cert *ctx, unsigned int key_usage)
Set the Key Usage Extension flags (e.g. MBEDTLS_X509_KU_DIGITAL_SIGNATURE | MBEDTLS_X509_KU_KEY_CERT_...
int mbedtls_x509write_crt_set_ns_cert_type(mbedtls_x509write_cert *ctx, unsigned char ns_cert_type)
Set the Netscape Cert Type flags (e.g. MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT | MBEDTLS_X509_NS_CERT_TY...
const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_none
int(* mbedtls_x509_crt_ca_cb_t)(void *p_ctx, mbedtls_x509_crt const *child, mbedtls_x509_crt **candidate_cas)
The type of trusted certificate callbacks.
Definition x509_crt.h:783
int mbedtls_x509write_crt_set_subject_alternative_name(mbedtls_x509write_cert *ctx, const mbedtls_x509_san_list *san_list)
Set Subject Alternative Name.
int mbedtls_x509write_crt_set_authority_key_identifier(mbedtls_x509write_cert *ctx)
Set the authorityKeyIdentifier extension for a CRT Requires that mbedtls_x509write_crt_set_issuer_key...
int mbedtls_x509_crt_parse_der_with_ext_cb(mbedtls_x509_crt *chain, const unsigned char *buf, size_t buflen, int make_copy, mbedtls_x509_crt_ext_cb_t cb, void *p_ctx)
Parse a single DER formatted certificate and add it to the end of the provided chained list.
const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_next
int mbedtls_x509write_crt_pem(mbedtls_x509write_cert *ctx, unsigned char *buf, size_t size)
Write a built up certificate to a X509 PEM string.
int mbedtls_x509_crt_verify(mbedtls_x509_crt *crt, mbedtls_x509_crt *trust_ca, mbedtls_x509_crl *ca_crl, const char *cn, uint32_t *flags, int(*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *), void *p_vrfy)
Verify a chain of certificates.
const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_default
void mbedtls_x509write_crt_init(mbedtls_x509write_cert *ctx)
Initialize a CRT writing context.
void mbedtls_x509write_crt_set_version(mbedtls_x509write_cert *ctx, int version)
Set the version for a Certificate Default: MBEDTLS_X509_CRT_VERSION_3.
int mbedtls_x509write_crt_der(mbedtls_x509write_cert *ctx, unsigned char *buf, size_t size)
Write a built up certificate to a X509 DER structure Note: data is written at the end of the buffer!...
void mbedtls_x509write_crt_free(mbedtls_x509write_cert *ctx)
Free the contents of a CRT write context.
void mbedtls_x509_crt_free(mbedtls_x509_crt *crt)
Unallocate all certificate data.
int mbedtls_x509_crt_info(char *buf, size_t size, const char *prefix, const mbedtls_x509_crt *crt)
Returns an informational string about the certificate.
mbedtls_asn1_sequence mbedtls_x509_sequence
Definition x509.h:225
void mbedtls_x509write_crt_set_md_alg(mbedtls_x509write_cert *ctx, mbedtls_md_type_t md_alg)
Set the MD algorithm to use for the signature (e.g. MBEDTLS_MD_SHA1).
int mbedtls_x509write_crt_set_serial_raw(mbedtls_x509write_cert *ctx, const unsigned char *serial, size_t serial_len)
Set the serial number for a Certificate.
int mbedtls_x509write_crt_set_validity(mbedtls_x509write_cert *ctx, const char *not_before, const char *not_after)
Set the validity period for a Certificate Timestamps should be in string format for UTC timezone i....
int mbedtls_x509_crt_check_extended_key_usage(const mbedtls_x509_crt *crt, const char *usage_oid, size_t usage_len)
Check usage of certificate against extendedKeyUsage.
int mbedtls_x509_crt_parse_file(mbedtls_x509_crt *chain, const char *path)
Load one or more certificates and add them to the chained list. Parses permissively....
int mbedtls_x509write_crt_set_basic_constraints(mbedtls_x509write_cert *ctx, int is_ca, int max_pathlen)
Set the basicConstraints extension for a CRT.
int mbedtls_x509_crt_verify_info(char *buf, size_t size, const char *prefix, uint32_t flags)
Returns an informational string about the verification status of a certificate.
int mbedtls_x509_crt_verify_with_profile(mbedtls_x509_crt *crt, mbedtls_x509_crt *trust_ca, mbedtls_x509_crl *ca_crl, const mbedtls_x509_crt_profile *profile, const char *cn, uint32_t *flags, int(*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *), void *p_vrfy)
Verify a chain of certificates with respect to a configurable security profile.
const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_suiteb
int mbedtls_x509_crt_get_ca_istrue(const mbedtls_x509_crt *crt)
Access the ca_istrue field.
Build-time configuration info.
mbedtls_md_type_t
Supported message digests.
Definition md.h:50
void mbedtls_pk_restart_ctx
Definition pk.h:149
mbedtls_pk_sigalg_t
Definition pk.h:49
Public key container.
Definition pk.h:106
mbedtls_x509_time valid_to
Definition x509_crt.h:57
mbedtls_x509_buf sig_oid
Definition x509_crt.h:48
mbedtls_x509_sequence subject_alt_names
Definition x509_crt.h:65
mbedtls_x509_buf tbs
Definition x509_crt.h:44
mbedtls_x509_authority authority_key_id
Definition x509_crt.h:67
mbedtls_x509_buf subject_key_id
Definition x509_crt.h:66
mbedtls_x509_buf raw
Definition x509_crt.h:43
mbedtls_x509_buf serial
Definition x509_crt.h:47
mbedtls_pk_context pk
Definition x509_crt.h:60
mbedtls_x509_buf v3_ext
Definition x509_crt.h:64
mbedtls_x509_buf issuer_id
Definition x509_crt.h:62
mbedtls_x509_name subject
Definition x509_crt.h:54
mbedtls_x509_sequence certificate_policies
Definition x509_crt.h:69
mbedtls_x509_buf pk_raw
Definition x509_crt.h:59
mbedtls_x509_time valid_from
Definition x509_crt.h:56
mbedtls_x509_buf subject_raw
Definition x509_crt.h:51
mbedtls_x509_sequence ext_key_usage
Definition x509_crt.h:77
struct mbedtls_x509_crt * next
Definition x509_crt.h:94
mbedtls_x509_buf subject_id
Definition x509_crt.h:63
mbedtls_x509_name issuer
Definition x509_crt.h:53
mbedtls_x509_buf issuer_raw
Definition x509_crt.h:50
X.509 generic defines and structures.
X.509 certificate revocation list parsing.