Cryptography Reference
In-Depth Information
if ( !buffer )
{
perror( “Not enough memory” );
return 3;
}
bufptr = buffer;
while ( bytes_read = read( certificate_file, ( void * ) buffer,
certificate_file_stat.st_size ) )
{
bufptr += bytes_read;
}
asn1parse( buffer, buffer_size, &certificate );
asn1show( 0, &certificate );
asn1free( &certificate );
return 0;
}
#endif
This invokes the asn1show routine in Listing 5-8.
Listing 5-8: “asn1.c” asn1show
static char *tag_names[] = {
“BER”, // 0
“BOOLEAN”, // 1
“INTEGER”, // 2
“BIT STRING”, // 3
“OCTET STRING”, // 4
“NULL”, // 5
“OBJECT IDENTIFIER”, // 6
“ObjectDescriptor”, // 7
“INSTANCE OF, EXTERNAL”, // 8
“REAL”, // 9
“ENUMERATED”, // 10
“EMBEDDED PPV”, // 11
“UTF8String”, // 12
“RELATIVE-OID”, // 13
“undefined(14)”, // 14
“undefined(15)”, // 15
“SEQUENCE, SEQUENCE OF”, // 16
“SET, SET OF”, // 17
“NumericString”, // 18
“PrintableString”, // 19
“TeletexString, T61String”, // 20
 
Search WWH ::




Custom Search