~ubuntu-branches/ubuntu/trusty/libtasn1-3/trusty

« back to all changes in this revision

Viewing changes to doc/man/asn1_read_value.3

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2006-06-07 20:14:52 UTC
  • Revision ID: james.westby@ubuntu.com-20060607201452-7a9dojyu7i2kfbyp
Tags: upstream-0.3.4
ImportĀ upstreamĀ versionĀ 0.3.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\" DO NOT MODIFY THIS FILE!  It was generated by gdoc.
 
2
.TH "asn1_read_value" 3 "0.3.4" "libtasn1" "libtasn1"
 
3
.SH NAME
 
4
asn1_read_value \- Returns the value of one element inside a structure
 
5
.SH SYNOPSIS
 
6
.B #include <libtasn1.h>
 
7
.sp
 
8
.BI "asn1_retCode asn1_read_value(ASN1_TYPE " root ", const char * " name ", void * " ivalue ", int * " len ");"
 
9
.SH ARGUMENTS
 
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.
 
17
.IP "int * len" 12
 
18
number of bytes of *value: value[0]..value[len-1]. Initialy
 
19
holds the sizeof value.
 
20
.SH "DESCRIPTION"
 
21
Returns the value of one element inside a structure.
 
22
 
 
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
 
27
so on.
 
28
.SH "INTEGER"
 
29
VALUE will contain a two's complement form integer.
 
30
 
 
31
integer=-1  -> value[0]=0xFF , len=1.
 
32
integer=1   -> value[0]=0x01 , len=1.
 
33
.SH "ENUMERATED"
 
34
As INTEGER (but only with not negative numbers).
 
35
.SH "BOOLEAN"
 
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").
 
41
 
 
42
LEN = strlen(VALUE)+1
 
43
.SH "UTCTIME"
 
44
VALUE will be a null terminated string in one of these
 
45
formats: "YYMMDDhhmmss+hh'mm'" or "YYMMDDhhmmss-hh'mm'".
 
46
LEN=strlen(VALUE)+1.
 
47
.SH "GENERALIZEDTIME"
 
48
VALUE will be a null terminated string in the
 
49
same format used to set the value.
 
50
.SH "OCTET STRING"
 
51
VALUE will contain the octet string and LEN will be
 
52
the number of octets.
 
53
.SH "GENERALSTRING"
 
54
VALUE will contain the generalstring and LEN will
 
55
be the number of octets.
 
56
.SH "BIT STRING"
 
57
VALUE will contain the bit string organized by bytes
 
58
and LEN will be the number of bits.
 
59
.SH "CHOICE"
 
60
If NAME indicates a choice type, VALUE will specify the
 
61
alternative selected.
 
62
.SH "ANY"
 
63
If NAME indicates an any type, VALUE will indicate the DER
 
64
encoding of the structure actually used.
 
65
.SH "RETURNS"
 
66
.SH "ASN1_SUCCESS"
 
67
Set value OK.
 
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.
 
72
.SH "ASN1_MEM_ERROR"
 
73
The value vector isn't big enough to store the result.
 
74
In this case LEN will contain the number of bytes needed.
 
75
.SH COPYRIGHT
 
76
Copyright \(co 2001, 2002, 2003 Fabio Fiorina.
 
77
.br
 
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.
 
81
.SH "SEE ALSO"
 
82
The full documentation for
 
83
.B libtasn1
 
84
is maintained as a Texinfo manual.  If the
 
85
.B info
 
86
and
 
87
.B libtasn1
 
88
programs are properly installed at your site, the command
 
89
.IP
 
90
.B info libtasn1
 
91
.PP
 
92
should give you access to the complete manual.