XenevaOS
Loading...
Searching...
No Matches
x509_csr.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_CSR_H
11#define MBEDTLS_X509_CSR_H
13
14#include "mbedtls/build_info.h"
15
16#include "mbedtls/x509.h"
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
62
73
74#if defined(MBEDTLS_X509_CSR_PARSE_C)
92int mbedtls_x509_csr_parse_der(mbedtls_x509_csr *csr,
93 const unsigned char *buf, size_t buflen);
94
123typedef int (*mbedtls_x509_csr_ext_cb_t)(void *p_ctx,
124 mbedtls_x509_csr const *csr,
125 mbedtls_x509_buf const *oid,
126 int critical,
127 const unsigned char *p,
128 const unsigned char *end);
129
151int mbedtls_x509_csr_parse_der_with_ext_cb(mbedtls_x509_csr *csr,
152 const unsigned char *buf, size_t buflen,
153 mbedtls_x509_csr_ext_cb_t cb,
154 void *p_ctx);
155
172int mbedtls_x509_csr_parse(mbedtls_x509_csr *csr, const unsigned char *buf, size_t buflen);
173
174#if defined(MBEDTLS_FS_IO)
185int mbedtls_x509_csr_parse_file(mbedtls_x509_csr *csr, const char *path);
186#endif /* MBEDTLS_FS_IO */
187
188#if !defined(MBEDTLS_X509_REMOVE_INFO)
201int mbedtls_x509_csr_info(char *buf, size_t size, const char *prefix,
202 const mbedtls_x509_csr *csr);
203#endif /* !MBEDTLS_X509_REMOVE_INFO */
204
210void mbedtls_x509_csr_init(mbedtls_x509_csr *csr);
211
217void mbedtls_x509_csr_free(mbedtls_x509_csr *csr);
218#endif /* MBEDTLS_X509_CSR_PARSE_C */
219
222#if defined(MBEDTLS_X509_CSR_WRITE_C)
228void mbedtls_x509write_csr_init(mbedtls_x509write_csr *ctx);
229
242int mbedtls_x509write_csr_set_subject_name(mbedtls_x509write_csr *ctx,
243 const char *subject_name);
244
252void mbedtls_x509write_csr_set_key(mbedtls_x509write_csr *ctx, mbedtls_pk_context *key);
253
261void mbedtls_x509write_csr_set_md_alg(mbedtls_x509write_csr *ctx, mbedtls_md_type_t md_alg);
262
280int mbedtls_x509write_csr_set_key_usage(mbedtls_x509write_csr *ctx, unsigned char key_usage);
281
293int mbedtls_x509write_csr_set_subject_alternative_name(mbedtls_x509write_csr *ctx,
294 const mbedtls_x509_san_list *san_list);
295
305int mbedtls_x509write_csr_set_ns_cert_type(mbedtls_x509write_csr *ctx,
306 unsigned char ns_cert_type);
307
321int mbedtls_x509write_csr_set_extension(mbedtls_x509write_csr *ctx,
322 const char *oid, size_t oid_len,
323 int critical,
324 const unsigned char *val, size_t val_len);
325
331void mbedtls_x509write_csr_free(mbedtls_x509write_csr *ctx);
332
351int mbedtls_x509write_csr_der(mbedtls_x509write_csr *ctx, unsigned char *buf, size_t size,
352 mbedtls_f_rng_t *f_rng,
353 void *p_rng);
354
355#if defined(MBEDTLS_PEM_WRITE_C)
370int mbedtls_x509write_csr_pem(mbedtls_x509write_csr *ctx, unsigned char *buf, size_t size,
371 mbedtls_f_rng_t *f_rng,
372 void *p_rng);
373#endif /* MBEDTLS_PEM_WRITE_C */
374#endif /* MBEDTLS_X509_CSR_WRITE_C */
375
378#ifdef __cplusplus
379}
380#endif
381
382#endif /* mbedtls_x509_csr.h */
size_t size
Definition drm_bridge.h:1299
__u64 extensions
Definition i915_drm.h:0
char end[]
Build-time configuration info.
mbedtls_md_type_t
Supported message digests.
Definition md.h:47
mbedtls_pk_type_t
Public key types.
Definition pk.h:73
int mbedtls_f_rng_t(void *p_rng, unsigned char *output, size_t output_size)
The type of custom random generator (RNG) callbacks.
Definition platform_util.h:209
Macro wrapper for struct's members.
Definition asn1.h:141
Definition asn1.h:178
Definition asn1.h:161
Public key container.
Definition pk.h:220
Definition x509_csr.h:38
mbedtls_x509_name subject
Definition x509_csr.h:45
mbedtls_x509_sequence subject_alt_names
Definition x509_csr.h:51
unsigned char ns_cert_type
Definition x509_csr.h:50
mbedtls_x509_buf sig_oid
Definition x509_csr.h:55
int version
Definition x509_csr.h:42
mbedtls_x509_buf cri
Definition x509_csr.h:40
void * MBEDTLS_PRIVATE(sig_opts)
int MBEDTLS_PRIVATE(ext_types)
mbedtls_x509_buf MBEDTLS_PRIVATE(sig)
mbedtls_md_type_t MBEDTLS_PRIVATE(sig_md)
mbedtls_pk_context pk
Definition x509_csr.h:47
unsigned int key_usage
Definition x509_csr.h:49
mbedtls_x509_buf raw
Definition x509_csr.h:39
mbedtls_x509_buf subject_raw
Definition x509_csr.h:44
mbedtls_pk_type_t MBEDTLS_PRIVATE(sig_pk)
Definition x509.h:303
Definition x509_csr.h:66
mbedtls_asn1_named_data * MBEDTLS_PRIVATE(subject)
mbedtls_pk_context * MBEDTLS_PRIVATE(key)
mbedtls_asn1_named_data * MBEDTLS_PRIVATE(extensions)
mbedtls_md_type_t MBEDTLS_PRIVATE(md_alg)
Definition path.h:8
X.509 generic defines and structures.