2 * Copyright (C) 2000,2001 Fabio Fiorina
4 * This file is part of GNUTLS.
6 * GNUTLS is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * GNUTLS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
22 /*****************************************************/
23 /* File: PkixTabExample.c */
24 /* Description: An example on how to use the */
25 /* 'asn1_parser_asn1_file_c' function. */
26 /*****************************************************/
34 main(int argc,char *argv[])
38 char errorDescription[MAX_ERROR_DESCRIPTION_SIZE];
42 fprintf(stderr, "Usage: %s: input.asn output.c\n", argv[0]);
46 if (argc==3) outfile=argv[2];
49 result=asn1_parser2array( argv[1], outfile, NULL, errorDescription);
51 if(result==ASN1_SYNTAX_ERROR){
52 printf("PARSE ERROR\n");
55 else if(result==ASN1_IDENTIFIER_NOT_FOUND){
56 printf("IDENTIFIER NOT FOUND\n");
59 else if(result==ASN1_FILE_NOT_FOUND){
60 printf("FILE NOT FOUND\n");