PolarSSL v1.3.1
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 #include "config.h"
31 
32 #include "x509.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
50 typedef struct _x509_csr
51 {
55  int version;
56 
66 }
67 x509_csr;
68 
72 typedef struct _x509write_csr
73 {
78 }
80 
81 #if defined(POLARSSL_X509_CSR_PARSE_C)
82 
91 int x509_csr_parse( x509_csr *csr, const unsigned char *buf, size_t buflen );
92 
93 #if defined(POLARSSL_FS_IO)
94 
102 int x509_csr_parse_file( x509_csr *csr, const char *path );
103 #endif /* POLARSSL_FS_IO */
104 
117 int x509_csr_info( char *buf, size_t size, const char *prefix,
118  const x509_csr *csr );
119 
125 void x509_csr_init( x509_csr *csr );
126 
132 void x509_csr_free( x509_csr *csr );
133 #endif /* POLARSSL_X509_CSR_PARSE_C */
134 
135 /* \} name */
136 /* \} addtogroup x509_module */
137 
138 #if defined(POLARSSL_X509_CSR_WRITE_C)
139 
144 void x509write_csr_init( x509write_csr *ctx );
145 
158 int x509write_csr_set_subject_name( x509write_csr *ctx, char *subject_name );
159 
168 
177 
187 int x509write_csr_set_key_usage( x509write_csr *ctx, unsigned char key_usage );
188 
199  unsigned char ns_cert_type );
200 
213  const char *oid, size_t oid_len,
214  const unsigned char *val, size_t val_len );
215 
221 void x509write_csr_free( x509write_csr *ctx );
222 
244 int x509write_csr_der( x509write_csr *ctx, unsigned char *buf, size_t size,
245  int (*f_rng)(void *, unsigned char *, size_t),
246  void *p_rng );
247 
248 #if defined(POLARSSL_PEM_WRITE_C)
249 
266 int x509write_csr_pem( x509write_csr *ctx, unsigned char *buf, size_t size,
267  int (*f_rng)(void *, unsigned char *, size_t),
268  void *p_rng );
269 #endif /* POLARSSL_PEM_WRITE_C */
270 #endif /* POLARSSL_X509_CSR_WRITE_C */
271 
272 #ifdef __cplusplus
273 }
274 #endif
275 
276 #endif /* x509_csr.h */