Creates a length-value DER encoding for the input data.
The DER encoding of the input data will be placed in the der variable.

Note that the OCTET STRING tag is not included in the output.

This function does not return any value because it is expected
that der_len will contain enough bytes to store the string
plus the DER encoding. The DER encoding size can be obtained using
asn1_length_der() .

Creates the DER encoding for various simple ASN.1 types like strings etc.
It stores the tag and length in tl , which should have space for at least
ASN1_MAX_TL_SIZE bytes. Initially tl_len should contain the size of tl .

The complete DER encoding should consist of the value in tl appended
with the provided str .

Creates a length-value DER encoding for the input data
as it would have been for a BIT STRING.
The DER encoded data will be copied in der .

Note that the BIT STRING tag is not included in the output.

This function does not return any value because it is expected
that der_len will contain enough bytes to store the string
plus the DER encoding. The DER encoding size can be obtained using
asn1_length_der() .

ErrorDescription: return the error description or an empty
string if success.

Creates the DER encoding for the NAME structure (inside *POINTER
structure).

Returns:ASN1_SUCCESS if DER encoding OK, ASN1_ELEMENT_NOT_FOUND
if name is not a valid element, ASN1_VALUE_NOT_FOUND if there
is an element without a value, ASN1_MEM_ERROR if the ider vector isn’t big enough and in this case len will contain the
length needed.

Fill the structure * element with values of a DER encoding string. The
structure must just be created with function asn1_create_element() .

If ASN1_DECODE_FLAG_ALLOW_PADDING flag is set then the function will ignore
padding after the decoded DER data. Upon a successful return the value of
* max_ider_len will be set to the number of bytes decoded.

Returns:ASN1_SUCCESS if DER encoding OK, ASN1_ELEMENT_NOT_FOUND
if ELEMENT is NULL , and ASN1_TAG_ERROR or
ASN1_DER_ERROR if the der encoding doesn’t match the structure
name (* ELEMENT deleted).

Fill the element named ELEMENTNAME with values of a DER encoding
string. The structure must just be created with function
asn1_create_element() . The DER vector must contain the encoding
string of the whole STRUCTURE . If an error occurs during the
decoding procedure, the * STRUCTURE is deleted and set equal to
NULL .

This function is deprecated and may just be an alias to asn1_der_decoding
in future versions. Use asn1_der_decoding() instead.

Returns:ASN1_SUCCESS if DER encoding OK, ASN1_ELEMENT_NOT_FOUND
if ELEMENT is NULL or elementName == NULL, and
ASN1_TAG_ERROR or ASN1_DER_ERROR if the der encoding doesn’t
match the structure structure (*ELEMENT deleted).

start: the position of the first byte of NAME_ELEMENT decoding
( ider [*start])

end: the position of the last byte of NAME_ELEMENT decoding
( ider [*end])

Find the start and end point of an element in a DER encoding
string. I mean that if you have a der encoding and you have already
used the function asn1_der_decoding() to fill a structure, it may
happen that you want to find the piece of string concerning an
element of the structure.

One example is the sequence "tbsCertificate" inside an X509
certificate.

Note that since libtasn1 3.7 the ider and ider_len parameters
can be omitted, if the element is already decoded using asn1_der_decoding() .

Returns:ASN1_SUCCESS if DER encoding OK, ASN1_ELEMENT_NOT_FOUND
if ELEMENT is asn1_node EMPTY or name_element is not a valid
element, ASN1_TAG_ERROR or ASN1_DER_ERROR if the der encoding
doesn’t match the structure ELEMENT.

asn1_expand_any_defined_by

Expands every "ANY DEFINED BY" element of a structure created from
a DER decoding process (asn1_der_decoding function). The element
ANY must be defined by an OBJECT IDENTIFIER. The type used to
expand the element ANY is the first one following the definition of
the actual value of the OBJECT IDENTIFIER.

Returns:ASN1_SUCCESS if Substitution OK, ASN1_ERROR_TYPE_ANY if
some "ANY DEFINED BY" element couldn’t be expanded due to a
problem in OBJECT_ID -> TYPE association, or other error codes
depending on DER decoding.

objectName: name of the OBJECT IDENTIFIER field to use to define
the type for expansion.

Expands an "OCTET STRING" element of a structure created from a DER
decoding process (the asn1_der_decoding() function). The type used
for expansion is the first one following the definition of the
actual value of the OBJECT IDENTIFIER indicated by OBJECTNAME.

Returns:ASN1_SUCCESS if substitution OK, ASN1_ELEMENT_NOT_FOUND
if objectName or octetName are not correct,
ASN1_VALUE_NOT_VALID if it wasn’t possible to find the type to
use for expansion, or other errors depending on DER decoding.