Paul Bakker | bdb912d | 2012-02-13 23:11:30 +0000 | [diff] [blame] | 1 | /** |
| 2 | * \file asn1write.h |
| 3 | * |
| 4 | * \brief ASN.1 buffer writing functionality |
| 5 | * |
Paul Bakker | 407a0da | 2013-06-27 14:29:21 +0200 | [diff] [blame^] | 6 | * Copyright (C) 2006-2013, Brainspark B.V. |
Paul Bakker | bdb912d | 2012-02-13 23:11:30 +0000 | [diff] [blame] | 7 | * |
| 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_ASN1_WRITE_H |
| 28 | #define POLARSSL_ASN1_WRITE_H |
| 29 | |
| 30 | #include "asn1.h" |
| 31 | |
Paul Bakker | bdb912d | 2012-02-13 23:11:30 +0000 | [diff] [blame] | 32 | #define ASN1_CHK_ADD(g, f) if( ( ret = f ) < 0 ) return( ret ); else g += ret |
| 33 | |
Paul Bakker | 407a0da | 2013-06-27 14:29:21 +0200 | [diff] [blame^] | 34 | #ifdef __cplusplus |
| 35 | extern "C" { |
| 36 | #endif |
| 37 | |
Paul Bakker | bdb912d | 2012-02-13 23:11:30 +0000 | [diff] [blame] | 38 | int asn1_write_len( unsigned char **p, unsigned char *start, size_t len ); |
| 39 | int asn1_write_tag( unsigned char **p, unsigned char *start, unsigned char tag ); |
Paul Bakker | ed27a04 | 2013-04-18 22:46:23 +0200 | [diff] [blame] | 40 | #if defined(POLARSSL_BIGNUM_C) |
Paul Bakker | bdb912d | 2012-02-13 23:11:30 +0000 | [diff] [blame] | 41 | int asn1_write_mpi( unsigned char **p, unsigned char *start, mpi *X ); |
Paul Bakker | ed27a04 | 2013-04-18 22:46:23 +0200 | [diff] [blame] | 42 | #endif |
Paul Bakker | bdb912d | 2012-02-13 23:11:30 +0000 | [diff] [blame] | 43 | int asn1_write_null( unsigned char **p, unsigned char *start ); |
Paul Bakker | 37de6be | 2013-04-07 13:11:31 +0200 | [diff] [blame] | 44 | int asn1_write_oid( unsigned char **p, unsigned char *start, const char *oid ); |
| 45 | int asn1_write_algorithm_identifier( unsigned char **p, unsigned char *start, const char *algorithm_oid ); |
Paul Bakker | bdb912d | 2012-02-13 23:11:30 +0000 | [diff] [blame] | 46 | int asn1_write_int( unsigned char **p, unsigned char *start, int val ); |
| 47 | int asn1_write_printable_string( unsigned char **p, unsigned char *start, |
| 48 | char *text ); |
Paul Bakker | 0588815 | 2012-02-16 10:26:57 +0000 | [diff] [blame] | 49 | int asn1_write_ia5_string( unsigned char **p, unsigned char *start, |
| 50 | char *text ); |
Paul Bakker | bdb912d | 2012-02-13 23:11:30 +0000 | [diff] [blame] | 51 | |
Paul Bakker | 407a0da | 2013-06-27 14:29:21 +0200 | [diff] [blame^] | 52 | #ifdef __cplusplus |
| 53 | } |
| 54 | #endif |
| 55 | |
Paul Bakker | bdb912d | 2012-02-13 23:11:30 +0000 | [diff] [blame] | 56 | #endif /* POLARSSL_ASN1_WRITE_H */ |