"Hellan,Kim KHE" wrote: > > Thank you, > > You got me on the right track. > One small question, though.... > When reading text data from a ASN1_IA5STRING, is it then correct just to > cast the "data" variable to a char pointer, like in this case: > mystring = (char*) pGenName->d.ia5->data; > > ...or is there a function to return the text? >
For any ASN1_STRING structure (which covers ASN1_IA5STRING) you can use ASN1_STRING_data(ia5), and ASN1_STRING_length(ia5). For this you can assume the result will be NULL terminated but other strings like an ASN1_OCTET_STRING may contain embedded zeros. Steve. -- Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/ Personal Email: [EMAIL PROTECTED] Senior crypto engineer, Gemplus: http://www.gemplus.com/ Core developer of the OpenSSL project: http://www.openssl.org/ Business Email: [EMAIL PROTECTED] PGP key: via homepage. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
