1
.\" DO NOT MODIFY THIS FILE! It was generated by gdoc.
2
.TH "asn1_read_value" 3 "0.3.4" "libtasn1" "libtasn1"
4
asn1_read_value \- Returns the value of one element inside a structure
6
.B #include <libtasn1.h>
8
.BI "asn1_retCode asn1_read_value(ASN1_TYPE " root ", const char * " name ", void * " ivalue ", int * " len ");"
10
.IP "ASN1_TYPE root" 12
11
pointer to a structure.
12
.IP "const char * name" 12
13
the name of the element inside a structure that you want to read.
14
.IP "void * ivalue" 12
15
vector that will contain the element's content, must be a
16
pointer to memory cells already allocated.
18
number of bytes of *value: value[0]..value[len-1]. Initialy
19
holds the sizeof value.
21
Returns the value of one element inside a structure.
23
If an element is OPTIONAL and the function "read_value" returns
24
\fBASN1_ELEMENT_NOT_FOUND\fP, it means that this element wasn't present
25
in the der encoding that created the structure. The first element
26
of a SEQUENCE_OF or SET_OF is named "?1". The second one "?2" and
29
VALUE will contain a two's complement form integer.
31
integer=-1 -> value[0]=0xFF , len=1.
32
integer=1 -> value[0]=0x01 , len=1.
34
As INTEGER (but only with not negative numbers).
36
VALUE will be the null terminated string "TRUE" or
37
"FALSE" and LEN=5 or LEN=6.
38
.SH "OBJECT IDENTIFIER"
39
VALUE will be a null terminated string with
40
each number separated by a dot (i.e. "1.2.3.543.1").
44
VALUE will be a null terminated string in one of these
45
formats: "YYMMDDhhmmss+hh'mm'" or "YYMMDDhhmmss-hh'mm'".
48
VALUE will be a null terminated string in the
49
same format used to set the value.
51
VALUE will contain the octet string and LEN will be
54
VALUE will contain the generalstring and LEN will
55
be the number of octets.
57
VALUE will contain the bit string organized by bytes
58
and LEN will be the number of bits.
60
If NAME indicates a choice type, VALUE will specify the
63
If NAME indicates an any type, VALUE will indicate the DER
64
encoding of the structure actually used.
68
.SH "ASN1_ELEMENT_NOT_FOUND"
69
NAME is not a valid element.
70
.SH "ASN1_VALUE_NOT_FOUND"
71
There isn't any value for the element selected.
73
The value vector isn't big enough to store the result.
74
In this case LEN will contain the number of bytes needed.
76
Copyright \(co 2001, 2002, 2003 Fabio Fiorina.
78
Permission is granted to make and distribute verbatim copies of this
79
manual provided the copyright notice and this permission notice are
80
preserved on all copies.
82
The full documentation for
84
is maintained as a Texinfo manual. If the
88
programs are properly installed at your site, the command
92
should give you access to the complete manual.