PolarSSL v1.3.8
x509_csr.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_X509_CSR_H
28 #define POLARSSL_X509_CSR_H
29 
30 #if !defined(POLARSSL_CONFIG_FILE)
31 #include "config.h"
32 #else
33 #include POLARSSL_CONFIG_FILE
34 #endif
35 
36 #include "x509.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
54 typedef struct _x509_csr
55 {
59  int version;
70  void *sig_opts;
71 }
72 x509_csr;
73 
77 typedef struct _x509write_csr
78 {
83 }
85 
86 #if defined(POLARSSL_X509_CSR_PARSE_C)
87 
97  const unsigned char *buf, size_t buflen );
98 
108 int x509_csr_parse( x509_csr *csr, const unsigned char *buf, size_t buflen );
109 
110 #if defined(POLARSSL_FS_IO)
111 
119 int x509_csr_parse_file( x509_csr *csr, const char *path );
120 #endif /* POLARSSL_FS_IO */
121 
134 int x509_csr_info( char *buf, size_t size, const char *prefix,
135  const x509_csr *csr );
136 
142 void x509_csr_init( x509_csr *csr );
143 
149 void x509_csr_free( x509_csr *csr );
150 #endif /* POLARSSL_X509_CSR_PARSE_C */
151 
152 /* \} name */
153 /* \} addtogroup x509_module */
154 
155 #if defined(POLARSSL_X509_CSR_WRITE_C)
156 
161 void x509write_csr_init( x509write_csr *ctx );
162 
176  const char *subject_name );
177 
186 
195 
205 int x509write_csr_set_key_usage( x509write_csr *ctx, unsigned char key_usage );
206 
217  unsigned char ns_cert_type );
218 
232  const char *oid, size_t oid_len,
233  const unsigned char *val, size_t val_len );
234 
240 void x509write_csr_free( x509write_csr *ctx );
241 
263 int x509write_csr_der( x509write_csr *ctx, unsigned char *buf, size_t size,
264  int (*f_rng)(void *, unsigned char *, size_t),
265  void *p_rng );
266 
267 #if defined(POLARSSL_PEM_WRITE_C)
268 
285 int x509write_csr_pem( x509write_csr *ctx, unsigned char *buf, size_t size,
286  int (*f_rng)(void *, unsigned char *, size_t),
287  void *p_rng );
288 #endif /* POLARSSL_PEM_WRITE_C */
289 #endif /* POLARSSL_X509_CSR_WRITE_C */
290 
291 #ifdef __cplusplus
292 }
293 #endif
294 
295 #endif /* x509_csr.h */