blob: 0d94f01544b0b01613d01080e4f017cc714654f9 [file] [log] [blame]
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001/**
2 * \file x509write.h
3 *
4 * \brief X509 buffer writing functionality
5 *
Paul Bakker407a0da2013-06-27 14:29:21 +02006 * Copyright (C) 2006-2013, Brainspark B.V.
Paul Bakkerbdb912d2012-02-13 23:11:30 +00007 *
8 * This file is part of PolarSSL (http://www.polarssl.org)
9 * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
10 *
11 * All rights reserved.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 */
27#ifndef POLARSSL_X509_WRITE_H
28#define POLARSSL_X509_WRITE_H
29
Paul Bakkerbc956d92013-04-19 14:51:29 +020030#include "config.h"
31
Paul Bakkered27a042013-04-18 22:46:23 +020032#if defined(POLARSSL_X509_WRITE_C)
33
Paul Bakkerbdb912d2012-02-13 23:11:30 +000034#include "rsa.h"
35
Paul Bakker407a0da2013-06-27 14:29:21 +020036#ifdef __cplusplus
37extern "C" {
38#endif
39
Paul Bakkerbdb912d2012-02-13 23:11:30 +000040typedef struct _x509_req_name
41{
42 char oid[128];
43 char name[128];
44
45 struct _x509_req_name *next;
46}
47x509_req_name;
48
49int x509_write_pubkey_der( unsigned char *buf, size_t size, rsa_context *rsa );
50int x509_write_key_der( unsigned char *buf, size_t size, rsa_context *rsa );
51int x509_write_cert_req( unsigned char *buf, size_t size, rsa_context *rsa,
Paul Bakkerc70b9822013-04-07 22:00:46 +020052 x509_req_name *req_name, md_type_t md_alg );
Paul Bakkerbdb912d2012-02-13 23:11:30 +000053
Paul Bakker407a0da2013-06-27 14:29:21 +020054#ifdef __cplusplus
55}
56#endif
57
Paul Bakkered27a042013-04-18 22:46:23 +020058#endif /* POLARSSL_X509_WRITE_C */
59
Paul Bakkerbdb912d2012-02-13 23:11:30 +000060#endif /* POLARSSL_X509_WRITE_H */