> Benzy Gabay wrote:
> 
> Hi,
> 
> I'm trying programmatically to code / decode ASN1 streams.
> - Could someone tell me what are the set of API functions that I can
> use to code / decode ASN1 streams.
> 
> 

Applications use the i2d/d2i functions to encode or decode data between
memory and C structures containing each field. Currently the ASN1
functions are memory based: that is the whole encoding needs to be in
memory.

The old ASN1 code (pre 0.9.7) was buggy and an absolute nightmare to
write. I must have spent a couple of months coding the PKCS#12
structures in there some years back.

You really need to use OpenSSL 0.9.7 development snapshots for this, the
ASN1 code has been completely rewritten (by me!) and vastly easier to
use. The old stuff is obsolete and will be phased out at some point.
Also any structures written using the new ASN1 code should retain
compatibility with any future extensions such as streaming I/O based
encoders and decoders.

If you want to create your own ASN1 structures then the best thing to do
is look at some examples like those in ocsp_asn.c and the corresponding
structures in ocsp.h . There isn't any documentation yet but several
people have picked it up from just browsing the source code.

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
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to