1asn1_read_value_type(3)            libtasn1            asn1_read_value_type(3)
2
3
4

NAME

6       asn1_read_value_type - API function
7

SYNOPSIS

9       #include <libtasn1.h>
10
11       int  asn1_read_value_type(asn1_node_const root, const char * name, void
12       * ivalue, int * len, unsigned int * etype);
13

ARGUMENTS

15       asn1_node_const root
16                   pointer to a structure.
17
18       const char * name
19                   the name of the element inside a structure that you want to
20                   read.
21
22       void * ivalue
23                   vector  that  will contain the element's content, must be a
24                   pointer to memory cells already allocated (may be NULL).
25
26       int * len   number of bytes of *value: value[0]..value[len-1]. Initialy
27                   holds the sizeof value.
28
29       unsigned int * etype
30                   The type of the value read (ASN1_ETYPE)
31

DESCRIPTION

33       Returns  the  type  and value of one element inside a structure.  If an
34       element is OPTIONAL and this returns ASN1_ELEMENT_NOT_FOUND,  it  means
35       that  this  element wasn't present in the der encoding that created the
36       structure.  The first element of a SEQUENCE_OF or SET_OF is named "?1".
37       The  second one "?2" and so on. If the  root provided is a node to spe‐
38       cific sequence element, then the keyword "?CURRENT" is also  acceptable
39       and indicates the current sequence element of this node.
40
41       Note  that  there  can  be valid values with length zero. In these case
42       this function will succeed and  len will be zero.
43

INTEGER

45       VALUE will contain a two's complement form integer.
46
47       integer=-1  -> value[0]=0xFF , len=1.  integer=1   ->  value[0]=0x01  ,
48       len=1.
49

ENUMERATED

51       As INTEGER (but only with not negative numbers).
52

BOOLEAN

54       VALUE will be the null terminated string "TRUE" or "FALSE" and LEN=5 or
55       LEN=6.
56
57       OBJECT IDENTIFIER: VALUE will be a null  terminated  string  with  each
58       number separated by a dot (i.e. "1.2.3.543.1").
59
60       LEN = strlen(VALUE)+1
61

UTCTIME

63       VALUE will be a null terminated string in one of these formats: "YYMMD‐
64       Dhhmmss+hh'mm'" or "YYMMDDhhmmss-hh'mm'".  LEN=strlen(VALUE)+1.
65

GENERALIZEDTIME

67       VALUE will be a null terminated string in the same format used  to  set
68       the value.
69
70       OCTET  STRING:  VALUE will contain the octet string and LEN will be the
71       number of octets.
72

GENERALSTRING

74       VALUE will contain the generalstring and LEN  will  be  the  number  of
75       octets.
76
77       BIT  STRING:  VALUE  will contain the bit string organized by bytes and
78       LEN will be the number of bits.
79

CHOICE

81       If NAME indicates a choice type, VALUE will specify the alternative se‐
82       lected.
83

ANY

85       If  NAME indicates an any type, VALUE will indicate the DER encoding of
86       the structure actually used.
87

RETURNS

89       ASN1_SUCCESS if value is returned, ASN1_ELEMENT_NOT_FOUND if   name  is
90       not  a valid element, ASN1_VALUE_NOT_FOUND if there isn't any value for
91       the element selected, and ASN1_MEM_ERROR if The value vector isn't  big
92       enough to store the result, and in this case  len will contain the num‐
93       ber of bytes needed. On the  occasion  that  the  stored  data  are  of
94       zero-length  this function may return ASN1_SUCCESS even if the provided
95       len is zero.
96
98       Copyright © 2006-2022 Free Software Foundation, Inc..
99       Copying and distribution of this file, with  or  without  modification,
100       are  permitted in any medium without royalty provided the copyright no‐
101       tice and this notice are preserved.
102

SEE ALSO

104       The full documentation for libtasn1 is maintained as a Texinfo  manual.
105       If  the info and libtasn1 programs are properly installed at your site,
106       the command
107
108              info libtasn1
109
110       should give you access to the complete manual.  As an  alternative  you
111       may obtain the manual from:
112
113              https://www.gnu.org/software/libtasn1/manual/
114
115libtasn1                            4.19.0             asn1_read_value_type(3)
Impressum