Upload Tizen:Main source
[external/libtasn1.git] / doc / texi / asn1_der_decoding_element.texi
1 @subheading asn1_der_decoding_element
2 @anchor{asn1_der_decoding_element}
3 @deftypefun {asn1_retCode} {asn1_der_decoding_element} (ASN1_TYPE * @var{structure}, const char * @var{elementName}, const void * @var{ider}, int @var{len}, char * @var{errorDescription})
4 @var{structure}: pointer to an ASN1 structure
5
6 @var{elementName}: name of the element to fill
7
8 @var{ider}: vector that contains the DER encoding of the whole structure.
9
10 @var{len}: number of bytes of *der: der[0]..der[len-1]
11
12 @var{errorDescription}: null-terminated string contains details when an
13 error occurred.
14
15 Fill the element named @code{ELEMENTNAME} with values of a DER encoding
16 string.  The structure must just be created with function
17 @code{asn1_create_element()}.  The DER vector must contain the encoding
18 string of the whole @code{STRUCTURE}.  If an error occurs during the
19 decoding procedure, the *@code{STRUCTURE} is deleted and set equal to
20 @code{ASN1_TYPE_EMPTY}.
21
22 @strong{Returns:} @code{ASN1_SUCCESS} if DER encoding OK, @code{ASN1_ELEMENT_NOT_FOUND}
23 if ELEMENT is @code{ASN1_TYPE_EMPTY} or @code{elementName} == NULL, and
24 @code{ASN1_TAG_ERROR} or @code{ASN1_DER_ERROR} if the der encoding doesn't
25 match the structure @code{structure} (*ELEMENT deleted).
26 @end deftypefun
27