initial commit; it works
[psslcertgen.git] / src / libpolarssl / asn1write.h
blob52b9baa96aa08d13d32eeab77809940eb3a55b35
1 /**
2 * \file asn1write.h
4 * \brief ASN.1 buffer writing functionality
6 * Copyright (C) 2006-2012, Brainspark B.V.
8 * This file is part of PolarSSL (http://www.polarssl.org)
9 * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
11 * All rights reserved.
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.
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.
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.
27 #ifndef POLARSSL_ASN1_WRITE_H
28 #define POLARSSL_ASN1_WRITE_H
30 #include "asn1.h"
32 #define ASN1_CHK_ADD(g, f) if( ( ret = f ) < 0 ) return( ret ); else g += ret
34 int asn1_write_len( unsigned char **p, unsigned char *start, size_t len );
35 int asn1_write_tag( unsigned char **p, unsigned char *start, unsigned char tag );
36 int asn1_write_mpi( unsigned char **p, unsigned char *start, mpi *X );
37 int asn1_write_null( unsigned char **p, unsigned char *start );
38 int asn1_write_oid( unsigned char **p, unsigned char *start, char *oid );
39 int asn1_write_algorithm_identifier( unsigned char **p, unsigned char *start, char *algorithm_oid );
40 int asn1_write_int( unsigned char **p, unsigned char *start, int val );
41 int asn1_write_printable_string( unsigned char **p, unsigned char *start,
42 char *text );
43 int asn1_write_ia5_string( unsigned char **p, unsigned char *start,
44 char *text );
46 #endif /* POLARSSL_ASN1_WRITE_H */