blob: e6ac1d447b1f31032215f5b1f73851c698f19680 [file] [log] [blame]
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001/**
2 * \file asn1write.h
3 *
4 * \brief ASN.1 buffer writing functionality
5 *
Manuel Pégourié-Gonnard0edee5e2015-01-26 15:29:40 +00006 * Copyright (C) 2006-2012, 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_ASN1_WRITE_H
25#define POLARSSL_ASN1_WRITE_H
26
27#include "asn1.h"
28
Paul Bakkerbdb912d2012-02-13 23:11:30 +000029#define ASN1_CHK_ADD(g, f) if( ( ret = f ) < 0 ) return( ret ); else g += ret
30
31int asn1_write_len( unsigned char **p, unsigned char *start, size_t len );
32int asn1_write_tag( unsigned char **p, unsigned char *start, unsigned char tag );
33int asn1_write_mpi( unsigned char **p, unsigned char *start, mpi *X );
34int asn1_write_null( unsigned char **p, unsigned char *start );
35int asn1_write_oid( unsigned char **p, unsigned char *start, char *oid );
36int asn1_write_algorithm_identifier( unsigned char **p, unsigned char *start, char *algorithm_oid );
37int asn1_write_int( unsigned char **p, unsigned char *start, int val );
38int asn1_write_printable_string( unsigned char **p, unsigned char *start,
39 char *text );
Paul Bakker05888152012-02-16 10:26:57 +000040int asn1_write_ia5_string( unsigned char **p, unsigned char *start,
41 char *text );
Paul Bakkerbdb912d2012-02-13 23:11:30 +000042
43#endif /* POLARSSL_ASN1_WRITE_H */