excellent tutorial.  I think I am close.

The following program returns:

06 08 2a 86 48 86 f7 0d 02 05

if I say "MD5", but note that the length returned is 8, and bp is
incremented by 10.  How do I interpret the length parameter or am I
missing something?

#include <stdio.h>
#include <asn1.h>
#include <objects.h>

int main(int argc, char *argv[]) {

unsigned char buf[4096], *bp;
int i,j;

bp = buf;
i = i2d_ASN1_OBJECT(OBJ_nid2obj(OBJ_sn2nid(argv[1])),&bp);
for( j = 0 ; j < i + 2 ; j++ )
  fprintf( stdout , "%02x ", buf[j] );
fprintf(stdout, "\n" );

return 0;
}

--- reply to tzeruch - at - ceddec - dot - com ---
+-------------------------------------------------------------------------+
| Administrative requests should be sent to [EMAIL PROTECTED] |
| List service provided by Open Software Associates, http://www.osa.com/  |
+-------------------------------------------------------------------------+

Reply via email to