blob: 1d00491a18988fbaeee1aa9676c153a246574852 [file] [log] [blame]
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001/**
2 * \file x509write.h
3 *
4 * \brief X509 buffer writing functionality
5 *
Paul Bakker530927b2015-02-13 14:24:10 +01006 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
Paul Bakkerbdb912d2012-02-13 23:11:30 +00007 *
Manuel Pégourié-Gonnarde12abf92015-01-28 17:13:45 +00008 * This file is part of mbed TLS (https://polarssl.org)
Paul Bakkerbdb912d2012-02-13 23:11:30 +00009 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 */
24#ifndef POLARSSL_X509_WRITE_H
25#define POLARSSL_X509_WRITE_H
26
27#include "rsa.h"
28
Paul Bakker34b225f2013-09-11 11:47:26 +020029#ifdef __cplusplus
30extern "C" {
31#endif
32
Paul Bakkerbdb912d2012-02-13 23:11:30 +000033typedef struct _x509_req_name
34{
35 char oid[128];
36 char name[128];
37
38 struct _x509_req_name *next;
39}
40x509_req_name;
41
42int x509_write_pubkey_der( unsigned char *buf, size_t size, rsa_context *rsa );
43int x509_write_key_der( unsigned char *buf, size_t size, rsa_context *rsa );
44int x509_write_cert_req( unsigned char *buf, size_t size, rsa_context *rsa,
Paul Bakker3cac5e02012-02-16 14:08:06 +000045 x509_req_name *req_name, int hash_id );
Paul Bakkerbdb912d2012-02-13 23:11:30 +000046
Paul Bakker34b225f2013-09-11 11:47:26 +020047#ifdef __cplusplus
48}
49#endif
50
Paul Bakkerbdb912d2012-02-13 23:11:30 +000051#endif /* POLARSSL_X509_WRITE_H */