.\" DO NOT MODIFY THIS FILE! It was generated by gdoc. .TH "asn1_read_value" 3 "4.13" "libtasn1" "libtasn1" .SH NAME asn1_read_value \- API function .SH SYNOPSIS .B #include .sp .BI "int asn1_read_value(asn1_node " root ", const char * " name ", void * " ivalue ", int * " len ");" .SH ARGUMENTS .IP "asn1_node root" 12 pointer to a structure. .IP "const char * name" 12 the name of the element inside a structure that you want to read. .IP "void * ivalue" 12 vector that will contain the element's content, must be a pointer to memory cells already allocated (may be \fBNULL\fP). .IP "int * len" 12 number of bytes of *value: value[0]..value[len\-1]. Initialy holds the sizeof value. .SH "DESCRIPTION" Returns the value of one element inside a structure. If an element is OPTIONAL and this returns \fBASN1_ELEMENT_NOT_FOUND\fP, it means that this element wasn't present in the der encoding that created the structure. The first element of a SEQUENCE_OF or SET_OF is named "?1". The second one "?2" and so on. If the \fIroot\fP provided is a node to specific sequence element, then the keyword "?CURRENT" is also acceptable and indicates the current sequence element of this node. Note that there can be valid values with length zero. In these case this function will succeed and \fIlen\fP will be zero. .SH "INTEGER" VALUE will contain a two's complement form integer. integer=\-1 \-> value[0]=0xFF , len=1. integer=1 \-> value[0]=0x01 , len=1. .SH "ENUMERATED" As INTEGER (but only with not negative numbers). .SH "BOOLEAN" VALUE will be the null terminated string "TRUE" or "FALSE" and LEN=5 or LEN=6. OBJECT IDENTIFIER: VALUE will be a null terminated string with each number separated by a dot (i.e. "1.2.3.543.1"). LEN = strlen(VALUE)+1 .SH "UTCTIME" VALUE will be a null terminated string in one of these formats: "YYMMDDhhmmss+hh'mm'" or "YYMMDDhhmmss\-hh'mm'". LEN=strlen(VALUE)+1. .SH "GENERALIZEDTIME" VALUE will be a null terminated string in the same format used to set the value. OCTET STRING: VALUE will contain the octet string and LEN will be the number of octets. .SH "GENERALSTRING" VALUE will contain the generalstring and LEN will be the number of octets. BIT STRING: VALUE will contain the bit string organized by bytes and LEN will be the number of bits. .SH "CHOICE" If NAME indicates a choice type, VALUE will specify the alternative selected. .SH "ANY" If NAME indicates an any type, VALUE will indicate the DER encoding of the structure actually used. .SH "RETURNS" \fBASN1_SUCCESS\fP if value is returned, \fBASN1_ELEMENT_NOT_FOUND\fP if \fIname\fP is not a valid element, \fBASN1_VALUE_NOT_FOUND\fP if there isn't any value for the element selected, and \fBASN1_MEM_ERROR\fP if The value vector isn't big enough to store the result, and in this case \fIlen\fP will contain the number of bytes needed. On the occasion that the stored data are of zero\-length this function may return \fBASN1_SUCCESS\fP even if the provided \fIlen\fP is zero. .SH COPYRIGHT Copyright \(co 2006-2015 Free Software Foundation, Inc.. .br Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. .SH "SEE ALSO" The full documentation for .B libtasn1 is maintained as a Texinfo manual. If the .B info and .B libtasn1 programs are properly installed at your site, the command .IP .B info libtasn1 .PP should give you access to the complete manual. As an alternative you may obtain the manual from: .IP .B http://www.gnu.org/software/libtasn1/manual/ .PP