Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /**
  2.  * \file asn1write.h
  3.  *
  4.  * \brief ASN.1 buffer writing functionality
  5.  *
  6.  *  Copyright (C) 2006-2012, Brainspark B.V.
  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.  
  32. #define ASN1_CHK_ADD(g, f) if( ( ret = f ) < 0 ) return( ret ); else g += ret
  33.  
  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 );
  45.  
  46. #endif /* POLARSSL_ASN1_WRITE_H */
  47.