Function silc_asn1_alloc
SYNOPSIS
SilcAsn1 silc_asn1_alloc(void);
DESCRIPTION
Allocates and initializes ASN.1 encoder/decoder and returns SilcAsn1
context or NULL on error. This context can be used with both
silc_asn1_encode and silc_asn1_decode functions.
Usually SilcAsn1 is allocated when encoder or decoder is needed,
however it is also possible to allocate long-lasting SilcAsn1 and
use that every time ASN.1 routines are needed. Application could
for example allocate one SilcAsn1 and use that for all ASN.1 encoding
and decoding.
When this context is freed with silc_asn1_free all memory will be
freed, and all encoded ASN.1 buffers becomes invalid. Also all
data that is returned by silc_asn1_decode function becomes invalid.
|