mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-23 15:55:10 +01:00
Rewrote x509 certificate request writing to use structure for storing
This commit is contained in:
parent
43fdd617e1
commit
8eabfc1461
4 changed files with 215 additions and 119 deletions
|
|
@ -33,6 +33,10 @@
|
|||
|
||||
#include "rsa.h"
|
||||
|
||||
#define POLARSSL_ERR_X509_WRITE_UNKNOWN_OID -1
|
||||
#define POLARSSL_ERR_X509_WRITE_BAD_INPUT_DATA -1
|
||||
#define POLARSSL_ERR_X509_WRITE_MALLOC_FAILED -1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
@ -46,10 +50,23 @@ typedef struct _x509_req_name
|
|||
}
|
||||
x509_req_name;
|
||||
|
||||
typedef struct _x509_cert_req
|
||||
{
|
||||
rsa_context *rsa;
|
||||
x509_req_name *subject;
|
||||
md_type_t md_alg;
|
||||
}
|
||||
x509_cert_req;
|
||||
|
||||
void x509cert_req_init( x509_cert_req *ctx );
|
||||
int x509cert_req_set_subject_name( x509_cert_req *ctx, char *subject_name );
|
||||
void x509cert_req_set_rsa_key( x509_cert_req *ctx, rsa_context *rsa );
|
||||
void x509cert_req_set_md_alg( x509_cert_req *ctx, md_type_t md_alg );
|
||||
void x509cert_req_free( x509_cert_req *ctx );
|
||||
|
||||
int x509_write_pubkey_der( unsigned char *buf, size_t size, rsa_context *rsa );
|
||||
int x509_write_key_der( unsigned char *buf, size_t size, rsa_context *rsa );
|
||||
int x509_write_cert_req( unsigned char *buf, size_t size, rsa_context *rsa,
|
||||
x509_req_name *req_name, md_type_t md_alg );
|
||||
int x509_write_cert_req( x509_cert_req *ctx, unsigned char *buf, size_t size );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue